first-class-families-0.8.0.1: First-class type families

Safe Haskell | Safe-Inferred
Language | Haskell2010

Fcf.Data.Nat

Contents

- Reexported type
- Operations
- Comparisons

Description

Natural numbers.

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

Synopsis

- type Nat = Natural
- data (+) :: Nat -> Nat -> Exp Nat
- data (-) :: Nat -> Nat -> Exp Nat
- data * :: Nat -> Nat -> Exp Nat
- data (^) :: Nat -> Nat -> Exp Nat
- data (<=) :: Nat -> Nat -> Exp Bool
- data (>=) :: Nat -> Nat -> Exp Bool
- data (<) :: Nat -> Nat -> Exp Bool
- data (>) :: Nat -> Nat -> Exp Bool

# Reexported type

From GHC.TypeNats.

type Nat = Natural Source #

A type synonym for `Natural`.

Prevously, this was an opaque data type, but it was changed to a type synonym.

Since: base-4.16.0.0

# Operations

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

#### Instances

Instances details

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

Instances details

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

Instances details

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

Instances details

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

Instances details

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

Instances details

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

Instances details

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

Instances details

type Eval (a > b :: Bool -> Type) Source # |
Instance details Defined in Fcf.Data.Nat type Eval (a > b :: Bool -> Type) = Eval (Not =<< (a <= b))