do not export private modules from Reducer module

This commit is contained in:
Umur Ozkul 2022-05-02 23:42:11 +02:00
parent e92fc792a2
commit 11d4a3bc8b
5 changed files with 8 additions and 15 deletions

View File

@ -1,5 +1,5 @@
open ReducerInterface.ExpressionValue
module MathJs = Reducer.MathJs
module MathJs = Reducer_MathJs
module ErrorValue = Reducer.ErrorValue
open Jest

View File

@ -1,4 +1,4 @@
module Parse = Reducer.MathJs.Parse
module Parse = Reducer_MathJs.Parse
module Result = Belt.Result
open Jest

View File

@ -65,8 +65,9 @@ describe("call and bindings", () => {
describe("function trics", () => {
testParseToBe(
"f(x)=f(y)=2; f(2)",
"Ok((:$$block (:$$block (:$let :f (:$$lambda [x] (:$$block (:$let :f (:$$lambda [y] (:$$block 2)))))) (:f 2))))")
testEvalToBe("f(x)=f(y)=2; f(2)","Ok({f: lambda(y=>internal code),x: 2})")
"Ok((:$$block (:$$block (:$let :f (:$$lambda [x] (:$$block (:$let :f (:$$lambda [y] (:$$block 2)))))) (:f 2))))",
)
testEvalToBe("f(x)=f(y)=2; f(2)", "Ok({f: lambda(y=>internal code),x: 2})")
testEvalToBe("y=2;g(x)=y+1;g(2)", "Ok(3)")
testEvalToBe("y=2;g(x)=inspect(y)+1", "Ok({g: lambda(x=>internal code),y: 2})")
})

View File

@ -1,9 +1,5 @@
module Dispatch = Reducer_Dispatch
module ErrorValue = Reducer_ErrorValue
module Expression = Reducer_Expression
module Extra = Reducer_Extra
module Js = Reducer_Js
module MathJs = Reducer_MathJs
type environment = ReducerInterface_ExpressionValue.environment
type errorValue = Reducer_ErrorValue.errorValue

View File

@ -1,9 +1,5 @@
module Dispatch = Reducer_Dispatch
module ErrorValue = Reducer_ErrorValue
module Expression = Reducer_Expression
module Extra = Reducer_Extra
module Js = Reducer_Js
module MathJs = Reducer_MathJs
@genType
type environment = ReducerInterface_ExpressionValue.environment