first-class-families-0.8.0.0: First class type families

Safe HaskellSafe
LanguageHaskell2010

Fcf.Data.Nat

Contents

Description

Natural numbers.

Note that the operators from this module conflict with GHC.TypeLits and GHC.TypeNats.

Synopsis

Reexported type

data Nat #

(Kind) This is the kind of type-level natural numbers.

Instances
type Eval (a ^ b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a ^ b :: Nat -> Type) = a ^ b
type Eval (a * b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a * b :: Nat -> Type) = a * b
type Eval (a - b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a - b :: Nat -> Type) = a - b
type Eval (a + b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a + b :: Nat -> Type) = a + b
type Eval (Sum ns :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Class.Foldable

type Eval (Sum ns :: Nat -> Type) = Eval (Foldr (+) 0 ns)
type Eval (Length (a2 ': as) :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.List

type Eval (Length (a2 ': as) :: Nat -> Type) = 1 + Eval (Length as)
type Eval (Length ([] :: [a]) :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.List

type Eval (Length ([] :: [a]) :: Nat -> Type) = 0
type Eval (Compare a b :: Ordering -> Type) Source # 
Instance details

Defined in Fcf.Class.Ord

type Eval (Compare a b :: Ordering -> Type) = CmpNat a b
type Eval (FindIndex p (a2 ': as) :: Maybe Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.List

type Eval (FindIndex p (a2 ': as) :: Maybe Nat -> Type) = Eval (If (Eval (p a2)) (Pure (Just 0)) ((Map ((+) 1) :: Maybe Nat -> Maybe Nat -> Type) =<< FindIndex p as))
type Eval (FindIndex _p ([] :: [a]) :: Maybe Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.List

type Eval (FindIndex _p ([] :: [a]) :: Maybe Nat -> Type) = (Nothing :: Maybe Nat)

Operations

data (+) :: Nat -> Nat -> Exp Nat Source #

Instances
type Eval (a + b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a + b :: Nat -> Type) = a + b

data (-) :: Nat -> Nat -> Exp Nat Source #

Instances
type Eval (a - b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a - b :: Nat -> Type) = a - b

data * :: Nat -> Nat -> Exp Nat Source #

Instances
type Eval (a * b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a * b :: Nat -> Type) = a * b

data (^) :: Nat -> Nat -> Exp Nat Source #

Instances
type Eval (a ^ b :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a ^ b :: Nat -> Type) = a ^ b

Comparisons

Note that these conflict with Fcf.Class.Ord.

data (<=) :: Nat -> Nat -> Exp Bool Source #

Instances
type Eval (a <= b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a <= b :: Bool -> Type) = a <=? b

data (>=) :: Nat -> Nat -> Exp Bool Source #

Instances
type Eval (a >= b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a >= b :: Bool -> Type) = b <=? a

data (<) :: Nat -> Nat -> Exp Bool Source #

Instances
type Eval (a < b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a < b :: Bool -> Type) = Eval (Not =<< (a >= b))

data (>) :: Nat -> Nat -> Exp Bool Source #

Instances
type Eval (a > b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.Nat

type Eval (a > b :: Bool -> Type) = Eval (Not =<< (a <= b))