Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (rae@cs.brynmawr.edu) |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Singletons.Decide
Description
Defines the class SDecide
, allowing for decidable equality over singletons.
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.
Minimal complete definition
Supporting definitions
data (k :~: (a :: k)) (b :: k) :: forall k. k -> k -> * where infix 4 #
Propositional equality. If a :~: b
is inhabited by some terminating
value, then the type a
is the same as the type b
. To use this equality
in practice, pattern-match on the a :~: b
to get out the Refl
constructor;
in the body of the pattern-match, the compiler knows that a ~ b
.
Since: 4.7.0.0
Instances
TestCoercion k ((:~:) k a) | Since: 4.7.0.0 |
TestEquality k ((:~:) k a) | Since: 4.7.0.0 |
(~) k a b => Bounded ((:~:) k a b) | Since: 4.7.0.0 |
(~) k a b => Enum ((:~:) k a b) | Since: 4.7.0.0 |
Eq ((:~:) k a b) | |
((~) * a b, Data a) => Data ((:~:) * a b) | Since: 4.7.0.0 |
Ord ((:~:) k a b) | |
(~) k a b => Read ((:~:) k a b) | Since: 4.7.0.0 |
Show ((:~:) k a b) | |
Uninhabited data type
Since: 4.8.0.0
Instances
Eq Void | Since: 4.8.0.0 |
Data Void | |
Ord Void | Since: 4.8.0.0 |
Read Void | Reading a |
Show Void | Since: 4.8.0.0 |
Ix Void | Since: 4.8.0.0 |
Generic Void | |
Semigroup Void | Since: 4.9.0.0 |
Exception Void | Since: 4.8.0.0 |
type Rep Void | |
A Decision
about a type a
is either a proof of existence or a proof that a
cannot exist.
Orphan instances
SDecide k3 => TestEquality k3 (Sing k3) Source # | |