plutarch-1.3.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Internal

Synopsis

Documentation

$hoisted

newtype ((a :: PType) :--> (b :: PType)) (s :: S) infixr 0 Source #

Constructors

PLam (Term s a -> Term s b) 

Instances

Instances details
PlutusType (a :--> b) Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Associated Types

type PInner (a :--> b) :: PType Source #

type PCovariant' (a :--> b) Source #

type PContravariant' (a :--> b) Source #

type PVariant' (a :--> b) Source #

Methods

pcon' :: forall (s :: S). (a :--> b) s -> Term s (PInner (a :--> b)) Source #

pmatch' :: forall (s :: S) (b0 :: PType). Term s (PInner (a :--> b)) -> ((a :--> b) s -> Term s b0) -> Term s b0 Source #

type PContravariant' (a :--> b) Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' (a :--> b) Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner (a :--> b) Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner (a :--> b) = a :--> b
type PVariant' (a :--> b) Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' (a :--> b) = (PVariant' a, PVariant' b)

data PDelayed (a :: PType) (s :: S) Source #

$term

newtype Term (s :: S) (a :: PType) Source #

Constructors

Term 

Instances

Instances details
(IndexLabel name as ~ a, ElemOf name a as, Term s (PAsData b) ~ a, PFromDataable b c) => HasField (name :: Symbol) (HRec as) (Term s c) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal.HList

Methods

getField :: HRec as -> Term s c Source #

IsString (Term s PString) Source # 
Instance details

Defined in Plutarch.String

(POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Methods

mempty :: Term s (PMap 'Sorted k v) Source #

mappend :: Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) Source #

mconcat :: [Term s (PMap 'Sorted k v)] -> Term s (PMap 'Sorted k v) Source #

Semigroup (Term s (PValue 'Sorted normalization)) => Monoid (Term s (PValue 'Sorted normalization)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Methods

mempty :: Term s (PValue 'Sorted normalization) Source #

mappend :: Term s (PValue 'Sorted normalization) -> Term s (PValue 'Sorted normalization) -> Term s (PValue 'Sorted normalization) Source #

mconcat :: [Term s (PValue 'Sorted normalization)] -> Term s (PValue 'Sorted normalization) Source #

Monoid (Term s PByteString) Source # 
Instance details

Defined in Plutarch.ByteString

Monoid (Term s PString) Source # 
Instance details

Defined in Plutarch.String

Monoid (Term s (PUnit :: S -> Type)) Source # 
Instance details

Defined in Plutarch.Unit

(POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Methods

(<>) :: Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) Source #

sconcat :: NonEmpty (Term s (PMap 'Sorted k v)) -> Term s (PMap 'Sorted k v) Source #

stimes :: Integral b => b -> Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) Source #

Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s (PValue 'Sorted 'NonZero)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s (PValue 'Sorted 'Positive)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s PByteString) Source # 
Instance details

Defined in Plutarch.ByteString

Semigroup (Term s PString) Source # 
Instance details

Defined in Plutarch.String

Semigroup (Term s (PUnit :: S -> Type)) Source # 
Instance details

Defined in Plutarch.Unit

(PIsData k, PIsData v, POrd k) => IsList (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Associated Types

type Item (Term s (PMap 'Sorted k v)) Source #

Methods

fromList :: [Item (Term s (PMap 'Sorted k v))] -> Term s (PMap 'Sorted k v) Source #

fromListN :: Int -> [Item (Term s (PMap 'Sorted k v))] -> Term s (PMap 'Sorted k v) Source #

toList :: Term s (PMap 'Sorted k v) -> [Item (Term s (PMap 'Sorted k v))] Source #

(PIsData k, PIsData v, POrd k) => IsList (Term s (PMap 'Unsorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Associated Types

type Item (Term s (PMap 'Unsorted k v)) Source #

Methods

fromList :: [Item (Term s (PMap 'Unsorted k v))] -> Term s (PMap 'Unsorted k v) Source #

fromListN :: Int -> [Item (Term s (PMap 'Unsorted k v))] -> Term s (PMap 'Unsorted k v) Source #

toList :: Term s (PMap 'Unsorted k v) -> [Item (Term s (PMap 'Unsorted k v))] Source #

PNum a => Num (Term s a) Source # 
Instance details

Defined in Plutarch.Num

Methods

(+) :: Term s a -> Term s a -> Term s a Source #

(-) :: Term s a -> Term s a -> Term s a Source #

(*) :: Term s a -> Term s a -> Term s a Source #

negate :: Term s a -> Term s a Source #

abs :: Term s a -> Term s a Source #

signum :: Term s a -> Term s a Source #

fromInteger :: Integer -> Term s a Source #

(PNum a, PFractional a) => Fractional (Term s a) Source # 
Instance details

Defined in Plutarch.Rational

Methods

(/) :: Term s a -> Term s a -> Term s a Source #

recip :: Term s a -> Term s a Source #

fromRational :: Rational -> Term s a Source #

(POrd k, PIsData k, PIsData v, Group (Term s v)) => Group (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Methods

inv :: Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) Source #

Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) => Group (Term s (PValue 'Sorted 'NoGuarantees)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s (PValue 'Sorted 'NonZero)) => Group (Term s (PValue 'Sorted 'NonZero)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

(POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Methods

mempty :: Term s (PMap 'Sorted k v) Source #

Semigroup (Term s (PValue 'Sorted normalization)) => Monoid (Term s (PValue 'Sorted normalization)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Methods

mempty :: Term s (PValue 'Sorted normalization) Source #

(POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

Methods

(<>) :: Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) -> Term s (PMap 'Sorted k v) Source #

Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s (PValue 'Sorted 'NonZero)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

Semigroup (Term s (PValue 'Sorted 'Positive)) Source # 
Instance details

Defined in Plutarch.Api.V1.Value

type Item (Term s (PMap 'Sorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

type Item (Term s (PMap 'Sorted k v)) = (Term s k, Term s v)
type Item (Term s (PMap 'Unsorted k v)) Source # 
Instance details

Defined in Plutarch.Api.V1.AssocMap

type Item (Term s (PMap 'Unsorted k v)) = (Term s k, Term s v)

newtype Script Source #

Instances

Instances details
Generic Script Source # 
Instance details

Defined in Plutarch.Script

Associated Types

type Rep Script :: Type -> Type Source #

Show Script Source # 
Instance details

Defined in Plutarch.Script

Eq Script Source # 
Instance details

Defined in Plutarch.Script

type Rep Script Source # 
Instance details

Defined in Plutarch.Script

type Rep Script = D1 ('MetaData "Script" "Plutarch.Script" "plutarch-1.3.0-287WdR4V4qr3NTh5i3Je4I" 'True) (C1 ('MetaCons "Script" 'PrefixI 'True) (S1 ('MetaSel ('Just "unScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Program DeBruijn DefaultUni DefaultFun ()))))

plam' :: (Term s a -> Term s b) -> Term s (a :--> b) Source #

Lambda abstraction.

Only works with a single argument. Use plam instead, to support currying.

plet :: Term s a -> (Term s a -> Term s b) -> Term s b Source #

Let bindings.

This is appoximately a shorthand for a lambda and application:

plet v f == papp (plam f) v

But sufficiently small terms in WHNF may be inlined for efficiency.

papp :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b Source #

Lambda Application.

pdelay :: Term s a -> Term s (PDelayed a) Source #

Plutus 'delay', used for laziness.

pforce :: Term s (PDelayed a) -> Term s a Source #

Plutus 'force', used to force evaluation of PDelayed terms.

perror :: Term s a Source #

Plutus 'error'.

When using this explicitly, it should be ensured that the containing term is delayed, avoiding premature evaluation.

punsafeCoerce :: Term s a -> Term s b Source #

Unsafely coerce the type-tag of a Term.

This should mostly be avoided, though it can be safely used to assert known types of Datums, Redeemers or ScriptContext.

punsafeConstant :: Some (ValueOf DefaultUni) -> Term s a Source #

Deprecated: Use pconstant instead.

compile :: Config -> ClosedTerm a -> Either Text Script Source #

Compile a (closed) Plutus Term to a usable script

type ClosedTerm (a :: PType) = forall (s :: S). Term s a Source #

  • Closed* terms with no free variables.

data TermResult Source #

Constructors

TermResult 

Fields

data S Source #

Constructors

SI 

Instances

Instances details
PEq (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

Methods

(#==) :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PBool Source #

POrd (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

PPartialOrd (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

Methods

(#<=) :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PBool Source #

PIsData (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PUnit) -> Term s PUnit Source #

pdataImpl :: forall (s :: S). Term s PUnit -> Term s PData Source #

PlutusType (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

Methods

pcon' :: forall (s :: S). PUnit s -> Term s (PInner PUnit) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PUnit) -> (PUnit s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

Associated Types

type PLifted PUnit = (r :: Type) Source #

PShow (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

Methods

pshow' :: forall (s :: S). Bool -> Term s PUnit -> Term s PString Source #

Monoid (Term s (PUnit :: S -> Type)) Source # 
Instance details

Defined in Plutarch.Unit

Semigroup (Term s (PUnit :: S -> Type)) Source # 
Instance details

Defined in Plutarch.Unit

type PContravariant' (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

type PCovariant' (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

type PCovariant' (PUnit :: S -> Type)
type PInner (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

type PInner (PUnit :: S -> Type) = PUnit :: S -> Type
type PVariant' (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

type PVariant' (PUnit :: S -> Type)
type PLifted (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Unit

type PLifted (PUnit :: S -> Type) = ()

type PType = S -> Type Source #

Shorthand for Plutarch types.

newtype Config Source #

Constructors

Config 

Instances

Instances details
Default Config Source #

Default is to be efficient

Instance details

Defined in Plutarch.Internal

Methods

def :: Config Source #

pgetConfig :: (Config -> Term s a) -> Term s a Source #

newtype TermMonad m Source #

Constructors

TermMonad 

Instances

Instances details
Applicative TermMonad Source # 
Instance details

Defined in Plutarch.Internal

Methods

pure :: a -> TermMonad a Source #

(<*>) :: TermMonad (a -> b) -> TermMonad a -> TermMonad b Source #

liftA2 :: (a -> b -> c) -> TermMonad a -> TermMonad b -> TermMonad c Source #

(*>) :: TermMonad a -> TermMonad b -> TermMonad b Source #

(<*) :: TermMonad a -> TermMonad b -> TermMonad a Source #

Functor TermMonad Source # 
Instance details

Defined in Plutarch.Internal

Methods

fmap :: (a -> b) -> TermMonad a -> TermMonad b Source #

(<$) :: a -> TermMonad b -> TermMonad a Source #

Monad TermMonad Source # 
Instance details

Defined in Plutarch.Internal

Methods

(>>=) :: TermMonad a -> (a -> TermMonad b) -> TermMonad b Source #

(>>) :: TermMonad a -> TermMonad b -> TermMonad b Source #

return :: a -> TermMonad a Source #

(#) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b infixl 8 Source #

High precedence infixl synonym of papp, to be used like function juxtaposition. e.g.:

>>> f # x # y
f x y

(#$) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b infixr 0 Source #

Low precedence infixr synonym of papp, to be used like $, in combination with #. e.g.:

>>> f # x #$ g # y # z
f x (g y z)