plutus-core-1.60.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.FsTree

Description

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

Documentation

data FsTree a #

An FsTree is either a file or a folder with a list of FsTrees inside.

newtype FolderContents a #

The contents of a folder. A wrapper around [FsTree a]. Exists because of its Semigroup instance which allows to concatenate two FolderContentss 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.

Constructors

FolderContents 

Fields

Instances

Instances details
Monoid (FolderContents a) # 
Instance details

Defined in PlutusCore.FsTree

Semigroup (FolderContents a) # 
Instance details

Defined in PlutusCore.FsTree

data PlcEntity uni fun #

A PlcEntity is either a Kind or a Term.

Constructors

PlcType (Type TyName uni ()) 
PlcTerm (Term TyName Name uni fun ()) 

type PlcFsTree uni fun = FsTree (PlcEntity uni fun) #

type PlcFolderContents uni fun = FolderContents (PlcEntity uni fun) #

treeFolderContents :: String -> [FsTree a] -> FsTree a #

Construct an FsTree out of the name of a folder and a list of FsTrees.

plcTypeFile :: String -> Type TyName uni () -> PlcFsTree uni fun #

Construct a single-file PlcFsTree out of a type.

plcTermFile :: String -> Term TyName Name uni fun () -> PlcFsTree uni fun #

Construct a single-file PlcFsTree out of a term.

foldFsTree #

Arguments

:: (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.

foldPlcFsTree #

Arguments

:: (String -> [b] -> b)

What to do on a folder.

-> (String -> Type TyName uni () -> b)

What to do on a type.

-> (String -> Term TyName Name uni fun () -> b)

What to do on a term.

-> PlcFsTree uni fun 
-> b 

Fold a PlcFsTree.

foldPlcFolderContents #

Arguments

:: (String -> [b] -> b)

What to do on a folder.

-> (String -> Type TyName uni () -> b)

What to do on a type.

-> (String -> Term TyName Name uni fun () -> b)

What to do on a term.

-> PlcFolderContents uni fun 
-> [b] 

Fold the contents of a PLC folder.