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

Hydra.Tier1

Description

A module for miscellaneous tier-1 functions and constants.

Synopsis

Documentation

floatValueToBigfloat :: FloatValue -> Double Source #

Convert a floating-point value of any precision to a bigfloat

integerValueToBigint :: IntegerValue -> Integer Source #

Convert an integer value of any precision to a bigint

isLambda :: Term -> Bool Source #

Check whether a term is a lambda, possibly nested within let and/or annotation terms

unqualifyName :: QualifiedName -> Name Source #

Convert a qualified name to a dot-separated name

foldOverTerm :: TraversalOrder -> (x -> Term -> x) -> x -> Term -> x Source #

Fold over a term, traversing its subterms in the specified order

foldOverType :: TraversalOrder -> (x -> Type -> x) -> x -> Type -> x Source #

Fold over a type, traversing its subtypes in the specified order

freeVariablesInTerm :: Term -> Set Name Source #

Find the free variables (i.e. variables not bound by a lambda or let) in a term

freeVariablesInType :: Type -> Set Name Source #

Find the free variables (i.e. variables not bound by a lambda or let) in a type

subterms :: Term -> [Term] Source #

Find the children of a given term

subtypes :: Type -> [Type] Source #

Find the children of a given type expression

flowSucceeds :: s -> Flow s a -> Bool Source #

Check whether a flow succeeds

fromFlow :: a -> s -> Flow s a -> a Source #

Get the value of a flow, or a default value if the flow fails

mutateTrace :: (Trace -> Either_ String Trace) -> (Trace -> Trace -> Trace) -> Flow s a -> Flow s a Source #

pushError :: String -> Trace -> Trace Source #

Push an error message

warn :: String -> Flow s a -> Flow s a Source #

Continue the current flow after adding a warning message

withFlag :: String -> Flow s a -> Flow s a Source #

Continue the current flow after setting a flag

withState :: s1 -> Flow s1 a -> Flow s2 a Source #

Continue a flow using a given state

withTrace :: String -> Flow s a -> Flow s a Source #

Continue the current flow after augmenting the trace