Copyright | (C) 2007-2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | ConstraintKinds |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Documentation
class (Generic a, GDeciding q (Rep a)) => Deciding q a where Source
This provides machinery for deconstructing an arbitrary Generic
instance using a Decidable
Contravariant
functor.
Examples:
gcompare ::Deciding
Ord
a => a -> a ->Ordering
gcompare =getComparison
$deciding
(Proxy :: ProxyOrd
) (Comparison
compare
)
geq ::Deciding
Eq
a => a -> a ->Bool
geq =getEquivalence
$deciding
(Proxy :: ProxyEq
) (Equivalence
(==
))
class (Generic1 t, GDeciding1 q (Rep1 t)) => Deciding1 q t where Source
This provides machinery for deconstructing an arbitrary Generic1
instance using a Decidable
Contravariant
functor.
Examples:
gcompare1 ::Deciding1
Ord
f => (a -> a ->Ordering
) -> f a -> f a ->Ordering
gcompare1 f =getComparison
$deciding1
(Proxy :: ProxyOrd
) (Comparison
compare) (Comparison
f)
geq1 ::Deciding1
Eq
f => (a -> a ->Bool
) -> f a -> f a ->Bool
geq1 f =getEquivalence
$deciding1
(Proxy :: ProxyEq
) (Equivalence
(==
)) (Equivalence
f)