plutus-ledger-api-1.39.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.V1.Data.Interval

Description

A type for intervals and associated functions.

Synopsis

Documentation

data Interval a Source #

An interval of as.

The interval may be either closed or open at either end, meaning that the endpoints may or may not be included in the interval.

The interval can also be unbounded on either side.

The Eq instance gives equality of the intervals, not structural equality. There is no Ord instance, but contains gives a partial order.

Note that some of the functions on Interval rely on Enum in order to handle non-inclusive endpoints. For this reason, it may not be safe to use Intervals with non-inclusive endpoints on types whose Enum instances have partial methods.

Instances

Instances details
Lift DefaultUni (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Generic (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Rep (Interval a) ∷ TypeType Source #

Methods

fromInterval a → Rep (Interval a) x Source #

toRep (Interval a) x → Interval a Source #

Show (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

NFData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

rnfInterval a → () Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Eq (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)Interval a → Interval a → Bool Source #

(/=)Interval a → Interval a → Bool Source #

HasBlueprintDefinition a ⇒ HasBlueprintDefinition (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Unroll (Interval a) ∷ [Type] Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Eq (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)Interval a → Interval a → Bool Source #

FromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

ToData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

UnsafeFromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ BoundedJoinSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

bottomInterval a Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ BoundedMeetSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

topInterval a Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ JoinSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(\/)Interval a → Interval a → Interval a Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ MeetSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(/\)Interval a → Interval a → Interval a Source #

(Pretty a, ToData a, UnsafeFromData a) ⇒ Pretty (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

prettyInterval a → Doc ann Source #

prettyList ∷ [Interval a] → Doc ann Source #

(HasBlueprintDefinition a, HasSchemaDefinition (LowerBound a) referencedTypes, HasSchemaDefinition (UpperBound a) referencedTypes) ⇒ HasBlueprintSchema (Interval a) referencedTypes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

schemaSchema referencedTypes Source #

Typeable DefaultUni Interval Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (Interval a) = D1 ('MetaData "Interval" "PlutusLedgerApi.V1.Data.Interval" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "Interval_6989586621679182345" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData)))
type Unroll (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

pattern Interval ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ LowerBound a → UpperBound a → Interval a Source #

data UpperBound a Source #

The upper bound of an interval.

Instances

Instances details
Lift DefaultUni (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Generic (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Rep (UpperBound a) ∷ TypeType Source #

Methods

fromUpperBound a → Rep (UpperBound a) x Source #

toRep (UpperBound a) x → UpperBound a Source #

Show (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

NFData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

rnfUpperBound a → () Source #

(Enum a, Eq a, ToData a, UnsafeFromData a) ⇒ Eq (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)UpperBound a → UpperBound a → Bool Source #

(/=)UpperBound a → UpperBound a → Bool Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Ord (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

HasBlueprintDefinition (Extended a) ⇒ HasBlueprintDefinition (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Unroll (UpperBound a) ∷ [Type] Source #

(Enum a, Eq a, ToData a, UnsafeFromData a) ⇒ Eq (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)UpperBound a → UpperBound a → Bool Source #

FromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

ToData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

UnsafeFromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Ord (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Pretty a, ToData a, UnsafeFromData a) ⇒ Pretty (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

prettyUpperBound a → Doc ann Source #

prettyList ∷ [UpperBound a] → Doc ann Source #

(HasSchemaDefinition a referencedTypes, HasBlueprintDefinition a, HasSchemaDefinition (Extended a) referencedTypes, HasSchemaDefinition Closure referencedTypes) ⇒ HasBlueprintSchema (UpperBound a) referencedTypes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

schemaSchema referencedTypes Source #

Typeable DefaultUni UpperBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (UpperBound a) = D1 ('MetaData "UpperBound" "PlutusLedgerApi.V1.Data.Interval" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "UpperBound_6989586621679181264" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData)))
type Unroll (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

pattern UpperBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → ClosureUpperBound a Source #

data LowerBound a Source #

The lower bound of an interval.

Instances

Instances details
Lift DefaultUni (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Generic (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Rep (LowerBound a) ∷ TypeType Source #

Methods

fromLowerBound a → Rep (LowerBound a) x Source #

toRep (LowerBound a) x → LowerBound a Source #

Show (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

NFData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

rnfLowerBound a → () Source #

(Enum a, Eq a, ToData a, UnsafeFromData a) ⇒ Eq (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)LowerBound a → LowerBound a → Bool Source #

(/=)LowerBound a → LowerBound a → Bool Source #

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Ord (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

HasBlueprintDefinition (Extended a) ⇒ HasBlueprintDefinition (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Unroll (LowerBound a) ∷ [Type] Source #

(Enum a, Eq a, ToData a, UnsafeFromData a) ⇒ Eq (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)LowerBound a → LowerBound a → Bool Source #

FromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

ToData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

UnsafeFromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Ord (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Pretty a, ToData a, UnsafeFromData a) ⇒ Pretty (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

prettyLowerBound a → Doc ann Source #

prettyList ∷ [LowerBound a] → Doc ann Source #

(HasSchemaDefinition a referencedTypes, HasBlueprintDefinition a, HasSchemaDefinition (Extended a) referencedTypes, HasSchemaDefinition Closure referencedTypes) ⇒ HasBlueprintSchema (LowerBound a) referencedTypes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

schemaSchema referencedTypes Source #

Typeable DefaultUni LowerBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (LowerBound a) = D1 ('MetaData "LowerBound" "PlutusLedgerApi.V1.Data.Interval" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "LowerBound_6989586621679181796" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData)))
type Unroll (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

pattern LowerBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → ClosureLowerBound a Source #

data Extended a Source #

A set extended with a positive and negative infinity.

Instances

Instances details
Lift DefaultUni (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Generic (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Rep (Extended a) ∷ TypeType Source #

Methods

fromExtended a → Rep (Extended a) x Source #

toRep (Extended a) x → Extended a Source #

Show (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

NFData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

rnfExtended a → () Source #

(Eq a, ToData a, UnsafeFromData a) ⇒ Eq (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)Extended a → Extended a → Bool Source #

(/=)Extended a → Extended a → Bool Source #

(Ord a, ToData a, UnsafeFromData a) ⇒ Ord (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

compareExtended a → Extended a → Ordering Source #

(<)Extended a → Extended a → Bool Source #

(<=)Extended a → Extended a → Bool Source #

(>)Extended a → Extended a → Bool Source #

(>=)Extended a → Extended a → Bool Source #

maxExtended a → Extended a → Extended a Source #

minExtended a → Extended a → Extended a Source #

HasBlueprintDefinition a ⇒ HasBlueprintDefinition (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Associated Types

type Unroll (Extended a) ∷ [Type] Source #

(Eq a, ToData a, UnsafeFromData a) ⇒ Eq (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

(==)Extended a → Extended a → Bool Source #

FromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

ToData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

UnsafeFromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

(Ord a, ToData a, UnsafeFromData a) ⇒ Ord (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

compareExtended a → Extended a → Ordering Source #

(<)Extended a → Extended a → Bool Source #

(<=)Extended a → Extended a → Bool Source #

(>)Extended a → Extended a → Bool Source #

(>=)Extended a → Extended a → Bool Source #

maxExtended a → Extended a → Extended a Source #

minExtended a → Extended a → Extended a Source #

(Pretty a, ToData a, UnsafeFromData a) ⇒ Pretty (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

Methods

prettyExtended a → Doc ann Source #

prettyList ∷ [Extended a] → Doc ann Source #

Typeable DefaultUni Extended Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Rep (Extended a) = D1 ('MetaData "Extended" "PlutusLedgerApi.V1.Data.Interval" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "Extended_6989586621679180618" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData)))
type Unroll (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Interval

type Unroll (Extended a) = Extended a ': Unrolled a

pattern NegInf ∷ ∀ a. Extended a Source #

pattern Finite ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ a → Extended a Source #

pattern PosInf ∷ ∀ a. Extended a Source #

type Closure = Bool Source #

Whether a bound is inclusive or not.

member ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ a → Interval a → Bool Source #

Check whether a value is in an interval.

interval ∷ (ToData a, UnsafeFromData a) ⇒ a → a → Interval a Source #

interval a b includes all values that are greater than or equal to a and smaller than or equal to b. Therefore it includes a and b. In math. notation: [a,b]

from ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a Source #

from a is an Interval that includes all values that are greater than or equal to a. In math. notation: [a,+∞]

to ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a Source #

to a is an Interval that includes all values that are smaller than or equal to a. In math. notation: [-∞,a]

always ∷ (ToData a, UnsafeFromData a) ⇒ Interval a Source #

An Interval that covers every slot. In math. notation [-∞,+∞]

never ∷ (ToData a, UnsafeFromData a) ⇒ Interval a Source #

An Interval that is empty. There can be many empty intervals, see isEmpty. The empty interval never is arbitrarily set to [+∞,-∞].

singleton ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a Source #

Create an interval that includes just a single concrete point a, i.e. having the same non-strict lower and upper bounds. In math.notation: [a,a]

hull ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Interval a → Interval a → Interval a Source #

'hull a b' is the smallest interval containing a and b.

intersection ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Interval a → Interval a → Interval a Source #

'intersection a b' is the largest interval that is contained in a and in b, if it exists.

overlaps ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Interval a → Interval a → Bool Source #

Check whether two intervals overlap, that is, whether there is a value that is a member of both intervals.

contains ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Interval a → Interval a → Bool Source #

a contains b is true if the Interval b is entirely contained in a. That is, a contains b if for every entry s, if member s b then member s a.

isEmpty ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ Interval a → Bool Source #

Check if an Interval is empty.

before ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ a → Interval a → Bool Source #

Check if a value is earlier than the beginning of an Interval.

after ∷ (Enum a, Ord a, ToData a, UnsafeFromData a) ⇒ a → Interval a → Bool Source #

Check if a value is later than the end of an Interval.

lowerBound ∷ (ToData a, UnsafeFromData a) ⇒ a → LowerBound a Source #

Construct a lower bound from a value. The resulting bound includes all values that are equal or greater than the input value.

upperBound ∷ (ToData a, UnsafeFromData a) ⇒ a → UpperBound a Source #

Construct an upper bound from a value. The resulting bound includes all values that are equal or smaller than the input value.

strictLowerBound ∷ (ToData a, UnsafeFromData a) ⇒ a → LowerBound a Source #

Construct a strict lower bound from a value. The resulting bound includes all values that are (strictly) greater than the input value.

strictUpperBound ∷ (ToData a, UnsafeFromData a) ⇒ a → UpperBound a Source #

Construct a strict upper bound from a value. The resulting bound includes all values that are (strictly) smaller than the input value.

mapInterval ∷ (ToData a1, ToData a2, UnsafeFromData a1, UnsafeFromData a2) ⇒ (a1 → a2) → Interval a1 → Interval a2 Source #