Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Machinery defined in this module allows to export mulptiple Plutus Core definitions (types and terms) as a single value which enables convenient testing of various procedures (pretty-printing, type checking, etc): each time a function / data type is added to that value, none of the tests is required to be adapted, instead all the tests see the new definition automatically.
Synopsis
- data FsTree a
- = FsFolder String (FolderContents a)
- | FsFile String a
- newtype FolderContents a = FolderContents {
- unFolderContents ∷ [FsTree a]
- data PlcEntity uni fun
- type PlcFsTree uni fun = FsTree (PlcEntity uni fun)
- type PlcFolderContents uni fun = FolderContents (PlcEntity uni fun)
- treeFolderContents ∷ String → [FsTree a] → FsTree a
- plcTypeFile ∷ String → Type TyName uni () → PlcFsTree uni fun
- plcTermFile ∷ String → Term TyName Name uni fun () → PlcFsTree uni fun
- foldFsTree ∷ (String → [b] → b) → (String → a → b) → FsTree a → b
- foldPlcFsTree ∷ (String → [b] → b) → (String → Type TyName uni () → b) → (String → Term TyName Name uni fun () → b) → PlcFsTree uni fun → b
- foldPlcFolderContents ∷ (String → [b] → b) → (String → Type TyName uni () → b) → (String → Term TyName Name uni fun () → b) → PlcFolderContents uni fun → [b]
Documentation
FsFolder String (FolderContents a) | |
FsFile String a |
newtype FolderContents a Source #
The contents of a folder. A wrapper around [FsTree a]
.
Exists because of its Semigroup
instance which allows to concatenate two FolderContents
s
without placing them into the same folder immediately, so we can have various PLC "modules"
(stdlib
, examples
, etc), define compound modules (e.g. stdlib <> examples
) and run various
tests (pretty-printing, type synthesis, etc) against simple and compound modules uniformly.
Instances
Monoid (FolderContents a) Source # | |
Defined in PlutusCore.FsTree mempty ∷ FolderContents a Source # mappend ∷ FolderContents a → FolderContents a → FolderContents a Source # mconcat ∷ [FolderContents a] → FolderContents a Source # | |
Semigroup (FolderContents a) Source # | |
Defined in PlutusCore.FsTree (<>) ∷ FolderContents a → FolderContents a → FolderContents a Source # sconcat ∷ NonEmpty (FolderContents a) → FolderContents a Source # stimes ∷ Integral b ⇒ b → FolderContents a → FolderContents a Source # |
type PlcFolderContents uni fun = FolderContents (PlcEntity uni fun) Source #
plcTypeFile ∷ String → Type TyName uni () → PlcFsTree uni fun Source #
Construct a single-file PlcFsTree
out of a type.
plcTermFile ∷ String → Term TyName Name uni fun () → PlcFsTree uni fun Source #
Construct a single-file PlcFsTree
out of a term.
∷ (String → [b] → b) | What to do on a folder. |
→ (String → a → b) | What to do on a single file in a folder. |
→ FsTree a | |
→ b |
Fold a FsTree
.