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 :: k) (b :: k) :: Bool where ...
- data (==@#@$) :: forall a6989586621679366522. (~>) a6989586621679366522 ((~>) a6989586621679366522 Bool)
- data (==@#@$$) (x6989586621679366523 :: a6989586621679366522) :: (~>) a6989586621679366522 Bool
- type (==@#@$$$) (x6989586621679366523 :: a6989586621679366522) (y6989586621679366524 :: a6989586621679366522) = (==) x6989586621679366523 y6989586621679366524
- data (/=@#@$) :: forall a6989586621679366522. (~>) a6989586621679366522 ((~>) a6989586621679366522 Bool)
- data (/=@#@$$) (x6989586621679366525 :: a6989586621679366522) :: (~>) a6989586621679366522 Bool
- type (/=@#@$$$) (x6989586621679366525 :: a6989586621679366522) (y6989586621679366526 :: a6989586621679366522) = (/=) x6989586621679366525 y6989586621679366526
- data DefaultEqSym0 :: forall k6989586621679366516. (~>) k6989586621679366516 ((~>) k6989586621679366516 Bool)
- data DefaultEqSym1 (a6989586621679366517 :: k6989586621679366516) :: (~>) k6989586621679366516 Bool
- type DefaultEqSym2 (a6989586621679366517 :: k6989586621679366516) (b6989586621679366518 :: k6989586621679366516) = DefaultEq a6989586621679366517 b6989586621679366518
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 (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
(%/=) :: forall (a :: k) (b :: k). (a /= b) ~ Not (a == b) => Sing a -> Sing b -> Sing (a /= b) infix 4 Source #
Boolean disequality on singletons
Instances
type family DefaultEq (a :: k) (b :: k) :: Bool where ... Source #
A sensible way to compute Boolean equality for types of any kind. Note
that this definition is slightly different from the '(DTE.==)' type family
from Data.Type.Equality in base
, as '(DTE.==)' 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 '(DTE.==)'.
Defunctionalization symbols
data (==@#@$) :: forall a6989586621679366522. (~>) a6989586621679366522 ((~>) a6989586621679366522 Bool) infix 4 Source #
Instances
SEq a => SingI ((==@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$) :: TyFun a6989586621679366522 (a6989586621679366522 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$) :: TyFun a6989586621679366522 (a6989586621679366522 ~> Bool) -> Type) (x6989586621679366523 :: a6989586621679366522) Source # | |
data (==@#@$$) (x6989586621679366523 :: a6989586621679366522) :: (~>) a6989586621679366522 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((==@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$$) x6989586621679366523 :: TyFun a6989586621679366522 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$$) x6989586621679366523 :: TyFun a Bool -> Type) (y6989586621679366524 :: a) Source # | |
type (==@#@$$$) (x6989586621679366523 :: a6989586621679366522) (y6989586621679366524 :: a6989586621679366522) = (==) x6989586621679366523 y6989586621679366524 Source #
data (/=@#@$) :: forall a6989586621679366522. (~>) a6989586621679366522 ((~>) a6989586621679366522 Bool) infix 4 Source #
Instances
SEq a => SingI ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$) :: TyFun a6989586621679366522 (a6989586621679366522 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$) :: TyFun a6989586621679366522 (a6989586621679366522 ~> Bool) -> Type) (x6989586621679366525 :: a6989586621679366522) Source # | |
data (/=@#@$$) (x6989586621679366525 :: a6989586621679366522) :: (~>) a6989586621679366522 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((/=@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$$) x6989586621679366525 :: TyFun a6989586621679366522 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$$) x6989586621679366525 :: TyFun a Bool -> Type) (y6989586621679366526 :: a) Source # | |
type (/=@#@$$$) (x6989586621679366525 :: a6989586621679366522) (y6989586621679366526 :: a6989586621679366522) = (/=) x6989586621679366525 y6989586621679366526 Source #
data DefaultEqSym0 :: forall k6989586621679366516. (~>) k6989586621679366516 ((~>) k6989586621679366516 Bool) Source #
Instances
SuppressUnusedWarnings (DefaultEqSym0 :: TyFun k6989586621679366516 (k6989586621679366516 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym0 :: TyFun k6989586621679366516 (k6989586621679366516 ~> Bool) -> Type) (a6989586621679366517 :: k6989586621679366516) Source # | |
Defined in Data.Singletons.Prelude.Eq type Apply (DefaultEqSym0 :: TyFun k6989586621679366516 (k6989586621679366516 ~> Bool) -> Type) (a6989586621679366517 :: k6989586621679366516) = DefaultEqSym1 a6989586621679366517 |
data DefaultEqSym1 (a6989586621679366517 :: k6989586621679366516) :: (~>) k6989586621679366516 Bool Source #
Instances
SuppressUnusedWarnings (DefaultEqSym1 a6989586621679366517 :: TyFun k6989586621679366516 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym1 a6989586621679366517 :: TyFun k Bool -> Type) (b6989586621679366518 :: k) Source # | |
Defined in Data.Singletons.Prelude.Eq |
type DefaultEqSym2 (a6989586621679366517 :: k6989586621679366516) (b6989586621679366518 :: k6989586621679366516) = DefaultEq a6989586621679366517 b6989586621679366518 Source #