| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Plutarch.Internal.TryFrom
Synopsis
- class PSubtype a b => PTryFrom (a :: S -> Type) (b :: S -> Type)
- type family PTryFromExcess a b :: S -> Type
- ptryFrom' :: forall s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r
- ptryFrom :: forall b a s r. 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) :: Constraint where ...
- type family PSubtype' (a :: S -> Type) (b :: S -> Type) :: PSubtypeRelation where ...
- pupcast :: forall a b 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 b :: S -> Type Source #
Instances
ptryFrom' :: forall s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r Source #
ptryFrom :: forall b a s r. 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) :: Constraint where ... Source #
Equations
| PSubtype a b = (PSubtype' a b ~ 'PSubtypeRelation, PSubtypeHelper a b (PSubtype' a b)) |