| Copyright | (C) 2014 Richard Eisenberg |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Ryan Scott |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Singletons.Prelude.Num
Contents
Description
Defines and exports promoted and singleton versions of definitions from GHC.Num.
Be warned that some of the associated type families in the PNum class
((+), (-), and (*)) clash with their counterparts for Nat in the
GHC.TypeLits module.
Synopsis
- class PNum (a :: Type) where
- class SNum a where
- (%+) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: a)
- (%-) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (-@#@$) t) t :: a)
- (%*) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (*@#@$) t) t :: a)
- sNegate :: forall (t :: a). Sing t -> Sing (Apply NegateSym0 t :: a)
- sAbs :: forall (t :: a). Sing t -> Sing (Apply AbsSym0 t :: a)
- sSignum :: forall (t :: a). Sing t -> Sing (Apply SignumSym0 t :: a)
- sFromInteger :: forall (t :: Nat). Sing t -> Sing (Apply FromIntegerSym0 t :: a)
- type family Subtract (a :: a) (a :: a) :: a where ...
- sSubtract :: forall a (t :: a) (t :: a). SNum a => Sing t -> Sing t -> Sing (Apply (Apply SubtractSym0 t) t :: a)
- data (+@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498)
- data (+@#@$$) (arg6989586621679523518 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498
- type (+@#@$$$) (arg6989586621679523518 :: a6989586621679523498) (arg6989586621679523519 :: a6989586621679523498) = (+) arg6989586621679523518 arg6989586621679523519
- data (-@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498)
- data (-@#@$$) (arg6989586621679523522 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498
- type (-@#@$$$) (arg6989586621679523522 :: a6989586621679523498) (arg6989586621679523523 :: a6989586621679523498) = (-) arg6989586621679523522 arg6989586621679523523
- data (*@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498)
- data (*@#@$$) (arg6989586621679523526 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498
- type (*@#@$$$) (arg6989586621679523526 :: a6989586621679523498) (arg6989586621679523527 :: a6989586621679523498) = * arg6989586621679523526 arg6989586621679523527
- data NegateSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498
- type NegateSym1 (arg6989586621679523530 :: a6989586621679523498) = Negate arg6989586621679523530
- data AbsSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498
- type AbsSym1 (arg6989586621679523532 :: a6989586621679523498) = Abs arg6989586621679523532
- data SignumSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498
- type SignumSym1 (arg6989586621679523534 :: a6989586621679523498) = Signum arg6989586621679523534
- data FromIntegerSym0 :: forall a6989586621679523498. (~>) Nat a6989586621679523498
- type FromIntegerSym1 (arg6989586621679523536 :: Nat) = FromInteger arg6989586621679523536
- data SubtractSym0 :: forall a6989586621679528955. (~>) a6989586621679528955 ((~>) a6989586621679528955 a6989586621679528955)
- data SubtractSym1 (a6989586621679528959 :: a6989586621679528955) :: (~>) a6989586621679528955 a6989586621679528955
- type SubtractSym2 (a6989586621679528959 :: a6989586621679528955) (a6989586621679528960 :: a6989586621679528955) = Subtract a6989586621679528959 a6989586621679528960
Documentation
Associated Types
type (arg :: a) + (arg :: a) :: a infixl 6 #
type (arg :: a) - (arg :: a) :: a infixl 6 #
type (arg :: a) * (arg :: a) :: a infixl 7 #
type FromInteger (arg :: Nat) :: a #
Minimal complete definition
(%+), (%*), sAbs, sSignum, sFromInteger
Methods
(%+) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: a) infixl 6 #
(%-) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (-@#@$) t) t :: a) infixl 6 #
(%*) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (*@#@$) t) t :: a) infixl 7 #
sNegate :: forall (t :: a). Sing t -> Sing (Apply NegateSym0 t :: a) #
sAbs :: forall (t :: a). Sing t -> Sing (Apply AbsSym0 t :: a) #
sSignum :: forall (t :: a). Sing t -> Sing (Apply SignumSym0 t :: a) #
sFromInteger :: forall (t :: Nat). Sing t -> Sing (Apply FromIntegerSym0 t :: a) #
(%-) :: forall (t :: a) (t :: a). (Apply (Apply (-@#@$) t) t :: a) ~ Apply (Apply TFHelper_6989586621679523546Sym0 t) t => Sing t -> Sing t -> Sing (Apply (Apply (-@#@$) t) t :: a) infixl 6 #
sNegate :: forall (t :: a). (Apply NegateSym0 t :: a) ~ Apply Negate_6989586621679523554Sym0 t => Sing t -> Sing (Apply NegateSym0 t :: a) #
Instances
sSubtract :: forall a (t :: a) (t :: a). SNum a => Sing t -> Sing t -> Sing (Apply (Apply SubtractSym0 t) t :: a) #
Defunctionalization symbols
data (+@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498) infixl 6 #
Instances
| SNum a => SingI ((+@#@$) :: TyFun a (a ~> a) -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((+@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((+@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) (arg6989586621679523518 :: a6989586621679523498) # | |
data (+@#@$$) (arg6989586621679523518 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498 infixl 6 #
Instances
| (SNum a, SingI d) => SingI ((+@#@$$) d :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((+@#@$$) arg6989586621679523518 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((+@#@$$) arg6989586621679523518 :: TyFun a a -> Type) (arg6989586621679523519 :: a) # | |
type (+@#@$$$) (arg6989586621679523518 :: a6989586621679523498) (arg6989586621679523519 :: a6989586621679523498) = (+) arg6989586621679523518 arg6989586621679523519 #
data (-@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498) infixl 6 #
Instances
| SNum a => SingI ((-@#@$) :: TyFun a (a ~> a) -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((-@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((-@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) (arg6989586621679523522 :: a6989586621679523498) # | |
data (-@#@$$) (arg6989586621679523522 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498 infixl 6 #
Instances
| (SNum a, SingI d) => SingI ((-@#@$$) d :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((-@#@$$) arg6989586621679523522 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((-@#@$$) arg6989586621679523522 :: TyFun a a -> Type) (arg6989586621679523523 :: a) # | |
type (-@#@$$$) (arg6989586621679523522 :: a6989586621679523498) (arg6989586621679523523 :: a6989586621679523498) = (-) arg6989586621679523522 arg6989586621679523523 #
data (*@#@$) :: forall a6989586621679523498. (~>) a6989586621679523498 ((~>) a6989586621679523498 a6989586621679523498) infixl 7 #
Instances
| SNum a => SingI ((*@#@$) :: TyFun a (a ~> a) -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((*@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((*@#@$) :: TyFun a6989586621679523498 (a6989586621679523498 ~> a6989586621679523498) -> Type) (arg6989586621679523526 :: a6989586621679523498) # | |
data (*@#@$$) (arg6989586621679523526 :: a6989586621679523498) :: (~>) a6989586621679523498 a6989586621679523498 infixl 7 #
Instances
| (SNum a, SingI d) => SingI ((*@#@$$) d :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings ((*@#@$$) arg6989586621679523526 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply ((*@#@$$) arg6989586621679523526 :: TyFun a a -> Type) (arg6989586621679523527 :: a) # | |
type (*@#@$$$) (arg6989586621679523526 :: a6989586621679523498) (arg6989586621679523527 :: a6989586621679523498) = * arg6989586621679523526 arg6989586621679523527 #
data NegateSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498 #
Instances
| SNum a => SingI (NegateSym0 :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods sing :: Sing NegateSym0 # | |
| SuppressUnusedWarnings (NegateSym0 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (NegateSym0 :: TyFun a a -> Type) (arg6989586621679523530 :: a) # | |
Defined in Data.Singletons.Prelude.Num type Apply (NegateSym0 :: TyFun a a -> Type) (arg6989586621679523530 :: a) = Negate arg6989586621679523530 | |
type NegateSym1 (arg6989586621679523530 :: a6989586621679523498) = Negate arg6989586621679523530 #
data AbsSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498 #
Instances
| SNum a => SingI (AbsSym0 :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num | |
| SuppressUnusedWarnings (AbsSym0 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (AbsSym0 :: TyFun a a -> Type) (arg6989586621679523532 :: a) # | |
data SignumSym0 :: forall a6989586621679523498. (~>) a6989586621679523498 a6989586621679523498 #
Instances
| SNum a => SingI (SignumSym0 :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods sing :: Sing SignumSym0 # | |
| SuppressUnusedWarnings (SignumSym0 :: TyFun a6989586621679523498 a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (SignumSym0 :: TyFun a a -> Type) (arg6989586621679523534 :: a) # | |
Defined in Data.Singletons.Prelude.Num type Apply (SignumSym0 :: TyFun a a -> Type) (arg6989586621679523534 :: a) = Signum arg6989586621679523534 | |
type SignumSym1 (arg6989586621679523534 :: a6989586621679523498) = Signum arg6989586621679523534 #
data FromIntegerSym0 :: forall a6989586621679523498. (~>) Nat a6989586621679523498 #
Instances
| SNum a => SingI (FromIntegerSym0 :: TyFun Nat a -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods sing :: Sing FromIntegerSym0 # | |
| SuppressUnusedWarnings (FromIntegerSym0 :: TyFun Nat a6989586621679523498 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (FromIntegerSym0 :: TyFun Nat k2 -> Type) (arg6989586621679523536 :: Nat) # | |
Defined in Data.Singletons.Prelude.Num type Apply (FromIntegerSym0 :: TyFun Nat k2 -> Type) (arg6989586621679523536 :: Nat) = (FromInteger arg6989586621679523536 :: k2) | |
type FromIntegerSym1 (arg6989586621679523536 :: Nat) = FromInteger arg6989586621679523536 #
data SubtractSym0 :: forall a6989586621679528955. (~>) a6989586621679528955 ((~>) a6989586621679528955 a6989586621679528955) #
Instances
| SNum a => SingI (SubtractSym0 :: TyFun a (a ~> a) -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods sing :: Sing SubtractSym0 # | |
| SuppressUnusedWarnings (SubtractSym0 :: TyFun a6989586621679528955 (a6989586621679528955 ~> a6989586621679528955) -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (SubtractSym0 :: TyFun a6989586621679528955 (a6989586621679528955 ~> a6989586621679528955) -> Type) (a6989586621679528959 :: a6989586621679528955) # | |
Defined in Data.Singletons.Prelude.Num type Apply (SubtractSym0 :: TyFun a6989586621679528955 (a6989586621679528955 ~> a6989586621679528955) -> Type) (a6989586621679528959 :: a6989586621679528955) = SubtractSym1 a6989586621679528959 | |
data SubtractSym1 (a6989586621679528959 :: a6989586621679528955) :: (~>) a6989586621679528955 a6989586621679528955 #
Instances
| (SNum a, SingI d) => SingI (SubtractSym1 d :: TyFun a a -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods sing :: Sing (SubtractSym1 d) # | |
| SuppressUnusedWarnings (SubtractSym1 a6989586621679528959 :: TyFun a6989586621679528955 a6989586621679528955 -> Type) # | |
Defined in Data.Singletons.Prelude.Num Methods suppressUnusedWarnings :: () # | |
| type Apply (SubtractSym1 a6989586621679528959 :: TyFun a a -> Type) (a6989586621679528960 :: a) # | |
Defined in Data.Singletons.Prelude.Num type Apply (SubtractSym1 a6989586621679528959 :: TyFun a a -> Type) (a6989586621679528960 :: a) = Subtract a6989586621679528959 a6989586621679528960 | |
type SubtractSym2 (a6989586621679528959 :: a6989586621679528955) (a6989586621679528960 :: a6989586621679528955) = Subtract a6989586621679528959 a6989586621679528960 #