| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Plutarch.Internal.TryFrom
Synopsis
- class PSubtype a b => PTryFrom (a :: S -> Type) (b :: S -> Type)
- type family PTryFromExcess (a :: S -> Type) (b :: S -> Type) :: S -> Type
- ptryFrom' :: forall (s :: S) (r :: S -> Type). PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r
- ptryFrom :: forall (b :: S -> Type) (a :: S -> Type) (s :: S) (r :: S -> Type). PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r
- data PSubtypeRelation
- type family PSubtype (a :: S -> Type) (b :: S -> Type) where ...
- type family PSubtype' (a :: S -> Type) (b :: S -> Type) :: PSubtypeRelation where ...
- pupcast :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PSubtype a b => Term s b -> Term s a
Documentation
class PSubtype a b => PTryFrom (a :: S -> Type) (b :: S -> Type) Source #
PTryFrom a b represents a subtyping relationship between a and b,
and a way to go from a to b.
Laws:
- (punsafeCoerce . fst) $ tcont (ptryFrom x) ≡ pure x
Instances
type family PTryFromExcess (a :: S -> Type) (b :: S -> Type) :: S -> Type Source #
Instances
| type PTryFromExcess PData PData Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PInteger PPositive Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PBool) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PByteString) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) Source # | |
Defined in Plutarch.Internal.TryFrom type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) | |
| type PTryFromExcess PData (PAsData (PBuiltinList PData)) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData (PBuiltinPair a b)) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PData) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PInteger) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData (PDataRecord as)) Source # | |
Defined in Plutarch.DataRepr.Internal | |
| type PTryFromExcess PData (PAsData (PDataSum ys)) Source # | |
Defined in Plutarch.DataRepr.Internal | |
| type PTryFromExcess PData (PAsData (PEitherData a b)) Source # | |
Defined in Plutarch.Either type PTryFromExcess PData (PAsData (PEitherData a b)) = PTryFromExcess PData (PInner (PAsData (PEitherData a b))) | |
| type PTryFromExcess PData (PAsData PNatural) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PPositive) Source # | |
Defined in Plutarch.Internal.TryFrom | |
| type PTryFromExcess PData (PAsData PRational) Source # | |
Defined in Plutarch.Rational | |
| type PTryFromExcess PData (PDataSum ys) Source # | |
Defined in Plutarch.DataRepr.Internal | |
| type PTryFromExcess PData (PEitherData a b) Source # | |
Defined in Plutarch.Either | |
| type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) Source # | |
Defined in Plutarch.DataRepr.Internal | |
| type PTryFromExcess (PBuiltinList PData) (PDataRecord ('[] :: [PLabeledType])) Source # | |
Defined in Plutarch.DataRepr.Internal | |
ptryFrom' :: forall (s :: S) (r :: S -> Type). PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r Source #
ptryFrom :: forall (b :: S -> Type) (a :: S -> Type) (s :: S) (r :: S -> Type). PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r Source #
data PSubtypeRelation Source #
Constructors
| PSubtypeRelation | |
| PNoSubtypeRelation |
type family PSubtype (a :: S -> Type) (b :: S -> Type) where ... Source #
Equations
| PSubtype a b = (PSubtype' a b ~ 'PSubtypeRelation, PSubtypeHelper a b (PSubtype' a b)) |