Safe Haskell | None |
---|---|
Language | Haskell2010 |
Nested datatype to track the resolution algorithm
From this data type we can draw a graph of the full instantation of a value
Synopsis
- type Operations = [AppliedFunction]
- data AppliedFunction = AppliedFunction {
- _outputValue :: Value
- _inputValues :: [Value]
- makeEdges :: Operations -> [(Value, Value)]
- newtype Dot = Dot {}
- toDot :: Operations -> Dot
- toDotEdge :: (Value, Value) -> Text
- nodeDescription :: ValueDescription -> Text
- adjust :: Text -> Text
- removeQuotes :: Text -> Text
- escapeNewlines :: Text -> Text
Documentation
type Operations = [AppliedFunction] Source #
A list of function applications created when creating a value out of the Registry
data AppliedFunction Source #
A function application with an output value and a list of input values
Instances
Show AppliedFunction Source # | |
Defined in Data.Registry.Internal.Operations showsPrec :: Int -> AppliedFunction -> ShowS # show :: AppliedFunction -> String # showList :: [AppliedFunction] -> ShowS # |
makeEdges :: Operations -> [(Value, Value)] Source #
Make a list of graph edges from the list of function applications
A DOT graph
toDot :: Operations -> Dot Source #
Make a DOT graph out of all the function applications
nodeDescription :: ValueDescription -> Text Source #
Description of a Value in the DOT graph
adjust :: Text -> Text Source #
We need to process the node descriptions - we add quotes arountd the text - we remove quotes (") inside the text - we escape newlines
removeQuotes :: Text -> Text Source #
Remove quotes from a textual description to avoid breaking the DOT format
escapeNewlines :: Text -> Text Source #
Replace n with \n so that newlines are kept in node descriptions