plutus-core-1.36.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 Source #

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

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 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

data PlcEntity uni fun Source #

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) Source #

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

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

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.

foldFsTree Source #

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 Source #

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 Source #

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.