Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports the Refined
type with its
constructor. This is very risky! In particular, the Coercible
instances will be visible throughout the importing module.
It is usually better to build the necessary coercions locally
using the utilities in Refined.Unsafe, but in some cases
it may be more convenient to write a separate module that
imports this one and exports some large coercion.
Documentation
A refinement type, which wraps a value of type x
,
ensuring that it satisfies a type-level predicate p
.
Refined x |
Instances
Foldable (Refined p) Source # | |
Defined in Refined.Internal fold :: Monoid m => Refined p m -> m # foldMap :: Monoid m => (a -> m) -> Refined p a -> m # foldr :: (a -> b -> b) -> b -> Refined p a -> b # foldr' :: (a -> b -> b) -> b -> Refined p a -> b # foldl :: (b -> a -> b) -> b -> Refined p a -> b # foldl' :: (b -> a -> b) -> b -> Refined p a -> b # foldr1 :: (a -> a -> a) -> Refined p a -> a # foldl1 :: (a -> a -> a) -> Refined p a -> a # toList :: Refined p a -> [a] # length :: Refined p a -> Int # elem :: Eq a => a -> Refined p a -> Bool # maximum :: Ord a => Refined p a -> a # minimum :: Ord a => Refined p a -> a # | |
Eq x => Eq (Refined p x) Source # | |
Ord x => Ord (Refined p x) Source # | |
Defined in Refined.Internal | |
(Read x, Predicate p x) => Read (Refined p x) Source # | This instance makes sure to check the refinement. |
Show x => Show (Refined p x) Source # | |
Lift x => Lift (Refined p x) Source # | |