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