| Copyright | (C) 2013 Richard Eisenberg |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Ryan Scott |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Singletons.Decide
Description
Defines the class SDecide, allowing for decidable equality over singletons.
Synopsis
The SDecide class
class SDecide k where Source #
Members of the SDecide "kind" class support decidable equality. Instances
of this class are generated alongside singleton definitions for datatypes that
derive an Eq instance.
Supporting definitions
data (a :: k) :~: (b :: k) where #
Instances
| TestCoercion ((:~:) a :: k -> Type) | |
Defined in GHC.Internal.Data.Type.Coercion Methods testCoercion :: forall (a0 :: k) (b :: k). (a :~: a0) -> (a :~: b) -> Maybe (Coercion a0 b) | |
| TestEquality ((:~:) a :: k -> Type) | |
Defined in GHC.Internal.Data.Type.Equality Methods testEquality :: forall (a0 :: k) (b :: k). (a :~: a0) -> (a :~: b) -> Maybe (a0 :~: b) | |
| a ~ b => Bounded (a :~: b) | |
Defined in GHC.Internal.Data.Type.Equality | |
| a ~ b => Enum (a :~: b) | |
Defined in GHC.Internal.Data.Type.Equality | |
| a ~ b => Read (a :~: b) | |
Defined in GHC.Internal.Data.Type.Equality | |
| Show (a :~: b) | |
| Eq (a :~: b) | |
| Ord (a :~: b) | |
Defined in GHC.Internal.Data.Type.Equality | |
A Decision about a type a is either a proof of existence or a proof that a
cannot exist.
decideEquality :: forall k (a :: k) (b :: k). SDecide k => Sing a -> Sing b -> Maybe (a :~: b) Source #
A suitable default implementation for testEquality that leverages
SDecide.
decideCoercion :: forall k (a :: k) (b :: k). SDecide k => Sing a -> Sing b -> Maybe (Coercion a b) Source #
A suitable default implementation for testCoercion that leverages
SDecide.
Orphan instances
| SDecide k => TestCoercion (WrappedSing :: k -> Type) Source # | |
Methods testCoercion :: forall (a :: k) (b :: k). WrappedSing a -> WrappedSing b -> Maybe (Coercion a b) | |
| SDecide k => TestEquality (WrappedSing :: k -> Type) Source # | |
Methods testEquality :: forall (a :: k) (b :: k). WrappedSing a -> WrappedSing b -> Maybe (a :~: b) | |