squiggle/packages/squiggle-lang/src/rescript/Reducer
Umur Ozkul d29b77ca61 fix #1007
variables that start with true/false
2022-08-25 22:19:29 +02:00
..
Reducer_Bindings simplified modules 2022-07-18 18:16:49 +02:00
Reducer_Dispatch switch replacement by type checking 2022-07-28 22:20:00 +02:00
Reducer_Expression Introduce void type 2022-07-20 17:01:42 +02:00
Reducer_Extra spell check 2022-07-16 17:09:39 +02:00
Reducer_Js PR comments 2022-06-24 12:15:38 +02:00
Reducer_MathJs PR comments 2022-06-24 12:15:38 +02:00
Reducer_Peggy fix #1007 2022-08-25 22:19:29 +02:00
Reducer_Type any type 2022-07-28 22:25:51 +02:00
README.md format, rename, simplify 2022-03-29 11:09:59 +02:00
Reducer_ErrorValue.res type check 2022-07-18 15:15:36 +02:00
Reducer_Exception.res basic type compiler 2022-07-16 16:13:39 +02:00
Reducer.res PR comments 2022-06-24 12:15:38 +02:00
Reducer.resi PR comments 2022-06-24 12:15:38 +02:00

To interface your library there only 2 files to be modified:

  • Reducer/ReducerInterface/ReducerInterface_ExpressionValue.res

    This is where your additional types are referred for the dispatcher.

  • Reducer/ReducerInterface/ReducerInterface_ExternalLibrary.res

    This is where dispatching to your library is done. If the dispatcher becomes beastly then feel free to divide it into submodules.

The Reducer is built to use different external libraries as well as different external parsers. Both external parsers and external libraries are plugins.

And finally try using Reducer.eval to how your extentions look:

  test("1+2", () => expectEvalToBe( "1+2", "Ok(3)"))