squiggle/packages/squiggle-lang/src/rescript/Reducer
Umur Ozkul 4fe72b8fb4 remove Reduce_Expression.rsi.
Too many changes. Hot target. Preventing development
2022-04-12 15:47:46 +02:00
..
Reducer_Dispatch variables and statements 2022-04-11 16:31:10 +02:00
Reducer_Expression remove Reduce_Expression.rsi. 2022-04-12 15:47:46 +02:00
Reducer_Extra format, rename, simplify 2022-03-29 11:09:59 +02:00
Reducer_Js format, rename, simplify 2022-03-29 11:09:59 +02:00
Reducer_MathJs variables and statements 2022-04-11 16:31:10 +02:00
README.md format, rename, simplify 2022-03-29 11:09:59 +02:00
Reducer_ErrorValue.res Merge branch 'develop' into reducer-dev 2022-04-12 15:46:48 +02:00
Reducer.res Change typescript interface to reducer 2022-04-11 13:16:31 +10:00
Reducer.resi Change typescript interface to reducer 2022-04-11 13:16:31 +10: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)"))