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 a6989586621679359331. (~>) a6989586621679359331 ((~>) a6989586621679359331 Bool)
- data (==@#@$$) (x6989586621679359332 :: a6989586621679359331) :: (~>) a6989586621679359331 Bool
- type (==@#@$$$) (x6989586621679359332 :: a6989586621679359331) (y6989586621679359333 :: a6989586621679359331) = (==) x6989586621679359332 y6989586621679359333
- data (/=@#@$) :: forall a6989586621679359331. (~>) a6989586621679359331 ((~>) a6989586621679359331 Bool)
- data (/=@#@$$) (x6989586621679359334 :: a6989586621679359331) :: (~>) a6989586621679359331 Bool
- type (/=@#@$$$) (x6989586621679359334 :: a6989586621679359331) (y6989586621679359335 :: a6989586621679359331) = (/=) x6989586621679359334 y6989586621679359335
- data DefaultEqSym0 :: forall k6989586621679359325. (~>) k6989586621679359325 ((~>) k6989586621679359325 Bool)
- data DefaultEqSym1 (a6989586621679359326 :: k6989586621679359325) :: (~>) k6989586621679359325 Bool
- type DefaultEqSym2 (a6989586621679359326 :: k6989586621679359325) (b6989586621679359327 :: k6989586621679359325) = DefaultEq a6989586621679359326 b6989586621679359327
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 a6989586621679359331. (~>) a6989586621679359331 ((~>) a6989586621679359331 Bool) infix 4 Source #
Instances
SEq a => SingI ((==@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$) :: TyFun a6989586621679359331 (a6989586621679359331 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$) :: TyFun a6989586621679359331 (a6989586621679359331 ~> Bool) -> Type) (x6989586621679359332 :: a6989586621679359331) Source # | |
data (==@#@$$) (x6989586621679359332 :: a6989586621679359331) :: (~>) a6989586621679359331 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((==@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$$) x6989586621679359332 :: TyFun a6989586621679359331 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$$) x6989586621679359332 :: TyFun a Bool -> Type) (y6989586621679359333 :: a) Source # | |
type (==@#@$$$) (x6989586621679359332 :: a6989586621679359331) (y6989586621679359333 :: a6989586621679359331) = (==) x6989586621679359332 y6989586621679359333 Source #
data (/=@#@$) :: forall a6989586621679359331. (~>) a6989586621679359331 ((~>) a6989586621679359331 Bool) infix 4 Source #
Instances
SEq a => SingI ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$) :: TyFun a6989586621679359331 (a6989586621679359331 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$) :: TyFun a6989586621679359331 (a6989586621679359331 ~> Bool) -> Type) (x6989586621679359334 :: a6989586621679359331) Source # | |
data (/=@#@$$) (x6989586621679359334 :: a6989586621679359331) :: (~>) a6989586621679359331 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((/=@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$$) x6989586621679359334 :: TyFun a6989586621679359331 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$$) x6989586621679359334 :: TyFun a Bool -> Type) (y6989586621679359335 :: a) Source # | |
type (/=@#@$$$) (x6989586621679359334 :: a6989586621679359331) (y6989586621679359335 :: a6989586621679359331) = (/=) x6989586621679359334 y6989586621679359335 Source #
data DefaultEqSym0 :: forall k6989586621679359325. (~>) k6989586621679359325 ((~>) k6989586621679359325 Bool) Source #
Instances
SuppressUnusedWarnings (DefaultEqSym0 :: TyFun k6989586621679359325 (k6989586621679359325 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym0 :: TyFun k6989586621679359325 (k6989586621679359325 ~> Bool) -> Type) (a6989586621679359326 :: k6989586621679359325) Source # | |
Defined in Data.Singletons.Prelude.Eq type Apply (DefaultEqSym0 :: TyFun k6989586621679359325 (k6989586621679359325 ~> Bool) -> Type) (a6989586621679359326 :: k6989586621679359325) = DefaultEqSym1 a6989586621679359326 |
data DefaultEqSym1 (a6989586621679359326 :: k6989586621679359325) :: (~>) k6989586621679359325 Bool Source #
Instances
SuppressUnusedWarnings (DefaultEqSym1 a6989586621679359326 :: TyFun k6989586621679359325 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym1 a6989586621679359326 :: TyFun k Bool -> Type) (b6989586621679359327 :: k) Source # | |
Defined in Data.Singletons.Prelude.Eq |
type DefaultEqSym2 (a6989586621679359326 :: k6989586621679359325) (b6989586621679359327 :: k6989586621679359325) = DefaultEq a6989586621679359326 b6989586621679359327 Source #