HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulebasement-0.0.16Haskell2010

Basement.Nat

Contents
  1. Nat convertion
  2. Maximum bounds
  3. Constraint
Synopsis
  • Packagebasement-0.0.16
  • Exports24
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypeNats.hs
typetype Nat = Natural

A type synonym for Natural.

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

Instances1HasResolution
  • KnownNat n => HasResolution nDefined in base-4.23.0.0 · Data.Fixed

    For example, Fixed 1000 will give you a Fixed with a resolution of 1000.

classclass KnownNat (n :: Nat) where

This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.

typetype (<=) (x :: t) (y :: t) = Assert (x <=? y) (LeErrMsg x y)

Comparison (<=) of comparable types, as a constraint.

Nat convertion

Maximum bounds

familytype family NatNumMaxBound ty :: Nat

Get Maximum bounds of different Integral / Natural types related to Nat

Instances18NatNumMaxBound, …

Constraint