liqwid-plutarch-extra-3.21.1: A collection of Plutarch extras from Liqwid Labs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plutarch.Extra.Const

Synopsis

Type

newtype PConst (a :: S -> Type) (b :: S -> Type) (s :: S) Source #

A value of type a pretending to a be a value of type b.

Since: 1.0.0

Constructors

PConst (Term s a) 

Instances

Instances details
PBifunctor PConst Source #

Since: 3.1.0

Instance details

Defined in Plutarch.Extra.Const

Associated Types

type PSubcategoryLeft PConst :: (S -> Type) -> Constraint Source #

type PSubcategoryRight PConst :: (S -> Type) -> Constraint Source #

Methods

pbimap :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PConst a, PSubcategoryLeft PConst c, PSubcategoryRight PConst b, PSubcategoryRight PConst d) => Term s ((a :--> c) :--> ((b :--> d) :--> (PConst a b :--> PConst c d))) Source #

pfirst :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategoryLeft PConst a, PSubcategoryLeft PConst c, PSubcategoryRight PConst b) => Term s ((a :--> c) :--> (PConst a b :--> PConst c b)) Source #

psecond :: forall (a :: S -> Type) (b :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PConst a, PSubcategoryRight PConst b, PSubcategoryRight PConst d) => Term s ((b :--> d) :--> (PConst a b :--> PConst a d)) Source #

(forall (s :: S). Monoid (Term s a)) => PApplicative (PConst a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

ppure :: forall (a0 :: S -> Type) (s :: S). PSubcategory (PConst a) a0 => Term s (a0 :--> PConst a a0) Source #

(forall (s :: S). Semigroup (Term s a)) => PApply (PConst a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

pliftA2 :: forall (a0 :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory (PConst a) a0, PSubcategory (PConst a) b, PSubcategory (PConst a) c) => Term s ((a0 :--> (b :--> c)) :--> (PConst a a0 :--> (PConst a b :--> PConst a c))) Source #

PFunctor (PConst a) Source #

Since: 3.1.0

Instance details

Defined in Plutarch.Extra.Const

Associated Types

type PSubcategory (PConst a) :: (S -> Type) -> Constraint Source #

Methods

pfmap :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PConst a) a0, PSubcategory (PConst a) b) => Term s ((a0 :--> b) :--> (PConst a a0 :--> PConst a b)) Source #

pfconst :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PConst a) a0, PSubcategory (PConst a) b) => Term s (a0 :--> (PConst a b :--> PConst a a0)) Source #

PTraversable (PConst a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Traversable

Methods

ptraverse :: forall (f :: (S -> Type) -> S -> Type) (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PSubcategory f a0, PSubcategory f b, PSubcategory f (PConst a b), PSubcategory (PConst a) a0, PSubcategory (PConst a) b) => Term s ((a0 :--> f b) :--> (PConst a a0 :--> f (PConst a b))) Source #

ptraverse_ :: forall (b :: S -> Type) (f :: (S -> Type) -> S -> Type) (a0 :: S -> Type) (s :: S). (PApplicative f, PSubcategory f b, PBoring b, PSubcategory (PConst a) a0) => Term s ((a0 :--> f b) :--> (PConst a a0 :--> f b)) Source #

PBoring a => PBoring (PConst a b) Source #

Since: 1.2.0

Instance details

Defined in Plutarch.Extra.Const

Methods

pboring :: forall (s :: S). Term s (PConst a b) Source #

PEq a => PEq (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

(#==) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s PBool Source #

POrd a => POrd (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

POrd a => PPartialOrd (PConst a b) Source #

Since: 1.4.0

Instance details

Defined in Plutarch.Extra.Const

Methods

(#<=) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s PBool Source #

PIsData a => PIsData (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PConst a b)) -> Term s (PConst a b) Source #

pdataImpl :: forall (s :: S). Term s (PConst a b) -> Term s PData Source #

PIntegral a => PIntegral (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

pdiv :: forall (s :: S). Term s (PConst a b :--> (PConst a b :--> PConst a b)) Source #

pmod :: forall (s :: S). Term s (PConst a b :--> (PConst a b :--> PConst a b)) Source #

pquot :: forall (s :: S). Term s (PConst a b :--> (PConst a b :--> PConst a b)) Source #

prem :: forall (s :: S). Term s (PConst a b :--> (PConst a b :--> PConst a b)) Source #

DerivePlutusType (PConst a b) Source #

Since: 1.4.0

Instance details

Defined in Plutarch.Extra.Const

Associated Types

type DPTStrat (PConst a b) Source #

PlutusType (PConst a b) Source # 
Instance details

Defined in Plutarch.Extra.Const

Associated Types

type PInner (PConst a b) :: PType Source #

type PCovariant' (PConst a b) Source #

type PContravariant' (PConst a b) Source #

type PVariant' (PConst a b) Source #

Methods

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

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

PNum a => PNum (PConst a b) Source #

Since: 1.4.0

Instance details

Defined in Plutarch.Extra.Const

Methods

(#+) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s (PConst a b) Source #

(#-) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s (PConst a b) Source #

(#*) :: forall (s :: S). Term s (PConst a b) -> Term s (PConst a b) -> Term s (PConst a b) Source #

pnegate :: forall (s :: S). Term s (PConst a b :--> PConst a b) Source #

pabs :: forall (s :: S). Term s (PConst a b :--> PConst a b) Source #

psignum :: forall (s :: S). Term s (PConst a b :--> PConst a b) Source #

pfromInteger :: forall (s :: S). Integer -> Term s (PConst a b) Source #

PShow a => PShow (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

Methods

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

Generic (PConst a b s) Source # 
Instance details

Defined in Plutarch.Extra.Const

Associated Types

type Rep (PConst a b s) :: Type -> Type Source #

Methods

from :: PConst a b s -> Rep (PConst a b s) x Source #

to :: Rep (PConst a b s) x -> PConst a b s Source #

type PSubcategoryLeft PConst Source # 
Instance details

Defined in Plutarch.Extra.Const

type PSubcategoryRight PConst Source # 
Instance details

Defined in Plutarch.Extra.Const

type PSubcategory (PConst a) Source # 
Instance details

Defined in Plutarch.Extra.Const

type DPTStrat (PConst a b) Source # 
Instance details

Defined in Plutarch.Extra.Const

type PContravariant' (PConst a b) Source # 
Instance details

Defined in Plutarch.Extra.Const

type PContravariant' (PConst a b) = All2 PContravariant'' (PCode (PConst a b))
type PCovariant' (PConst a b) Source # 
Instance details

Defined in Plutarch.Extra.Const

type PCovariant' (PConst a b) = All2 PCovariant'' (PCode (PConst a b))
type PInner (PConst a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

type PInner (PConst a b) = DerivedPInner (DPTStrat (PConst a b)) (PConst a b)
type PVariant' (PConst a b) Source # 
Instance details

Defined in Plutarch.Extra.Const

type PVariant' (PConst a b) = All2 PVariant'' (PCode (PConst a b))
type Rep (PConst a b s) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.Const

type Rep (PConst a b s) = D1 ('MetaData "PConst" "Plutarch.Extra.Const" "liqwid-plutarch-extra-3.21.1-KPadsMN5oqEA2Ctxwq6qig" 'True) (C1 ('MetaCons "PConst" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s a))))

Helper functions

preconst :: forall (c :: S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PConst a b) -> Term s (PConst a c) Source #

Since PConst is only pretending to be a value of another type, we can change what we 'pretend to be' without having to rebuild. Essentially, this is punsafeCoerce, but because we're only changing a tag, we're not worried.

Since: 1.2.0