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

PlutusLedgerApi.V1.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.

Constructors

Interval 

Fields

Instances

Instances details
Functor Interval Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

fmap :: (a -> b) -> Interval a -> Interval b

(Typeable DefaultUni a, Lift DefaultUni (LowerBound a), Lift DefaultUni (UpperBound a)) => Lift DefaultUni (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

lift :: Interval a -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Generic (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Rep (Interval a) :: Type -> Type Source #

Methods

from :: Interval a -> Rep (Interval a) x Source #

to :: Rep (Interval a) x -> Interval a Source #

Show a => Show (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

NFData a => NFData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

rnf :: Interval a -> () Source #

(Enum a, Ord a) => Eq (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.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.Interval

Associated Types

type Unroll (Interval a) :: [Type]

Methods

definitionId :: DefinitionId

(Enum a, Ord a) => Eq (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(==) :: Interval a -> Interval a -> Bool

FromData a => FromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a => ToData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a => UnsafeFromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

(Enum a, Ord a) => BoundedJoinSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

bottom :: Interval a

(Enum a, Ord a) => BoundedMeetSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

top :: Interval a

(Enum a, Ord a) => JoinSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(\/) :: Interval a -> Interval a -> Interval a

(Enum a, Ord a) => MeetSemiLattice (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(/\) :: Interval a -> Interval a -> Interval a

Pretty a => Pretty (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

pretty :: Interval a -> Doc ann

prettyList :: [Interval a] -> Doc ann

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

Defined in PlutusLedgerApi.V1.Interval

Methods

schema :: Schema referencedTypes

Typeable DefaultUni Interval Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

typeRep :: Proxy Interval -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Rep (Interval a) = D1 ('MetaData "Interval" "PlutusLedgerApi.V1.Interval" "plutus-ledger-api-1.36.0.0-5YP34Z4WNIC2QzLmhyGjha" 'False) (C1 ('MetaCons "Interval" 'PrefixI 'True) (S1 ('MetaSel ('Just "ivFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (LowerBound a)) :*: S1 ('MetaSel ('Just "ivTo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UpperBound a))))
type Unroll (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Unroll (Interval a) = Nub (Interval a ': (Unrolled (LowerBound a) ++ Unrolled (UpperBound a)))

data UpperBound a Source #

The upper bound of an interval.

Constructors

UpperBound (Extended a) Closure 

Instances

Instances details
Functor UpperBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

fmap :: (a -> b) -> UpperBound a -> UpperBound b

(Typeable DefaultUni a, Lift DefaultUni (Extended a)) => Lift DefaultUni (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

lift :: UpperBound a -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Generic (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Rep (UpperBound a) :: Type -> Type Source #

Methods

from :: UpperBound a -> Rep (UpperBound a) x Source #

to :: Rep (UpperBound a) x -> UpperBound a Source #

Show a => Show (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

NFData a => NFData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

rnf :: UpperBound a -> () Source #

(Enum a, Eq a) => Eq (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

(Enum a, Ord a) => Ord (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

HasBlueprintDefinition (Extended a) => HasBlueprintDefinition (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Unroll (UpperBound a) :: [Type]

Methods

definitionId :: DefinitionId

(Enum a, Eq a) => Eq (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(==) :: UpperBound a -> UpperBound a -> Bool

FromData a => FromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a => ToData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a => UnsafeFromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

(Enum a, Ord a) => Ord (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Pretty a => Pretty (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

pretty :: UpperBound a -> Doc ann

prettyList :: [UpperBound a] -> Doc ann

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

Defined in PlutusLedgerApi.V1.Interval

Methods

schema :: Schema referencedTypes

Typeable DefaultUni UpperBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

typeRep :: Proxy UpperBound -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Rep (UpperBound a) = D1 ('MetaData "UpperBound" "PlutusLedgerApi.V1.Interval" "plutus-ledger-api-1.36.0.0-5YP34Z4WNIC2QzLmhyGjha" 'False) (C1 ('MetaCons "UpperBound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Extended a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Closure)))
type Unroll (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Unroll (UpperBound a) = UpperBound a ': (Unrolled Closure ++ Unrolled (Extended a))

data LowerBound a Source #

The lower bound of an interval.

Constructors

LowerBound (Extended a) Closure 

Instances

Instances details
Functor LowerBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

fmap :: (a -> b) -> LowerBound a -> LowerBound b

(Typeable DefaultUni a, Lift DefaultUni (Extended a)) => Lift DefaultUni (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

lift :: LowerBound a -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Generic (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Rep (LowerBound a) :: Type -> Type Source #

Methods

from :: LowerBound a -> Rep (LowerBound a) x Source #

to :: Rep (LowerBound a) x -> LowerBound a Source #

Show a => Show (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

NFData a => NFData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

rnf :: LowerBound a -> () Source #

(Enum a, Eq a) => Eq (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

(Enum a, Ord a) => Ord (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

HasBlueprintDefinition (Extended a) => HasBlueprintDefinition (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Unroll (LowerBound a) :: [Type]

Methods

definitionId :: DefinitionId

(Enum a, Eq a) => Eq (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(==) :: LowerBound a -> LowerBound a -> Bool

FromData a => FromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a => ToData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a => UnsafeFromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

(Enum a, Ord a) => Ord (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Pretty a => Pretty (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

pretty :: LowerBound a -> Doc ann

prettyList :: [LowerBound a] -> Doc ann

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

Defined in PlutusLedgerApi.V1.Interval

Methods

schema :: Schema referencedTypes

Typeable DefaultUni LowerBound Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

typeRep :: Proxy LowerBound -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Rep (LowerBound a) = D1 ('MetaData "LowerBound" "PlutusLedgerApi.V1.Interval" "plutus-ledger-api-1.36.0.0-5YP34Z4WNIC2QzLmhyGjha" 'False) (C1 ('MetaCons "LowerBound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Extended a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Closure)))
type Unroll (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Unroll (LowerBound a) = LowerBound a ': (Unrolled Closure ++ Unrolled (Extended a))

data Extended a Source #

A set extended with a positive and negative infinity.

Constructors

NegInf 
Finite a 
PosInf 

Instances

Instances details
Functor Extended Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

fmap :: (a -> b) -> Extended a -> Extended b

(Typeable DefaultUni a, Lift DefaultUni a) => Lift DefaultUni (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

lift :: Extended a -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Generic (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Rep (Extended a) :: Type -> Type Source #

Methods

from :: Extended a -> Rep (Extended a) x Source #

to :: Rep (Extended a) x -> Extended a Source #

Show a => Show (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

NFData a => NFData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

rnf :: Extended a -> () Source #

Eq a => Eq (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(==) :: Extended a -> Extended a -> Bool Source #

(/=) :: Extended a -> Extended a -> Bool Source #

Ord a => Ord (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

HasBlueprintDefinition a => HasBlueprintDefinition (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Associated Types

type Unroll (Extended a) :: [Type]

Methods

definitionId :: DefinitionId

Eq a => Eq (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

(==) :: Extended a -> Extended a -> Bool

FromData a => FromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a => ToData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a => UnsafeFromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Ord a => Ord (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

compare :: Extended a -> Extended a -> Ordering

(<) :: Extended a -> Extended a -> Bool

(<=) :: Extended a -> Extended a -> Bool

(>) :: Extended a -> Extended a -> Bool

(>=) :: Extended a -> Extended a -> Bool

max :: Extended a -> Extended a -> Extended a

min :: Extended a -> Extended a -> Extended a

Pretty a => Pretty (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

pretty :: Extended a -> Doc ann

prettyList :: [Extended a] -> Doc ann

(HasBlueprintDefinition a, HasSchemaDefinition a referencedTypes) => HasBlueprintSchema (Extended a) referencedTypes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

schema :: Schema referencedTypes

Typeable DefaultUni Extended Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

typeRep :: Proxy Extended -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

type Rep (Extended a) = D1 ('MetaData "Extended" "PlutusLedgerApi.V1.Interval" "plutus-ledger-api-1.36.0.0-5YP34Z4WNIC2QzLmhyGjha" 'False) (C1 ('MetaCons "NegInf" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Finite" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "PosInf" 'PrefixI 'False) (U1 :: Type -> Type)))
type Unroll (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

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

type Closure = Bool Source #

Whether a bound is inclusive or not.

member :: (Enum a, Ord a) => a -> Interval a -> Bool Source #

Check whether a value is in an interval.

interval :: 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 :: 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 :: 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 :: Interval a Source #

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

never :: 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 :: 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) => Interval a -> Interval a -> Interval a Source #

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

intersection :: (Enum a, Ord 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) => 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) => 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) => Interval a -> Bool Source #

Check if an Interval is empty.

before :: (Enum a, Ord a) => a -> Interval a -> Bool Source #

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

after :: (Enum a, Ord a) => a -> Interval a -> Bool Source #

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

lowerBound :: 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 :: 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 :: 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 :: 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.