Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Ryan Scott |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Defines the SEq singleton version of the Eq type class.
Synopsis
- class PEq a where
- class SEq k where
- type family DefaultEq a b where ...
- data (==@#@$) a6989586621679370055
- data a6989586621679370055 ==@#@$$ a6989586621679370056
- type (==@#@$$$) (a6989586621679370055 :: a) (a6989586621679370056 :: a) = (==) a6989586621679370055 a6989586621679370056 :: Bool
- data (/=@#@$) a6989586621679370058
- data a6989586621679370058 /=@#@$$ a6989586621679370059
- type (/=@#@$$$) (a6989586621679370058 :: a) (a6989586621679370059 :: a) = (/=) a6989586621679370058 a6989586621679370059 :: Bool
- data DefaultEqSym0 a6989586621679370061
- data DefaultEqSym1 a6989586621679370061 a6989586621679370062
- type DefaultEqSym2 (a6989586621679370061 :: k) (a6989586621679370062 :: k) = DefaultEq a6989586621679370061 a6989586621679370062 :: Bool
Documentation
The promoted analogue of Eq
. If you supply no definition for (==)
,
then it defaults to a use of DefaultEq
.
Instances
PEq Bool Source # | |
PEq Ordering Source # | |
PEq Nat Source # | |
PEq Symbol Source # | |
PEq () Source # | |
PEq Void Source # | |
PEq All Source # | |
PEq Any Source # | |
PEq [a] Source # | |
PEq (Maybe a) Source # | |
PEq (TYPE rep) Source # | |
PEq (Min a) Source # | |
PEq (Max a) Source # | |
PEq (First a) Source # | |
PEq (Last a) Source # | |
PEq (WrappedMonoid m) Source # | |
PEq (Option a) Source # | |
PEq (Identity a) Source # | |
PEq (First a) Source # | |
PEq (Last a) Source # | |
PEq (Dual a) Source # | |
PEq (Sum a) Source # | |
PEq (Product a) Source # | |
PEq (Down a) Source # | |
PEq (NonEmpty a) Source # | |
PEq (Either a b) Source # | |
PEq (a, b) Source # | |
PEq (Arg a b) Source # | |
PEq (Proxy s) Source # | |
PEq (a, b, c) Source # | |
PEq (Const a b) Source # | |
PEq (a, b, c, d) Source # | |
PEq (a, b, c, d, e) Source # | |
PEq (a, b, c, d, e, f) Source # | |
PEq (a, b, c, d, e, f, g) Source # | |
The singleton analogue of Eq
. Unlike the definition for Eq
, it is required
that instances define a body for (%==)
. You may also supply a body for (%/=)
.
(%==) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a == b) infix 4 Source #
Boolean equality on singletons
(%/=) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a /= b) infix 4 Source #
Boolean disequality on singletons
Instances
type family DefaultEq a b where ... Source #
A sensible way to compute Boolean equality for types of any kind. Note
that this definition is slightly different from the (==)
type family
from Data.Type.Equality in base
, as (==)
attempts to distinguish
applications of type constructors from other types. As a result,
a == a
does not reduce to True
for every a
, but
does reduce to DefaultEq
a aTrue
for every a
. The latter behavior is more desirable
for singletons
' purposes, so we use it instead of (==)
.
Defunctionalization symbols
data (==@#@$) a6989586621679370055 infix 4 Source #
Instances
SEq a => SingI ((==@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$) :: TyFun a (a ~> Bool) -> Type) (a6989586621679370055 :: a) Source # | |
data a6989586621679370055 ==@#@$$ a6989586621679370056 infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((==@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$$) a6989586621679370055 :: TyFun a Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$$) a6989586621679370055 :: TyFun a Bool -> Type) (a6989586621679370056 :: a) Source # | |
type (==@#@$$$) (a6989586621679370055 :: a) (a6989586621679370056 :: a) = (==) a6989586621679370055 a6989586621679370056 :: Bool infix 4 Source #
data (/=@#@$) a6989586621679370058 infix 4 Source #
Instances
SEq a => SingI ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) (a6989586621679370058 :: a) Source # | |
data a6989586621679370058 /=@#@$$ a6989586621679370059 infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((/=@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$$) a6989586621679370058 :: TyFun a Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$$) a6989586621679370058 :: TyFun a Bool -> Type) (a6989586621679370059 :: a) Source # | |
type (/=@#@$$$) (a6989586621679370058 :: a) (a6989586621679370059 :: a) = (/=) a6989586621679370058 a6989586621679370059 :: Bool infix 4 Source #
data DefaultEqSym0 a6989586621679370061 Source #
Instances
SuppressUnusedWarnings (DefaultEqSym0 :: TyFun k (k ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym0 :: TyFun k (k ~> Bool) -> Type) (a6989586621679370061 :: k) Source # | |
Defined in Data.Singletons.Prelude.Eq type Apply (DefaultEqSym0 :: TyFun k (k ~> Bool) -> Type) (a6989586621679370061 :: k) = DefaultEqSym1 a6989586621679370061 |
data DefaultEqSym1 a6989586621679370061 a6989586621679370062 Source #
Instances
SuppressUnusedWarnings (DefaultEqSym1 a6989586621679370061 :: TyFun k Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym1 a6989586621679370061 :: TyFun k Bool -> Type) (a6989586621679370062 :: k) Source # | |
Defined in Data.Singletons.Prelude.Eq type Apply (DefaultEqSym1 a6989586621679370061 :: TyFun k Bool -> Type) (a6989586621679370062 :: k) = DefaultEqSym2 a6989586621679370061 a6989586621679370062 |
type DefaultEqSym2 (a6989586621679370061 :: k) (a6989586621679370062 :: k) = DefaultEq a6989586621679370061 a6989586621679370062 :: Bool Source #