Adding very simple hashes to types
This commit is contained in:
parent
274b5929a6
commit
6d36284283
|
@ -21,6 +21,7 @@ export class CodeEditor extends React.Component {
|
|||
mode="golang"
|
||||
height="400px"
|
||||
width="100%"
|
||||
keyboardHandler="vim"
|
||||
theme="github"
|
||||
showGutter={false}
|
||||
highlightActiveLine={false}
|
||||
|
|
|
@ -337,6 +337,13 @@ let rec toLeaf =
|
|||
FloatFromDist.operationToLeaf(evaluationParams, distToFloatOp, t)
|
||||
| `Normalize(t) => Normalize.operationToLeaf(evaluationParams, t)
|
||||
| `Render(t) => Render.operationToLeaf(evaluationParams, t)
|
||||
| `Hash(t) =>
|
||||
t
|
||||
|> E.A.fmap(((name: string, node: node)) =>
|
||||
toLeaf(evaluationParams, node) |> E.R.fmap(r => (name, r))
|
||||
)
|
||||
|> E.A.R.firstErrorOrOpen
|
||||
|> E.R.fmap(r => `Hash(r))
|
||||
| `Symbol(r) =>
|
||||
ExpressionTypes.ExpressionTree.Environment.get(
|
||||
evaluationParams.environment,
|
||||
|
@ -364,7 +371,6 @@ let rec toLeaf =
|
|||
(acc, x) => {`PointwiseCombination((`Add, acc, x))},
|
||||
E.A.unsafe_get(components, 0),
|
||||
);
|
||||
Ok(`Normalize(pointwiseSum))
|
||||
|> E.R.bind(_, toLeaf(evaluationParams))
|
||||
Ok(`Normalize(pointwiseSum)) |> E.R.bind(_, toLeaf(evaluationParams));
|
||||
};
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@ module ExpressionTree = {
|
|||
| `SymbolicDist(SymbolicTypes.symbolicDist)
|
||||
| `RenderedDist(DistTypes.shape)
|
||||
| `Symbol(string)
|
||||
| `Hash(array((string, node)))
|
||||
| `Function(array(string), node)
|
||||
| `AlgebraicCombination(algebraicOperation, node, node)
|
||||
| `PointwiseCombination(pointwiseOperation, node, node)
|
||||
|
|
Loading…
Reference in New Issue
Block a user