Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module exposes unsafe refinements. An unsafe refinement
is one which either does not make the guarantee of totality in construction
of the Refined
value or does not perform a check of the refinement
predicate. It is recommended only to use this when you can manually prove
that the refinement predicate holds.
Synopsis
- data Refined (p :: k) x
- data Refined1 (p :: k) f x
- reallyUnsafeRefine :: x -> Refined p x
- reallyUnsafeRefine1 :: f x -> Refined1 p f x
- unsafeRefine :: Predicate p x => x -> Refined p x
- reallyUnsafeUnderlyingRefined :: Coercion x (Refined p x)
- reallyUnsafeAllUnderlyingRefined :: ((forall x y p. Coercible x y => Coercible y (Refined p x)) => r) -> r
- reallyUnsafePredEquiv :: Coercion (Refined p x) (Refined q x)
Refined
data Refined (p :: k) x Source #
A refinement type, which wraps a value of type x
.
Since: 0.1.0.0
Instances
data Refined1 (p :: k) f x Source #
A refinement type, which wraps a value of type f x
.
The predicate is applied over the functor f
. Thus, we may safely recover
various Functor
y instances, because no matter what you do to the
values inside the functor, the predicate may not be invalidated.
Instances
Creation
reallyUnsafeRefine :: x -> Refined p x Source #
Constructs a Refined
value, completely
ignoring any refinements! Use this only
when you can manually prove that the refinement
holds.
Since: 0.3.0.0
reallyUnsafeRefine1 :: f x -> Refined1 p f x Source #
unsafeRefine :: Predicate p x => x -> Refined p x Source #
Coercion
reallyUnsafeUnderlyingRefined :: Coercion x (Refined p x) Source #
A coercion between a type and any refinement of that type. See Data.Type.Coercion for functions manipulating coercions.
Since: 0.3.0.0