hydra-0.5.1: Type-aware transformations for data and programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Tools.Templating

Description

A utility which instantiates a nonrecursive type with default values.

Synopsis

Documentation

graphToSchema :: Graph -> Flow Graph (Map Name Type) Source #

Create a graph schema from a graph which contains nothing but encoded type definitions.

insantiateTemplate :: Bool -> Map Name Type -> Type -> Flow s Term Source #

Given a graph schema and a nonrecursive type, instantiate it with default values. If the minimal flag is set, the smallest possible term is produced; otherwise, exactly one subterm is produced for constructors which do not otherwise require one, e.g. in lists and optionals.