| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
CheckedLiterals.Class.Integer
Description
Type classes and helper functions for checked integer literals.
Synopsis
- class CheckedPositiveIntegerLiteral (lit :: Nat) a
- type PositiveUnsignedError (lit :: t) (typ :: t1) (maxVal :: t2) = TypeError (((('Text "Literal " ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((('ShowType typ ':<>: 'Text " has bounds: [0 .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k
- type PositiveSignedError (lit :: t) (typ :: t1) (minVal :: t2) (maxVal :: t3) = TypeError (((('Text "Literal " ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((((('ShowType typ ':<>: 'Text " has bounds: [-") ':<>: 'ShowType minVal) ':<>: 'Text " .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k
- checkedPositiveIntegerLiteral :: forall (lit :: Nat) a. CheckedPositiveIntegerLiteral lit a => a -> a
- class CheckedNegativeIntegerLiteral (lit :: Nat) a
- type NegativeNaturalError (lit :: t) (typ :: t1) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ('ShowType typ ':<>: 'Text " has bounds: [0 .. \8734].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k
- type NegativeUnsignedError (lit :: t) (typ :: t1) (maxVal :: t2) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((('ShowType typ ':<>: 'Text " has bounds: [0 .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k
- type NegativeSignedError (lit :: t) (typ :: t1) (minVal :: t2) (maxVal :: t3) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((((('ShowType typ ':<>: 'Text " has bounds: [-") ':<>: 'ShowType minVal) ':<>: 'Text " .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k
- checkedNegativeIntegerLiteral :: forall (lit :: Nat) a. CheckedNegativeIntegerLiteral lit a => a -> a
Documentation
class CheckedPositiveIntegerLiteral (lit :: Nat) a Source #
Constraint used by the plugin to validate positive integer literals.
Instances
type PositiveUnsignedError (lit :: t) (typ :: t1) (maxVal :: t2) = TypeError (((('Text "Literal " ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((('ShowType typ ':<>: 'Text " has bounds: [0 .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k Source #
type PositiveSignedError (lit :: t) (typ :: t1) (minVal :: t2) (maxVal :: t3) = TypeError (((('Text "Literal " ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((((('ShowType typ ':<>: 'Text " has bounds: [-") ':<>: 'ShowType minVal) ':<>: 'Text " .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k Source #
checkedPositiveIntegerLiteral :: forall (lit :: Nat) a. CheckedPositiveIntegerLiteral lit a => a -> a Source #
Identity helper that attaches a positive integer literal check.
class CheckedNegativeIntegerLiteral (lit :: Nat) a Source #
Constraint used by the plugin to validate negative integer literals.
Instances
type NegativeNaturalError (lit :: t) (typ :: t1) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ('ShowType typ ':<>: 'Text " has bounds: [0 .. \8734].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k Source #
type NegativeUnsignedError (lit :: t) (typ :: t1) (maxVal :: t2) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((('ShowType typ ':<>: 'Text " has bounds: [0 .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k Source #
type NegativeSignedError (lit :: t) (typ :: t1) (minVal :: t2) (maxVal :: t3) = TypeError (((('Text "Literal -" ':<>: 'ShowType lit) ':<>: 'Text " is out of bounds.") ':$$: ((((('ShowType typ ':<>: 'Text " has bounds: [-") ':<>: 'ShowType minVal) ':<>: 'Text " .. ") ':<>: 'ShowType maxVal) ':<>: 'Text "].")) ':$$: 'Text "Possible fix: use 'uncheckedLiteral' from 'CheckedLiterals' to bypass this check.") :: k Source #
checkedNegativeIntegerLiteral :: forall (lit :: Nat) a. CheckedNegativeIntegerLiteral lit a => a -> a Source #
Identity helper that attaches a negative integer literal check.