Format rescript
This commit is contained in:
parent
b00edc78f9
commit
ecf9d43401
|
@ -298,7 +298,9 @@ export const ExpressionViewer: React.FC<Props> = ({ value, width }) => {
|
|||
{() => (
|
||||
<div>
|
||||
<span>No display for type: </span>{" "}
|
||||
<span className="font-semibold text-slate-600">{value.tag}</span>
|
||||
<span className="font-semibold text-slate-600">
|
||||
{(value as { tag: string }).tag}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</VariableList>
|
||||
|
|
|
@ -71,7 +71,8 @@ let library = [
|
|||
~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))],
|
||||
~run=(inputs, _, _) => {
|
||||
switch inputs {
|
||||
| [IEvArray(dicts)] => dicts
|
||||
| [IEvArray(dicts)] =>
|
||||
dicts
|
||||
->Belt.Array.map(dictValue =>
|
||||
switch dictValue {
|
||||
| IEvRecord(dict) => dict
|
||||
|
|
|
@ -7,7 +7,8 @@ let requiresNamespace = true
|
|||
let inputsToDist = (inputs: array<Reducer_T.value>, xyShapeToPointSetDist) => {
|
||||
// TODO - rewrite in more functional/functor-based style
|
||||
switch inputs {
|
||||
| [IEvArray(items)] => items
|
||||
| [IEvArray(items)] =>
|
||||
items
|
||||
->Belt.Array.map(item =>
|
||||
switch item {
|
||||
| IEvRecord(map) => {
|
||||
|
|
|
@ -83,15 +83,12 @@ module FRType = {
|
|||
| (FRTypeNumeric, IEvNumber(_)) => true
|
||||
| (FRTypeNumeric, IEvDistribution(Symbolic(#Float(_)))) => true
|
||||
| (FRTypeLambda, IEvLambda(_)) => true
|
||||
| (FRTypeArray(intendedType), IEvArray(elements)) => elements->Belt.Array.every(v =>
|
||||
matchWithValue(intendedType, v)
|
||||
)
|
||||
| (FRTypeArray(intendedType), IEvArray(elements)) =>
|
||||
elements->Belt.Array.every(v => matchWithValue(intendedType, v))
|
||||
| (FRTypeDict(r), IEvRecord(map)) =>
|
||||
map->Belt.Map.String.valuesToArray->Belt.Array.every(v => matchWithValue(r, v))
|
||||
| (FRTypeRecord(recordParams), IEvRecord(map)) => recordParams->Belt.Array.every(((
|
||||
name,
|
||||
input,
|
||||
)) => {
|
||||
| (FRTypeRecord(recordParams), IEvRecord(map)) =>
|
||||
recordParams->Belt.Array.every(((name, input)) => {
|
||||
switch map->Belt.Map.String.get(name) {
|
||||
| Some(v) => matchWithValue(input, v)
|
||||
| None => false
|
||||
|
|
Loading…
Reference in New Issue
Block a user