add example
This commit is contained in:
parent
bdd7dabc90
commit
8a9fd5ebfe
2 changed files with 5 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import { ExprBlock, type ExprBlockState } from '../expr/ExprBlock';
|
||||||
import { TypeInfoBlock } from '../other/Type';
|
import { TypeInfoBlock } from '../other/Type';
|
||||||
import { Value } from '../other/Value';
|
import { Value } from '../other/Value';
|
||||||
import { actionShortcuts } from './actions';
|
import { actionShortcuts } from './actions';
|
||||||
import { biggerExample, dynamic, emptySet, factorial, higherOrder, higherOrder2Params, inc, initialEditorState, lambda2Params, nonEmptyEditorState, pushBool, setOfListOfBool, tripleFunctionCallEditorState } from "./configurations";
|
import { biggerExample, dynamic, emptySet, factorial, higherOrder, higherOrder2Params, inc, initialEditorState, lambda2Params, nonEmptyEditorState, pushBool, setOfListOfBool, transform, tripleFunctionCallEditorState } from "./configurations";
|
||||||
import { extendedEnv } from './environment';
|
import { extendedEnv } from './environment';
|
||||||
|
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
@ -25,6 +25,7 @@ const examples: [string, ExprBlockState][] = [
|
||||||
["factorial" , factorial ],
|
["factorial" , factorial ],
|
||||||
["set of list of bool" , setOfListOfBool ],
|
["set of list of bool" , setOfListOfBool ],
|
||||||
["dynamic" , dynamic ],
|
["dynamic" , dynamic ],
|
||||||
|
["transform" , transform ],
|
||||||
];
|
];
|
||||||
|
|
||||||
type AppState = {
|
type AppState = {
|
||||||
|
|
|
||||||
|
|
@ -147,4 +147,6 @@ export const factorial: ExprBlockState = {"kind":"let","name":"factorial","focus
|
||||||
|
|
||||||
export const setOfListOfBool: ExprBlockState = {"kind":"call","fn":{"kind":"input","text":"set.emptySet","value":{"kind":"name"},"focus":false},"input":{"kind":"call","fn":{"kind":"input","text":"compareLists","value":{"kind":"name"}},"input":{"kind":"input","text":"compareDoubles","value":{"kind":"name"}}}};
|
export const setOfListOfBool: ExprBlockState = {"kind":"call","fn":{"kind":"input","text":"set.emptySet","value":{"kind":"name"},"focus":false},"input":{"kind":"call","fn":{"kind":"input","text":"compareLists","value":{"kind":"name"}},"input":{"kind":"input","text":"compareDoubles","value":{"kind":"name"}}}};
|
||||||
|
|
||||||
export const dynamic: ExprBlockState = {"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"addInt","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"input","text":"getInst","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"newDynamic","value":{"kind":"name"}},"input":{"kind":"input","text":"52","value":{"kind":"literal","type":"Int"}}},"input":{"kind":"input","text":"Int","value":{"kind":"name"}}}}},"input":{"kind":"input","text":"1","value":{"kind":"literal","type":"Int"}}};
|
export const dynamic: ExprBlockState = {"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"addInt","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"input","text":"getInst","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"newDynamic","value":{"kind":"name"}},"input":{"kind":"input","text":"52","value":{"kind":"literal","type":"Int"}}},"input":{"kind":"input","text":"Int","value":{"kind":"name"}}}}},"input":{"kind":"input","text":"1","value":{"kind":"literal","type":"Int"}}};
|
||||||
|
|
||||||
|
export const transform: ExprBlockState = {"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"transform","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"input","text":"newLiteral","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"newDynamic","value":{"kind":"name"}},"input":{"kind":"input","text":"42","value":{"kind":"literal","type":"Int"}}},"input":{"kind":"input","text":"Int","value":{"kind":"name"}}}}},"input":{"kind":"call","fn":{"kind":"input","text":"newLiteral","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"newDynamic","value":{"kind":"name"}},"input":{"kind":"call","fn":{"kind":"input","text":"addInt","value":{"kind":"name"}},"input":{"kind":"input","text":"1","value":{"kind":"literal","type":"Int"}}}},"input":{"kind":"call","fn":{"kind":"call","fn":{"kind":"input","text":"fnType","value":{"kind":"name"}},"input":{"kind":"lambda","paramName":"_","focus":true,"expr":{"kind":"input","text":"Int","value":{"kind":"name"}}}},"input":{"kind":"lambda","paramName":"_","focus":true,"expr":{"kind":"input","text":"Int","value":{"kind":"name"}}}}}}};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue