Added These data types

This commit is contained in:
Jack Hodgkinson 2022-03-04 09:27:41 +00:00
parent 86182ced25
commit 43cd0c4507
6 changed files with 114 additions and 139 deletions

12
src/Plutarch/These.hs Normal file
View file

@ -0,0 +1,12 @@
module Plutarch.These (PThese (..)) where
import GHC.Generics qualified as GHC
import Generics.SOP
-- | Plutus These type with Scott-encoded representation.
data PThese (a :: PType) (b :: PType) (s :: S)
= PThis (Term s a)
| PThat (Term s b)
| PThese (Term s a) (Term s b)
deriving stock (GHC.Generic)
deriving anyclass (Generic, PlutusType)