plutus-tx-1.38.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Enum

Synopsis

Documentation

class Enum a where Source #

Class Enum defines operations on sequentially ordered types.

Methods

succ ∷ a → a Source #

The successor of a value. For numeric types, succ adds 1.

For types that implement Ord, succ x should be the least element that is greater than x, and error if there is none.

pred ∷ a → a Source #

The predecessor of a value. For numeric types, pred subtracts 1.

For types that implement Ord, pred x should be the greatest element that is less than x, and error if there is none.

toEnumInteger → a Source #

Convert from an Integer.

fromEnum ∷ a → Integer Source #

Convert to an Integer.

enumFromTo ∷ a → a → [a] Source #

Construct a list from the given range (corresponds to [a..b]).

enumFromThenTo ∷ a → a → a → [a] Source #

Construct a list from the given range (corresponds to [a,b..c]). This has the same semantics as the Haskell version,so if a==b and c>=b then you get an infinite list, which you probably don't want in Plutus Core.

Instances

Instances details
Enum Ordering Source # 
Instance details

Defined in PlutusTx.Enum

Enum Integer Source # 
Instance details

Defined in PlutusTx.Enum

Enum () Source # 
Instance details

Defined in PlutusTx.Enum

Methods

succ ∷ () → () Source #

pred ∷ () → () Source #

toEnumInteger → () Source #

fromEnum ∷ () → Integer Source #

enumFromTo ∷ () → () → [()] Source #

enumFromThenTo ∷ () → () → () → [()] Source #

Enum Bool Source # 
Instance details

Defined in PlutusTx.Enum