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 a6989586621679379997. (~>) a6989586621679379997 ((~>) a6989586621679379997 Bool)
- data (==@#@$$) (x6989586621679379998 :: a6989586621679379997) :: (~>) a6989586621679379997 Bool
- type (==@#@$$$) (x6989586621679379998 :: a6989586621679379997) (y6989586621679379999 :: a6989586621679379997) = (==) x6989586621679379998 y6989586621679379999
- data (/=@#@$) :: forall a6989586621679379997. (~>) a6989586621679379997 ((~>) a6989586621679379997 Bool)
- data (/=@#@$$) (x6989586621679380000 :: a6989586621679379997) :: (~>) a6989586621679379997 Bool
- type (/=@#@$$$) (x6989586621679380000 :: a6989586621679379997) (y6989586621679380001 :: a6989586621679379997) = (/=) x6989586621679380000 y6989586621679380001
- data DefaultEqSym0 :: forall k6989586621679379991. (~>) k6989586621679379991 ((~>) k6989586621679379991 Bool)
- data DefaultEqSym1 (a6989586621679379992 :: k6989586621679379991) :: (~>) k6989586621679379991 Bool
- type DefaultEqSym2 (a6989586621679379992 :: k6989586621679379991) (b6989586621679379993 :: k6989586621679379991) = DefaultEq a6989586621679379992 b6989586621679379993
Documentation
The promoted analogue of Eq
. If you supply no definition for (==)
,
then it defaults to a use of DefaultEq
.
type (x :: a) == (y :: a) :: Bool infix 4 Source #
type (==) (x :: a) (y :: a) = x `DefaultEq` y Source #
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
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 (==)
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 (==@#@$) :: forall a6989586621679379997. (~>) a6989586621679379997 ((~>) a6989586621679379997 Bool) infix 4 Source #
Instances
SEq a => SingI ((==@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$) :: TyFun a6989586621679379997 (a6989586621679379997 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$) :: TyFun a6989586621679379997 (a6989586621679379997 ~> Bool) -> Type) (x6989586621679379998 :: a6989586621679379997) Source # | |
data (==@#@$$) (x6989586621679379998 :: a6989586621679379997) :: (~>) a6989586621679379997 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((==@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((==@#@$$) x6989586621679379998 :: TyFun a6989586621679379997 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((==@#@$$) x6989586621679379998 :: TyFun a Bool -> Type) (y6989586621679379999 :: a) Source # | |
type (==@#@$$$) (x6989586621679379998 :: a6989586621679379997) (y6989586621679379999 :: a6989586621679379997) = (==) x6989586621679379998 y6989586621679379999 Source #
data (/=@#@$) :: forall a6989586621679379997. (~>) a6989586621679379997 ((~>) a6989586621679379997 Bool) infix 4 Source #
Instances
SEq a => SingI ((/=@#@$) :: TyFun a (a ~> Bool) -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$) :: TyFun a6989586621679379997 (a6989586621679379997 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$) :: TyFun a6989586621679379997 (a6989586621679379997 ~> Bool) -> Type) (x6989586621679380000 :: a6989586621679379997) Source # | |
data (/=@#@$$) (x6989586621679380000 :: a6989586621679379997) :: (~>) a6989586621679379997 Bool infix 4 Source #
Instances
(SEq a, SingI x) => SingI ((/=@#@$$) x :: TyFun a Bool -> Type) Source # | |
SuppressUnusedWarnings ((/=@#@$$) x6989586621679380000 :: TyFun a6989586621679379997 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply ((/=@#@$$) x6989586621679380000 :: TyFun a Bool -> Type) (y6989586621679380001 :: a) Source # | |
type (/=@#@$$$) (x6989586621679380000 :: a6989586621679379997) (y6989586621679380001 :: a6989586621679379997) = (/=) x6989586621679380000 y6989586621679380001 Source #
data DefaultEqSym0 :: forall k6989586621679379991. (~>) k6989586621679379991 ((~>) k6989586621679379991 Bool) Source #
Instances
SuppressUnusedWarnings (DefaultEqSym0 :: TyFun k6989586621679379991 (k6989586621679379991 ~> Bool) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym0 :: TyFun k6989586621679379991 (k6989586621679379991 ~> Bool) -> Type) (a6989586621679379992 :: k6989586621679379991) Source # | |
Defined in Data.Singletons.Prelude.Eq type Apply (DefaultEqSym0 :: TyFun k6989586621679379991 (k6989586621679379991 ~> Bool) -> Type) (a6989586621679379992 :: k6989586621679379991) = DefaultEqSym1 a6989586621679379992 |
data DefaultEqSym1 (a6989586621679379992 :: k6989586621679379991) :: (~>) k6989586621679379991 Bool Source #
Instances
SuppressUnusedWarnings (DefaultEqSym1 a6989586621679379992 :: TyFun k6989586621679379991 Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Eq suppressUnusedWarnings :: () Source # | |
type Apply (DefaultEqSym1 a6989586621679379992 :: TyFun k Bool -> Type) (b6989586621679379993 :: k) Source # | |
Defined in Data.Singletons.Prelude.Eq |
type DefaultEqSym2 (a6989586621679379992 :: k6989586621679379991) (b6989586621679379993 :: k6989586621679379991) = DefaultEq a6989586621679379992 b6989586621679379993 Source #