singletons-2.5.1: A framework for generating singleton types

Copyright(C) 2014 Richard Eisenberg
LicenseBSD-style (see LICENSE)
MaintainerRyan Scott
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

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
    • type (arg :: a) + (arg :: a) :: a
    • type (arg :: a) - (arg :: a) :: a
    • type (arg :: a) * (arg :: a) :: a
    • type Negate (arg :: a) :: a
    • type Abs (arg :: a) :: a
    • type Signum (arg :: a) :: a
    • type FromInteger (arg :: Nat) :: a
  • class SNum a where
  • 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 a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884)
  • data (+@#@$$) (arg6989586621679496904 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884
  • type (+@#@$$$) (arg6989586621679496904 :: a6989586621679496884) (arg6989586621679496905 :: a6989586621679496884) = (+) arg6989586621679496904 arg6989586621679496905
  • data (-@#@$) :: forall a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884)
  • data (-@#@$$) (arg6989586621679496908 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884
  • type (-@#@$$$) (arg6989586621679496908 :: a6989586621679496884) (arg6989586621679496909 :: a6989586621679496884) = (-) arg6989586621679496908 arg6989586621679496909
  • data (*@#@$) :: forall a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884)
  • data (*@#@$$) (arg6989586621679496912 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884
  • type (*@#@$$$) (arg6989586621679496912 :: a6989586621679496884) (arg6989586621679496913 :: a6989586621679496884) = * arg6989586621679496912 arg6989586621679496913
  • data NegateSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884
  • type NegateSym1 (arg6989586621679496916 :: a6989586621679496884) = Negate arg6989586621679496916
  • data AbsSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884
  • type AbsSym1 (arg6989586621679496918 :: a6989586621679496884) = Abs arg6989586621679496918
  • data SignumSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884
  • type SignumSym1 (arg6989586621679496920 :: a6989586621679496884) = Signum arg6989586621679496920
  • data FromIntegerSym0 :: forall a6989586621679496884. (~>) Nat a6989586621679496884
  • type FromIntegerSym1 (arg6989586621679496922 :: Nat) = FromInteger arg6989586621679496922
  • data SubtractSym0 :: forall a6989586621679502341. (~>) a6989586621679502341 ((~>) a6989586621679502341 a6989586621679502341)
  • data SubtractSym1 (a6989586621679502345 :: a6989586621679502341) :: (~>) a6989586621679502341 a6989586621679502341
  • type SubtractSym2 (a6989586621679502345 :: a6989586621679502341) (a6989586621679502346 :: a6989586621679502341) = Subtract a6989586621679502345 a6989586621679502346

Documentation

class PNum (a :: Type) Source #

Associated Types

type (arg :: a) + (arg :: a) :: a infixl 6 Source #

type (arg :: a) - (arg :: a) :: a infixl 6 Source #

type (arg :: a) * (arg :: a) :: a infixl 7 Source #

type Negate (arg :: a) :: a Source #

type Abs (arg :: a) :: a Source #

type Signum (arg :: a) :: a Source #

type FromInteger (arg :: Nat) :: a Source #

Instances
PNum Nat Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Min a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Max a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Identity a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Identity

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Sum a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Product a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Down a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

PNum (Const a b) Source # 
Instance details

Defined in Data.Singletons.Prelude.Const

Associated Types

type arg + arg :: a Source #

type arg - arg :: a Source #

type arg * arg :: a Source #

type Negate arg :: a Source #

type Abs arg :: a Source #

type Signum arg :: a Source #

type FromInteger arg :: a Source #

class SNum a where Source #

Minimal complete definition

(%+), (%*), sAbs, sSignum, sFromInteger

Methods

(%+) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: a) infixl 6 Source #

(%-) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (-@#@$) t) t :: a) infixl 6 Source #

(%*) :: forall (t :: a) (t :: a). Sing t -> Sing t -> Sing (Apply (Apply (*@#@$) t) t :: a) infixl 7 Source #

sNegate :: forall (t :: a). Sing t -> Sing (Apply NegateSym0 t :: a) Source #

sAbs :: forall (t :: a). Sing t -> Sing (Apply AbsSym0 t :: a) Source #

sSignum :: forall (t :: a). Sing t -> Sing (Apply SignumSym0 t :: a) Source #

sFromInteger :: forall (t :: Nat). Sing t -> Sing (Apply FromIntegerSym0 t :: a) Source #

(%-) :: forall (t :: a) (t :: a). (Apply (Apply (-@#@$) t) t :: a) ~ Apply (Apply TFHelper_6989586621679496932Sym0 t) t => Sing t -> Sing t -> Sing (Apply (Apply (-@#@$) t) t :: a) infixl 6 Source #

sNegate :: forall (t :: a). (Apply NegateSym0 t :: a) ~ Apply Negate_6989586621679496940Sym0 t => Sing t -> Sing (Apply NegateSym0 t :: a) Source #

Instances
SNum Nat Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SNum a => SNum (Min a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup

SNum a => SNum (Max a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup

SNum a => SNum (Identity a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Identity

SNum a => SNum (Sum a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

SNum a => SNum (Product a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

SNum a => SNum (Down a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SNum a => SNum (Const a b) Source # 
Instance details

Defined in Data.Singletons.Prelude.Const

type family Subtract (a :: a) (a :: a) :: a where ... Source #

Equations

Subtract x y = Apply (Apply (-@#@$) y) x 

sSubtract :: forall a (t :: a) (t :: a). SNum a => Sing t -> Sing t -> Sing (Apply (Apply SubtractSym0 t) t :: a) Source #

Defunctionalization symbols

data (+@#@$) :: forall a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884) infixl 6 Source #

Instances
SNum a => SingI ((+@#@$) :: TyFun a (a ~> a) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings ((+@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((+@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496904 :: a6989586621679496884) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((+@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496904 :: a6989586621679496884) = (+@#@$$) arg6989586621679496904

data (+@#@$$) (arg6989586621679496904 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884 infixl 6 Source #

Instances
(SNum a, SingI d) => SingI ((+@#@$$) d :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Methods

sing :: Sing ((+@#@$$) d) Source #

SuppressUnusedWarnings ((+@#@$$) arg6989586621679496904 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((+@#@$$) arg6989586621679496904 :: TyFun a a -> Type) (arg6989586621679496905 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((+@#@$$) arg6989586621679496904 :: TyFun a a -> Type) (arg6989586621679496905 :: a) = arg6989586621679496904 + arg6989586621679496905

type (+@#@$$$) (arg6989586621679496904 :: a6989586621679496884) (arg6989586621679496905 :: a6989586621679496884) = (+) arg6989586621679496904 arg6989586621679496905 Source #

data (-@#@$) :: forall a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884) infixl 6 Source #

Instances
SNum a => SingI ((-@#@$) :: TyFun a (a ~> a) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings ((-@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((-@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496908 :: a6989586621679496884) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((-@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496908 :: a6989586621679496884) = (-@#@$$) arg6989586621679496908

data (-@#@$$) (arg6989586621679496908 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884 infixl 6 Source #

Instances
(SNum a, SingI d) => SingI ((-@#@$$) d :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Methods

sing :: Sing ((-@#@$$) d) Source #

SuppressUnusedWarnings ((-@#@$$) arg6989586621679496908 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((-@#@$$) arg6989586621679496908 :: TyFun a a -> Type) (arg6989586621679496909 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((-@#@$$) arg6989586621679496908 :: TyFun a a -> Type) (arg6989586621679496909 :: a) = arg6989586621679496908 - arg6989586621679496909

type (-@#@$$$) (arg6989586621679496908 :: a6989586621679496884) (arg6989586621679496909 :: a6989586621679496884) = (-) arg6989586621679496908 arg6989586621679496909 Source #

data (*@#@$) :: forall a6989586621679496884. (~>) a6989586621679496884 ((~>) a6989586621679496884 a6989586621679496884) infixl 7 Source #

Instances
SNum a => SingI ((*@#@$) :: TyFun a (a ~> a) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings ((*@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((*@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496912 :: a6989586621679496884) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((*@#@$) :: TyFun a6989586621679496884 (a6989586621679496884 ~> a6989586621679496884) -> Type) (arg6989586621679496912 :: a6989586621679496884) = (*@#@$$) arg6989586621679496912

data (*@#@$$) (arg6989586621679496912 :: a6989586621679496884) :: (~>) a6989586621679496884 a6989586621679496884 infixl 7 Source #

Instances
(SNum a, SingI d) => SingI ((*@#@$$) d :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Methods

sing :: Sing ((*@#@$$) d) Source #

SuppressUnusedWarnings ((*@#@$$) arg6989586621679496912 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((*@#@$$) arg6989586621679496912 :: TyFun a a -> Type) (arg6989586621679496913 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply ((*@#@$$) arg6989586621679496912 :: TyFun a a -> Type) (arg6989586621679496913 :: a) = arg6989586621679496912 * arg6989586621679496913

type (*@#@$$$) (arg6989586621679496912 :: a6989586621679496884) (arg6989586621679496913 :: a6989586621679496884) = * arg6989586621679496912 arg6989586621679496913 Source #

data NegateSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884 Source #

Instances
SNum a => SingI (NegateSym0 :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings (NegateSym0 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (NegateSym0 :: TyFun a a -> Type) (arg6989586621679496916 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (NegateSym0 :: TyFun a a -> Type) (arg6989586621679496916 :: a) = Negate arg6989586621679496916

type NegateSym1 (arg6989586621679496916 :: a6989586621679496884) = Negate arg6989586621679496916 Source #

data AbsSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884 Source #

Instances
SNum a => SingI (AbsSym0 :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings (AbsSym0 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (AbsSym0 :: TyFun a a -> Type) (arg6989586621679496918 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (AbsSym0 :: TyFun a a -> Type) (arg6989586621679496918 :: a) = Abs arg6989586621679496918

type AbsSym1 (arg6989586621679496918 :: a6989586621679496884) = Abs arg6989586621679496918 Source #

data SignumSym0 :: forall a6989586621679496884. (~>) a6989586621679496884 a6989586621679496884 Source #

Instances
SNum a => SingI (SignumSym0 :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings (SignumSym0 :: TyFun a6989586621679496884 a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SignumSym0 :: TyFun a a -> Type) (arg6989586621679496920 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SignumSym0 :: TyFun a a -> Type) (arg6989586621679496920 :: a) = Signum arg6989586621679496920

type SignumSym1 (arg6989586621679496920 :: a6989586621679496884) = Signum arg6989586621679496920 Source #

data FromIntegerSym0 :: forall a6989586621679496884. (~>) Nat a6989586621679496884 Source #

Instances
SNum a => SingI (FromIntegerSym0 :: TyFun Nat a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings (FromIntegerSym0 :: TyFun Nat a6989586621679496884 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (FromIntegerSym0 :: TyFun Nat k2 -> Type) (arg6989586621679496922 :: Nat) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (FromIntegerSym0 :: TyFun Nat k2 -> Type) (arg6989586621679496922 :: Nat) = (FromInteger arg6989586621679496922 :: k2)

type FromIntegerSym1 (arg6989586621679496922 :: Nat) = FromInteger arg6989586621679496922 Source #

data SubtractSym0 :: forall a6989586621679502341. (~>) a6989586621679502341 ((~>) a6989586621679502341 a6989586621679502341) Source #

Instances
SNum a => SingI (SubtractSym0 :: TyFun a (a ~> a) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

SuppressUnusedWarnings (SubtractSym0 :: TyFun a6989586621679502341 (a6989586621679502341 ~> a6989586621679502341) -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SubtractSym0 :: TyFun a6989586621679502341 (a6989586621679502341 ~> a6989586621679502341) -> Type) (a6989586621679502345 :: a6989586621679502341) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SubtractSym0 :: TyFun a6989586621679502341 (a6989586621679502341 ~> a6989586621679502341) -> Type) (a6989586621679502345 :: a6989586621679502341) = SubtractSym1 a6989586621679502345

data SubtractSym1 (a6989586621679502345 :: a6989586621679502341) :: (~>) a6989586621679502341 a6989586621679502341 Source #

Instances
(SNum a, SingI d) => SingI (SubtractSym1 d :: TyFun a a -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

Methods

sing :: Sing (SubtractSym1 d) Source #

SuppressUnusedWarnings (SubtractSym1 a6989586621679502345 :: TyFun a6989586621679502341 a6989586621679502341 -> Type) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SubtractSym1 a6989586621679502345 :: TyFun a a -> Type) (a6989586621679502346 :: a) Source # 
Instance details

Defined in Data.Singletons.Prelude.Num

type Apply (SubtractSym1 a6989586621679502345 :: TyFun a a -> Type) (a6989586621679502346 :: a) = Subtract a6989586621679502345 a6989586621679502346

type SubtractSym2 (a6989586621679502345 :: a6989586621679502341) (a6989586621679502346 :: a6989586621679502341) = Subtract a6989586621679502345 a6989586621679502346 Source #