module Plutarch.Script (Script (..), serialiseScript, deserialiseScript) where import Data.ByteString.Short (ShortByteString) import GHC.Generics (Generic) import PlutusLedgerApi.Common (deserialiseUPLC, serialiseUPLC) import UntypedPlutusCore qualified as UPLC newtype Script = Script {Script -> Program DeBruijn DefaultUni DefaultFun () unScript :: UPLC.Program UPLC.DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()} deriving newtype (Script -> Script -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Script -> Script -> Bool $c/= :: Script -> Script -> Bool == :: Script -> Script -> Bool $c== :: Script -> Script -> Bool Eq) deriving stock (Int -> Script -> ShowS [Script] -> ShowS Script -> String forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [Script] -> ShowS $cshowList :: [Script] -> ShowS show :: Script -> String $cshow :: Script -> String showsPrec :: Int -> Script -> ShowS $cshowsPrec :: Int -> Script -> ShowS Show, forall x. Rep Script x -> Script forall x. Script -> Rep Script x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep Script x -> Script $cfrom :: forall x. Script -> Rep Script x Generic) serialiseScript :: Script -> ShortByteString serialiseScript :: Script -> ShortByteString serialiseScript = Program DeBruijn DefaultUni DefaultFun () -> ShortByteString serialiseUPLC forall b c a. (b -> c) -> (a -> b) -> a -> c . Script -> Program DeBruijn DefaultUni DefaultFun () unScript deserialiseScript :: ShortByteString -> Script deserialiseScript :: ShortByteString -> Script deserialiseScript = Program DeBruijn DefaultUni DefaultFun () -> Script Script forall b c a. (b -> c) -> (a -> b) -> a -> c . ShortByteString -> Program DeBruijn DefaultUni DefaultFun () deserialiseUPLC