{-# LANGUAGE LambdaCase #-}
module PlutusCore.Executable.Types where
import PlutusCore qualified as PLC
import PlutusIR qualified as PIR
import UntypedPlutusCore qualified as UPLC
import Data.Text qualified as T
type PirProg =
PIR.Program PLC.TyName PLC.Name PLC.DefaultUni PLC.DefaultFun
type PirTerm =
PIR.Term PLC.TyName PLC.Name PLC.DefaultUni PLC.DefaultFun
type PlcProg =
PLC.Program PLC.TyName PLC.Name PLC.DefaultUni PLC.DefaultFun
type PlcTerm =
PLC.Term PLC.TyName PLC.Name PLC.DefaultUni PLC.DefaultFun
type UplcProg =
UPLC.Program PLC.Name PLC.DefaultUni PLC.DefaultFun
type UplcTerm =
UPLC.Term UPLC.Name PLC.DefaultUni PLC.DefaultFun
data AstNameType
= Named
| DeBruijn
| NamedDeBruijn
deriving stock Int -> AstNameType -> ShowS
[AstNameType] -> ShowS
AstNameType -> String
(Int -> AstNameType -> ShowS)
-> (AstNameType -> String)
-> ([AstNameType] -> ShowS)
-> Show AstNameType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AstNameType -> ShowS
showsPrec :: Int -> AstNameType -> ShowS
$cshow :: AstNameType -> String
show :: AstNameType -> String
$cshowList :: [AstNameType] -> ShowS
showList :: [AstNameType] -> ShowS
Show
data Input = FileInput FilePath | StdInput
instance Show Input where
show :: Input -> String
show (FileInput String
path) = ShowS
forall a. Show a => a -> String
show String
path
show Input
StdInput = String
"<stdin>"
data Output = FileOutput FilePath | StdOutput | NoOutput
data TimingMode = NoTiming | Timing Integer deriving stock (TimingMode -> TimingMode -> Bool
(TimingMode -> TimingMode -> Bool)
-> (TimingMode -> TimingMode -> Bool) -> Eq TimingMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimingMode -> TimingMode -> Bool
== :: TimingMode -> TimingMode -> Bool
$c/= :: TimingMode -> TimingMode -> Bool
/= :: TimingMode -> TimingMode -> Bool
Eq)
data CekModel = Default | Unit
data PrintMode = Classic | Simple | Readable | ReadableSimple deriving stock (Int -> PrintMode -> ShowS
[PrintMode] -> ShowS
PrintMode -> String
(Int -> PrintMode -> ShowS)
-> (PrintMode -> String)
-> ([PrintMode] -> ShowS)
-> Show PrintMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrintMode -> ShowS
showsPrec :: Int -> PrintMode -> ShowS
$cshow :: PrintMode -> String
show :: PrintMode -> String
$cshowList :: [PrintMode] -> ShowS
showList :: [PrintMode] -> ShowS
Show, ReadPrec [PrintMode]
ReadPrec PrintMode
Int -> ReadS PrintMode
ReadS [PrintMode]
(Int -> ReadS PrintMode)
-> ReadS [PrintMode]
-> ReadPrec PrintMode
-> ReadPrec [PrintMode]
-> Read PrintMode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS PrintMode
readsPrec :: Int -> ReadS PrintMode
$creadList :: ReadS [PrintMode]
readList :: ReadS [PrintMode]
$creadPrec :: ReadPrec PrintMode
readPrec :: ReadPrec PrintMode
$creadListPrec :: ReadPrec [PrintMode]
readListPrec :: ReadPrec [PrintMode]
Read)
data NameFormat = IdNames | DeBruijnNames
data TraceMode = None | Logs | LogsWithTimestamps | LogsWithBudgets deriving stock (Int -> TraceMode -> ShowS
[TraceMode] -> ShowS
TraceMode -> String
(Int -> TraceMode -> ShowS)
-> (TraceMode -> String)
-> ([TraceMode] -> ShowS)
-> Show TraceMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TraceMode -> ShowS
showsPrec :: Int -> TraceMode -> ShowS
$cshow :: TraceMode -> String
show :: TraceMode -> String
$cshowList :: [TraceMode] -> ShowS
showList :: [TraceMode] -> ShowS
Show, ReadPrec [TraceMode]
ReadPrec TraceMode
Int -> ReadS TraceMode
ReadS [TraceMode]
(Int -> ReadS TraceMode)
-> ReadS [TraceMode]
-> ReadPrec TraceMode
-> ReadPrec [TraceMode]
-> Read TraceMode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS TraceMode
readsPrec :: Int -> ReadS TraceMode
$creadList :: ReadS [TraceMode]
readList :: ReadS [TraceMode]
$creadPrec :: ReadPrec TraceMode
readPrec :: ReadPrec TraceMode
$creadListPrec :: ReadPrec [TraceMode]
readListPrec :: ReadPrec [TraceMode]
Read)
type ExampleName = T.Text
data ExampleMode = ExampleSingle ExampleName | ExampleAvailable
type Files = [FilePath]
data Format
= Textual
| Flat AstNameType
instance Show Format where
show :: Format -> String
show Format
Textual = String
"textual"
show (Flat AstNameType
Named) = String
"flat-named"
show (Flat AstNameType
DeBruijn) = String
"flat-deBruijn"
show (Flat AstNameType
NamedDeBruijn) = String
"flat-namedDeBruijn"
type Certifier = Maybe String
data ConvertOptions = ConvertOptions Input Format Output Format PrintMode
data OptimiseOptions = OptimiseOptions Input Format Output Format PrintMode Certifier
data PrintOptions = PrintOptions Input Output PrintMode
newtype ExampleOptions = ExampleOptions ExampleMode
data ApplyOptions = ApplyOptions Files Format Output Format PrintMode
data PirFormat = TextualPir | FlatNamed
instance Show PirFormat
where show :: PirFormat -> String
show = \case { PirFormat
TextualPir -> String
"textual"; PirFormat
FlatNamed -> String
"flat-named" }
pirFormatToFormat :: PirFormat -> Format
pirFormatToFormat :: PirFormat -> Format
pirFormatToFormat PirFormat
TextualPir = Format
Textual
pirFormatToFormat PirFormat
FlatNamed = AstNameType -> Format
Flat AstNameType
Named
data Language = PLC | UPLC