From e7a6769df0b96d176acc9408067385840d86958a Mon Sep 17 00:00:00 2001 From: Yura Lazarev Date: Fri, 12 Jun 2026 14:44:56 +0200 Subject: [PATCH 1/2] test: add runtime eval repros for issue #32 Three eval-golden modules exercising the symptoms reported in #32: - BugListGenericEq: the original repro from PR #33, extended with a main function so the generated Lua is actually executed (the PR only checked compilation and luacheck, which is why the runtime stack overflow went unnoticed). - DerivedFunctor: derived Functor instances mapped over an Either-like and a recursive Tree type. - GenericEqTwoTypes: two generic-derived Eq instances in one module. The duplication keeps the generic machinery multiply-used, so the inliner does not mask the eager self-reference in the instance dictionary: evaluation overflows the Lua stack until the optimizer stops eta-reducing user code. golden.ir/golden.lua files are intentionally not included: they are generated on first test run, and the fix in the next commit changes their shape anyway. --- .../golden/Golden/BugListGenericEq/Test.purs | 23 +++++++++++++ .../ps/golden/Golden/DerivedFunctor/Test.purs | 30 ++++++++++++++++ .../golden/Golden/GenericEqTwoTypes/Test.purs | 34 +++++++++++++++++++ .../Golden.BugListGenericEq.Test/corefn.json | 1 + .../eval/.gitignore | 1 + .../eval/golden.txt | 3 ++ .../Golden.DerivedFunctor.Test/corefn.json | 1 + .../eval/.gitignore | 1 + .../eval/golden.txt | 3 ++ .../Golden.GenericEqTwoTypes.Test/corefn.json | 1 + .../eval/.gitignore | 1 + .../eval/golden.txt | 4 +++ 12 files changed, 103 insertions(+) create mode 100644 test/ps/golden/Golden/BugListGenericEq/Test.purs create mode 100644 test/ps/golden/Golden/DerivedFunctor/Test.purs create mode 100644 test/ps/golden/Golden/GenericEqTwoTypes/Test.purs create mode 100644 test/ps/output/Golden.BugListGenericEq.Test/corefn.json create mode 100644 test/ps/output/Golden.BugListGenericEq.Test/eval/.gitignore create mode 100644 test/ps/output/Golden.BugListGenericEq.Test/eval/golden.txt create mode 100644 test/ps/output/Golden.DerivedFunctor.Test/corefn.json create mode 100644 test/ps/output/Golden.DerivedFunctor.Test/eval/.gitignore create mode 100644 test/ps/output/Golden.DerivedFunctor.Test/eval/golden.txt create mode 100644 test/ps/output/Golden.GenericEqTwoTypes.Test/corefn.json create mode 100644 test/ps/output/Golden.GenericEqTwoTypes.Test/eval/.gitignore create mode 100644 test/ps/output/Golden.GenericEqTwoTypes.Test/eval/golden.txt diff --git a/test/ps/golden/Golden/BugListGenericEq/Test.purs b/test/ps/golden/Golden/BugListGenericEq/Test.purs new file mode 100644 index 0000000..ea3e63e --- /dev/null +++ b/test/ps/golden/Golden/BugListGenericEq/Test.purs @@ -0,0 +1,23 @@ +module Golden.BugListGenericEq.Test where + +import Prelude +import Data.Eq.Generic as GEq +import Data.Generic.Rep as G +import Effect (Effect) +import Effect.Console (logShow) + +data List a = Nil | Cons { head :: a, tail :: List a } + +cons :: forall a. a -> List a -> List a +cons head tail = Cons { head, tail } + +derive instance genericList :: G.Generic (List a) _ + +instance eqList :: Eq a => Eq (List a) where + eq x y = GEq.genericEq x y + +main :: Effect Unit +main = do + logShow $ (Nil :: List Int) == Nil + logShow $ cons 1 (cons 2 Nil) == cons 1 (cons 2 Nil) + logShow $ cons 1 Nil == cons 2 Nil diff --git a/test/ps/golden/Golden/DerivedFunctor/Test.purs b/test/ps/golden/Golden/DerivedFunctor/Test.purs new file mode 100644 index 0000000..60a74ba --- /dev/null +++ b/test/ps/golden/Golden/DerivedFunctor/Test.purs @@ -0,0 +1,30 @@ +module Golden.DerivedFunctor.Test where + +import Prelude +import Effect (Effect) +import Effect.Console (logShow) + +data Either a b = Left a | Right b + +derive instance functorEither :: Functor (Either a) + +data Tree a = Leaf | Node (Tree a) a (Tree a) + +derive instance functorTree :: Functor Tree + +fromRight :: forall a. Int -> Either a Int -> Int +fromRight fallback = case _ of + Left _ -> fallback + Right n -> n + +sumTree :: Tree Int -> Int +sumTree = case _ of + Leaf -> 0 + Node l x r -> sumTree l + x + sumTree r + +main :: Effect Unit +main = do + logShow $ fromRight 0 $ map (_ + 1) (Right 41 :: Either String Int) + logShow $ fromRight 7 $ map (_ + 1) (Left "no" :: Either String Int) + logShow $ sumTree $ map (_ * 2) + $ Node (Node Leaf 1 Leaf) 2 (Node Leaf 3 Leaf) diff --git a/test/ps/golden/Golden/GenericEqTwoTypes/Test.purs b/test/ps/golden/Golden/GenericEqTwoTypes/Test.purs new file mode 100644 index 0000000..c0b0b65 --- /dev/null +++ b/test/ps/golden/Golden/GenericEqTwoTypes/Test.purs @@ -0,0 +1,34 @@ +module Golden.GenericEqTwoTypes.Test where + +import Prelude +import Data.Eq.Generic as GEq +import Data.Generic.Rep as G +import Effect (Effect) +import Effect.Console (logShow) + +data List a = Nil | Cons { head :: a, tail :: List a } + +cons :: forall a. a -> List a -> List a +cons head tail = Cons { head, tail } + +derive instance genericList :: G.Generic (List a) _ + +instance eqList :: Eq a => Eq (List a) where + eq x y = GEq.genericEq x y + +data Tree a = Leaf | Node { left :: Tree a, value :: a, right :: Tree a } + +node :: forall a. Tree a -> a -> Tree a -> Tree a +node left value right = Node { left, value, right } + +derive instance genericTree :: G.Generic (Tree a) _ + +instance eqTree :: Eq a => Eq (Tree a) where + eq x y = GEq.genericEq x y + +main :: Effect Unit +main = do + logShow $ cons 1 (cons 2 Nil) == cons 1 (cons 2 Nil) + logShow $ cons 1 Nil == cons 2 Nil + logShow $ node Leaf 1 (node Leaf 2 Leaf) == node Leaf 1 (node Leaf 2 Leaf) + logShow $ node Leaf 1 Leaf == node Leaf 2 Leaf diff --git a/test/ps/output/Golden.BugListGenericEq.Test/corefn.json b/test/ps/output/Golden.BugListGenericEq.Test/corefn.json new file mode 100644 index 0000000..3993cc7 --- /dev/null +++ b/test/ps/output/Golden.BugListGenericEq.Test/corefn.json @@ -0,0 +1 @@ +{"builtWith":"0.15.16","comments":[],"decls":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqSum","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqConstructor","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqNoArguments","moduleName":["Data","Eq","Generic"]}},"type":"App"},"type":"App"},"identifier":"genericEqSum"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRec","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"identifier":"eqRec"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowNil","moduleName":["Data","Eq"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"tail"}},"type":"Abs"}]]}},"type":"App"},"type":"App"},"identifier":"eqRowCons"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"head"}},"type":"Abs"}]]}},"type":"App"},"identifier":"headIsSymbol"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[21,37],"start":[21,3]}},"type":"Var","value":{"identifier":"discard","moduleName":["Control","Bind"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discardUnit","moduleName":["Control","Bind"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"bindEffect","moduleName":["Effect"]}},"type":"App"},"identifier":"discard"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[21,10],"start":[21,3]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Effect","Console"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[21,10],"start":[21,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"showBoolean","moduleName":["Data","Show"]}},"type":"App"},"identifier":"logShow"},{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"constructorName":"Nil","fieldNames":[],"type":"Constructor","typeName":"List"},"identifier":"Nil"},{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"constructorName":"Cons","fieldNames":["value0"],"type":"Constructor","typeName":"List"},"identifier":"Cons"},{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Generic$Dict","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["to",{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"NullBinder"}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[14,1]}},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}],["from",{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[],"constructorName":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]},"typeName":{"identifier":"List","moduleName":["Golden","BugListGenericEq","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":{"constructorType":"ProductType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"NoArguments","moduleName":["Data","Generic","Rep"]}},"type":"App"},"type":"App"},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Cons","moduleName":["Golden","BugListGenericEq","Test"]},"typeName":{"identifier":"List","moduleName":["Golden","BugListGenericEq","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[14,1]}},"type":"App"},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}]]}},"type":"App"},"identifier":"genericList"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[17,25],"start":[17,12]}},"type":"Var","value":{"identifier":"genericEq","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericList","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"identifier":"genericEq"},{"bindType":"Rec","binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"dictEq","body":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[17,29],"start":[16,1]}},"type":"Var","value":{"identifier":"Eq$Dict","moduleName":["Data","Eq"]}},"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["eq",{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"y","body":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEq","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqSum","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqConstructor","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqArgument","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRec","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqList","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"headIsSymbol","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,26]}},"type":"Var","value":{"identifier":"x","sourcePos":[17,3]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[17,28]}},"type":"Var","value":{"identifier":"y","sourcePos":[17,3]}},"type":"App"},"type":"Abs"},"type":"Abs"}]]}},"type":"App"},"type":"Abs"},"identifier":"eqList"}]},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[21,33],"start":[21,31]}},"type":"Var","value":{"identifier":"eq","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqList","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqInt","moduleName":["Data","Eq"]}},"type":"App"},"type":"App"},"identifier":"eq"},{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"argument":"head","body":{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"argument":"tail","body":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[12,22],"start":[12,18]}},"type":"Var","value":{"identifier":"Cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[12,37],"start":[12,18]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[12,37],"start":[12,23]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["head",{"annotation":{"meta":null,"sourceSpan":{"end":[12,29],"start":[12,25]}},"type":"Var","value":{"identifier":"head","sourcePos":[12,1]}}],["tail",{"annotation":{"meta":null,"sourceSpan":{"end":[12,35],"start":[12,31]}},"type":"Var","value":{"identifier":"tail","sourcePos":[12,1]}}]]}},"type":"App"},"type":"Abs"},"type":"Abs"},"identifier":"cons"},{"annotation":{"meta":null,"sourceSpan":{"end":[19,20],"start":[19,1]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[21,17],"start":[21,14]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[21,37],"start":[21,34]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[21,37],"start":[21,3]}},"argument":"$__unused","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[22,17],"start":[22,13]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,19],"start":[22,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,19],"start":[22,18]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,32],"start":[22,13]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[22,25],"start":[22,21]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,27],"start":[22,21]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,27],"start":[22,26]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,31],"start":[22,21]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[22,31],"start":[22,28]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[22,40],"start":[22,36]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,42],"start":[22,36]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,42],"start":[22,41]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,36]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[22,48],"start":[22,44]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,50],"start":[22,44]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,50],"start":[22,49]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,54],"start":[22,44]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[22,54],"start":[22,51]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,55],"start":[22,3]}},"argument":"$__unused","body":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[23,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[23,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[23,17],"start":[23,13]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,19],"start":[23,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[23,19],"start":[23,18]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[23,23],"start":[23,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[23,23],"start":[23,20]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[23,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[23,31],"start":[23,27]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","BugListGenericEq","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,33],"start":[23,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[23,33],"start":[23,32]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[23,27]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[23,37],"start":[23,34]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","BugListGenericEq","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"Abs"},"type":"App"},"type":"Abs"},"type":"App"},"identifier":"main"}],"exports":["Nil","Cons","cons","main","genericList","eqList"],"foreign":[],"imports":[{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Control","Bind"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Eq"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Eq","Generic"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Function"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Generic","Rep"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Show"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Data","Symbol"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Effect"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Effect","Console"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Golden","BugListGenericEq","Test"]},{"annotation":{"meta":null,"sourceSpan":{"end":[3,15],"start":[3,1]}},"moduleName":["Prelude"]},{"annotation":{"meta":null,"sourceSpan":{"end":[23,37],"start":[1,1]}},"moduleName":["Prim"]}],"moduleName":["Golden","BugListGenericEq","Test"],"modulePath":"golden/Golden/BugListGenericEq/Test.purs","reExports":{},"sourceSpan":{"end":[23,37],"start":[1,1]}} \ No newline at end of file diff --git a/test/ps/output/Golden.BugListGenericEq.Test/eval/.gitignore b/test/ps/output/Golden.BugListGenericEq.Test/eval/.gitignore new file mode 100644 index 0000000..d2dc29b --- /dev/null +++ b/test/ps/output/Golden.BugListGenericEq.Test/eval/.gitignore @@ -0,0 +1 @@ +actual.txt diff --git a/test/ps/output/Golden.BugListGenericEq.Test/eval/golden.txt b/test/ps/output/Golden.BugListGenericEq.Test/eval/golden.txt new file mode 100644 index 0000000..9e8a46a --- /dev/null +++ b/test/ps/output/Golden.BugListGenericEq.Test/eval/golden.txt @@ -0,0 +1,3 @@ +true +true +false diff --git a/test/ps/output/Golden.DerivedFunctor.Test/corefn.json b/test/ps/output/Golden.DerivedFunctor.Test/corefn.json new file mode 100644 index 0000000..6541159 --- /dev/null +++ b/test/ps/output/Golden.DerivedFunctor.Test/corefn.json @@ -0,0 +1 @@ +{"builtWith":"0.15.16","comments":[],"decls":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[23,32],"start":[23,31]}},"type":"Var","value":{"identifier":"add","moduleName":["Data","Semiring"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[23,42],"start":[23,17]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"semiringInt","moduleName":["Data","Semiring"]}},"type":"App"},"identifier":"add"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[27,70],"start":[27,3]}},"type":"Var","value":{"identifier":"discard","moduleName":["Control","Bind"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discardUnit","moduleName":["Control","Bind"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"bindEffect","moduleName":["Effect"]}},"type":"App"},"identifier":"discard"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[27,10],"start":[27,3]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Effect","Console"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,10],"start":[27,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"showInt","moduleName":["Data","Show"]}},"type":"App"},"identifier":"logShow"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[29,31],"start":[29,30]}},"type":"Var","value":{"identifier":"mul","moduleName":["Data","Semiring"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[29,34],"start":[29,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"semiringInt","moduleName":["Data","Semiring"]}},"type":"App"},"identifier":"mul"},{"annotation":{"meta":null,"sourceSpan":{"end":[11,46],"start":[11,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[11,46],"start":[11,1]}},"constructorName":"Leaf","fieldNames":[],"type":"Constructor","typeName":"Tree"},"identifier":"Leaf"},{"annotation":{"meta":null,"sourceSpan":{"end":[11,46],"start":[11,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[11,46],"start":[11,1]}},"constructorName":"Node","fieldNames":["value0","value1","value2"],"type":"Constructor","typeName":"Tree"},"identifier":"Node"},{"annotation":{"meta":null,"sourceSpan":{"end":[7,35],"start":[7,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[7,35],"start":[7,1]}},"constructorName":"Left","fieldNames":["value0"],"type":"Constructor","typeName":"Either"},"identifier":"Left"},{"annotation":{"meta":null,"sourceSpan":{"end":[7,35],"start":[7,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[7,35],"start":[7,1]}},"constructorName":"Right","fieldNames":["value0"],"type":"Constructor","typeName":"Either"},"identifier":"Right"},{"bindType":"Rec","binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[20,27],"start":[20,1]}},"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[21,11]}},"argument":"v","body":{"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[21,11]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[22,7],"start":[22,3]}},"binderType":"ConstructorBinder","binders":[],"constructorName":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[22,12],"start":[22,11]}},"type":"Literal","value":{"literalType":"IntLiteral","value":0}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[23,13],"start":[23,3]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[23,9],"start":[23,8]}},"binderType":"VarBinder","identifier":"l"},{"annotation":{"meta":null,"sourceSpan":{"end":[23,11],"start":[23,10]}},"binderType":"VarBinder","identifier":"x"},{"annotation":{"meta":null,"sourceSpan":{"end":[23,13],"start":[23,12]}},"binderType":"VarBinder","identifier":"r"}],"constructorName":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"add","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,17]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"add","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,17]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[23,24],"start":[23,17]}},"type":"Var","value":{"identifier":"sumTree","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,26],"start":[23,17]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[23,26],"start":[23,25]}},"type":"Var","value":{"identifier":"l","sourcePos":[23,8]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,17]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[23,30],"start":[23,29]}},"type":"Var","value":{"identifier":"x","sourcePos":[23,10]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,17]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[23,40],"start":[23,33]}},"type":"Var","value":{"identifier":"sumTree","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,33]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[23,42],"start":[23,41]}},"type":"Var","value":{"identifier":"r","sourcePos":[23,12]}},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"},"identifier":"sumTree"}]},{"bindType":"Rec","binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[13,44],"start":[13,1]}},"expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Functor$Dict","moduleName":["Data","Functor"]}},"annotation":{"meta":null,"sourceSpan":{"end":[13,44],"start":[13,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["map",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"f","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"m","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"ConstructorBinder","binders":[],"constructorName":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"VarBinder","identifier":"v"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"VarBinder","identifier":"v1"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"VarBinder","identifier":"v2"}],"constructorName":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"map","moduleName":["Data","Functor"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"functorTree","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"f","sourcePos":[0,0]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"f","sourcePos":[0,0]}},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v1","sourcePos":[0,0]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"map","moduleName":["Data","Functor"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"functorTree","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"f","sourcePos":[0,0]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v2","sourcePos":[0,0]}},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"m","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"},"type":"Abs"}]]}},"type":"App"},"identifier":"functorTree"}]},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[29,26],"start":[29,23]}},"type":"Var","value":{"identifier":"map","moduleName":["Data","Functor"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[29,34],"start":[29,23]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"functorTree","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"identifier":"map"},{"annotation":{"meta":null,"sourceSpan":{"end":[9,52],"start":[9,1]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Functor$Dict","moduleName":["Data","Functor"]}},"annotation":{"meta":null,"sourceSpan":{"end":[9,52],"start":[9,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["map",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"f","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"m","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"VarBinder","identifier":"v"}],"constructorName":{"identifier":"Left","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Either","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Left","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binderType":"VarBinder","identifier":"v"}],"constructorName":{"identifier":"Right","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Either","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"Right","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"f","sourcePos":[0,0]}},"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"m","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"},"type":"Abs"}]]}},"type":"App"},"identifier":"functorEither"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[27,30],"start":[27,27]}},"type":"Var","value":{"identifier":"map","moduleName":["Data","Functor"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,38],"start":[27,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"functorEither","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"identifier":"map1"},{"annotation":{"meta":null,"sourceSpan":{"end":[15,50],"start":[15,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[15,50],"start":[15,1]}},"argument":"fallback","body":{"annotation":{"meta":null,"sourceSpan":{"end":[18,15],"start":[16,22]}},"argument":"v","body":{"annotation":{"meta":null,"sourceSpan":{"end":[18,15],"start":[16,22]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[17,9],"start":[17,3]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[17,9],"start":[17,8]}},"binderType":"NullBinder"}],"constructorName":{"identifier":"Left","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Either","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[17,21],"start":[17,13]}},"type":"Var","value":{"identifier":"fallback","sourcePos":[16,1]}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[18,10],"start":[18,3]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[18,10],"start":[18,9]}},"binderType":"VarBinder","identifier":"n"}],"constructorName":{"identifier":"Right","moduleName":["Golden","DerivedFunctor","Test"]},"typeName":{"identifier":"Either","moduleName":["Golden","DerivedFunctor","Test"]}}],"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[18,15],"start":[18,14]}},"type":"Var","value":{"identifier":"n","sourcePos":[18,9]}},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"},"type":"Abs"},"identifier":"fromRight"},{"annotation":{"meta":null,"sourceSpan":{"end":[25,20],"start":[25,1]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[27,22],"start":[27,13]}},"type":"Var","value":{"identifier":"fromRight","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,24],"start":[27,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,24],"start":[27,23]}},"type":"Literal","value":{"literalType":"IntLiteral","value":0}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"map1","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,38],"start":[27,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,38],"start":[27,31]}},"argument":"v","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"add","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,38],"start":[27,31]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,38],"start":[27,31]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,37],"start":[27,36]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"type":"Abs"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,27]}},"argument":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[27,45],"start":[27,40]}},"type":"Var","value":{"identifier":"Right","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,48],"start":[27,40]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,48],"start":[27,46]}},"type":"Literal","value":{"literalType":"IntLiteral","value":41}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,70],"start":[27,3]}},"argument":"$__unused","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[28,22],"start":[28,13]}},"type":"Var","value":{"identifier":"fromRight","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,24],"start":[28,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[28,24],"start":[28,23]}},"type":"Literal","value":{"literalType":"IntLiteral","value":7}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"map1","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,38],"start":[28,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[28,38],"start":[28,31]}},"argument":"v","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"add","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,38],"start":[28,31]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[28,38],"start":[28,31]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[28,37],"start":[28,36]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"type":"Abs"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,27]}},"argument":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[28,44],"start":[28,40]}},"type":"Var","value":{"identifier":"Left","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[28,49],"start":[28,40]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[28,49],"start":[28,45]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"no"}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[28,71],"start":[28,3]}},"argument":"$__unused","body":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[29,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[29,20],"start":[29,13]}},"type":"Var","value":{"identifier":"sumTree","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[29,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"map","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[29,34],"start":[29,23]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[29,34],"start":[29,27]}},"argument":"v","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"mul","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[29,34],"start":[29,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"v","sourcePos":[0,0]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[29,34],"start":[29,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[29,33],"start":[29,32]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"type":"Abs"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[29,3]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,11],"start":[30,7]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[30,30],"start":[30,7]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,17],"start":[30,13]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[30,22],"start":[30,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,22],"start":[30,18]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,24],"start":[30,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[30,24],"start":[30,23]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,29],"start":[30,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,29],"start":[30,25]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,32],"start":[30,7]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[30,32],"start":[30,31]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[30,7]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0","value1","value2"],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,38],"start":[30,34]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","DerivedFunctor","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[30,43],"start":[30,34]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,43],"start":[30,39]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,45],"start":[30,34]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[30,45],"start":[30,44]}},"type":"Literal","value":{"literalType":"IntLiteral","value":3}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[30,50],"start":[30,34]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[30,50],"start":[30,46]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","DerivedFunctor","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"Abs"},"type":"App"},"type":"Abs"},"type":"App"},"identifier":"main"}],"exports":["Left","Right","Leaf","Node","fromRight","sumTree","main","functorEither","functorTree"],"foreign":[],"imports":[{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Control","Bind"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Data","Function"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Data","Functor"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Data","Semiring"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Data","Show"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Effect"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Effect","Console"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Golden","DerivedFunctor","Test"]},{"annotation":{"meta":null,"sourceSpan":{"end":[3,15],"start":[3,1]}},"moduleName":["Prelude"]},{"annotation":{"meta":null,"sourceSpan":{"end":[30,51],"start":[1,1]}},"moduleName":["Prim"]}],"moduleName":["Golden","DerivedFunctor","Test"],"modulePath":"golden/Golden/DerivedFunctor/Test.purs","reExports":{},"sourceSpan":{"end":[30,51],"start":[1,1]}} \ No newline at end of file diff --git a/test/ps/output/Golden.DerivedFunctor.Test/eval/.gitignore b/test/ps/output/Golden.DerivedFunctor.Test/eval/.gitignore new file mode 100644 index 0000000..d2dc29b --- /dev/null +++ b/test/ps/output/Golden.DerivedFunctor.Test/eval/.gitignore @@ -0,0 +1 @@ +actual.txt diff --git a/test/ps/output/Golden.DerivedFunctor.Test/eval/golden.txt b/test/ps/output/Golden.DerivedFunctor.Test/eval/golden.txt new file mode 100644 index 0000000..c23e48a --- /dev/null +++ b/test/ps/output/Golden.DerivedFunctor.Test/eval/golden.txt @@ -0,0 +1,3 @@ +42 +7 +12 diff --git a/test/ps/output/Golden.GenericEqTwoTypes.Test/corefn.json b/test/ps/output/Golden.GenericEqTwoTypes.Test/corefn.json new file mode 100644 index 0000000..05a7272 --- /dev/null +++ b/test/ps/output/Golden.GenericEqTwoTypes.Test/corefn.json @@ -0,0 +1 @@ +{"builtWith":"0.15.16","comments":[],"decls":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqSum","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqConstructor","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqNoArguments","moduleName":["Data","Eq","Generic"]}},"type":"App"},"type":"App"},"identifier":"genericEqSum"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRec","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"identifier":"eqRec"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowNil","moduleName":["Data","Eq"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"identifier":"eqRowCons"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"value"}},"type":"Abs"}]]}},"type":"App"},"type":"App"},"identifier":"eqRowCons1"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"right"}},"type":"Abs"}]]}},"type":"App"},"identifier":"rightIsSymbol"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"left"}},"type":"Abs"}]]}},"type":"App"},"identifier":"leftIsSymbol"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"tail"}},"type":"Abs"}]]}},"type":"App"},"type":"App"},"identifier":"eqRowCons2"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"IsSymbol$Dict","moduleName":["Data","Symbol"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["reflectSymbol",{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"argument":"$__unused","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Literal","value":{"literalType":"StringLiteral","value":"head"}},"type":"Abs"}]]}},"type":"App"},"identifier":"headIsSymbol"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[31,55],"start":[31,3]}},"type":"Var","value":{"identifier":"discard","moduleName":["Control","Bind"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discardUnit","moduleName":["Control","Bind"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"bindEffect","moduleName":["Effect"]}},"type":"App"},"identifier":"discard"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[31,10],"start":[31,3]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Effect","Console"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[31,10],"start":[31,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"showBoolean","moduleName":["Data","Show"]}},"type":"App"},"identifier":"logShow"},{"annotation":{"meta":null,"sourceSpan":{"end":[19,74],"start":[19,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[19,74],"start":[19,1]}},"constructorName":"Leaf","fieldNames":[],"type":"Constructor","typeName":"Tree"},"identifier":"Leaf"},{"annotation":{"meta":null,"sourceSpan":{"end":[19,74],"start":[19,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[19,74],"start":[19,1]}},"constructorName":"Node","fieldNames":["value0"],"type":"Constructor","typeName":"Tree"},"identifier":"Node"},{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"constructorName":"Nil","fieldNames":[],"type":"Constructor","typeName":"List"},"identifier":"Nil"},{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[9,55],"start":[9,1]}},"constructorName":"Cons","fieldNames":["value0"],"type":"Constructor","typeName":"List"},"identifier":"Cons"},{"annotation":{"meta":null,"sourceSpan":{"end":[21,50],"start":[21,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[21,50],"start":[21,1]}},"argument":"left","body":{"annotation":{"meta":null,"sourceSpan":{"end":[21,50],"start":[21,1]}},"argument":"value","body":{"annotation":{"meta":null,"sourceSpan":{"end":[21,50],"start":[21,1]}},"argument":"right","body":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[22,29],"start":[22,25]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[22,52],"start":[22,25]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[22,52],"start":[22,30]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["left",{"annotation":{"meta":null,"sourceSpan":{"end":[22,36],"start":[22,32]}},"type":"Var","value":{"identifier":"left","sourcePos":[22,1]}}],["value",{"annotation":{"meta":null,"sourceSpan":{"end":[22,43],"start":[22,38]}},"type":"Var","value":{"identifier":"value","sourcePos":[22,1]}}],["right",{"annotation":{"meta":null,"sourceSpan":{"end":[22,50],"start":[22,45]}},"type":"Var","value":{"identifier":"right","sourcePos":[22,1]}}]]}},"type":"App"},"type":"Abs"},"type":"Abs"},"type":"Abs"},"identifier":"node"},{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Generic$Dict","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["to",{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"NullBinder"}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[24,1]}},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}],["from",{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[],"constructorName":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","GenericEqTwoTypes","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"annotation":{"meta":{"constructorType":"ProductType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"NoArguments","moduleName":["Data","Generic","Rep"]}},"type":"App"},"type":"App"},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Node","moduleName":["Golden","GenericEqTwoTypes","Test"]},"typeName":{"identifier":"Tree","moduleName":["Golden","GenericEqTwoTypes","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[24,52],"start":[24,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[24,1]}},"type":"App"},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}]]}},"type":"App"},"identifier":"genericTree"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[27,25],"start":[27,12]}},"type":"Var","value":{"identifier":"genericEq","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericTree","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"identifier":"genericEq"},{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Generic$Dict","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["to",{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"NullBinder"}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}}],"constructorName":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]},"typeName":{"identifier":"Sum","moduleName":["Data","Generic","Rep"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[14,1]}},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}],["from",{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"caseAlternatives":[{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[],"constructorName":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]},"typeName":{"identifier":"List","moduleName":["Golden","GenericEqTwoTypes","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Inl","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":{"constructorType":"ProductType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"NoArguments","moduleName":["Data","Generic","Rep"]}},"type":"App"},"type":"App"},"isGuarded":false},{"binders":[{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"ConstructorBinder","binders":[{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"binderType":"VarBinder","identifier":"arg"}],"constructorName":{"identifier":"Cons","moduleName":["Golden","GenericEqTwoTypes","Test"]},"typeName":{"identifier":"List","moduleName":["Golden","GenericEqTwoTypes","Test"]}}],"expression":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Inr","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Constructor","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"Argument","moduleName":["Data","Generic","Rep"]}},"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[14,52],"start":[14,1]}},"type":"Var","value":{"identifier":"arg","sourcePos":[14,1]}},"type":"App"},"type":"App"},"type":"App"},"isGuarded":false}],"caseExpressions":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"x","sourcePos":[0,0]}}],"type":"Case"},"type":"Abs"}]]}},"type":"App"},"identifier":"genericList"},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[17,25],"start":[17,12]}},"type":"Var","value":{"identifier":"genericEq","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericList","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"identifier":"genericEq1"},{"bindType":"Rec","binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"argument":"dictEq","body":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons1","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"rightIsSymbol","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"identifier":"eqRowCons3"}],"expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[27,29],"start":[26,1]}},"type":"Var","value":{"identifier":"Eq$Dict","moduleName":["Data","Eq"]}},"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["eq",{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[26,1]}},"argument":"y","body":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEq","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqSum","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqConstructor","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqArgument","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRec","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons3","sourcePos":[0,0]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqTree","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"leftIsSymbol","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqTree","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,27],"start":[27,26]}},"type":"Var","value":{"identifier":"x","sourcePos":[27,3]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[27,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[27,29],"start":[27,28]}},"type":"Var","value":{"identifier":"y","sourcePos":[27,3]}},"type":"App"},"type":"Abs"},"type":"Abs"}]]}},"type":"App"},"type":"Let"},"type":"Abs"},"identifier":"eqTree"}]},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[33,46],"start":[33,44]}},"type":"Var","value":{"identifier":"eq","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqTree","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqInt","moduleName":["Data","Eq"]}},"type":"App"},"type":"App"},"identifier":"eq"},{"bindType":"Rec","binds":[{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"expression":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"dictEq","body":{"abstraction":{"annotation":{"meta":{"metaType":"IsNewtype"},"sourceSpan":{"end":[17,29],"start":[16,1]}},"type":"Var","value":{"identifier":"Eq$Dict","moduleName":["Data","Eq"]}},"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["eq",{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"x","body":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[16,1]}},"argument":"y","body":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEq1","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqSum","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqConstructor","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"genericEqArgument","moduleName":["Data","Eq","Generic"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRec","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqRowCons2","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqList","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"type":"Var","value":{"identifier":"undefined","moduleName":["Prim"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"headIsSymbol","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"dictEq","sourcePos":[0,0]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,27],"start":[17,26]}},"type":"Var","value":{"identifier":"x","sourcePos":[17,3]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[17,12]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[17,29],"start":[17,28]}},"type":"Var","value":{"identifier":"y","sourcePos":[17,3]}},"type":"App"},"type":"Abs"},"type":"Abs"}]]}},"type":"App"},"type":"Abs"},"identifier":"eqList"}]},{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"bindType":"NonRec","expression":{"abstraction":{"annotation":{"meta":{"metaType":"IsForeign"},"sourceSpan":{"end":[31,35],"start":[31,33]}},"type":"Var","value":{"identifier":"eq","moduleName":["Data","Eq"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqList","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":{"metaType":"IsSyntheticApp"},"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eqInt","moduleName":["Data","Eq"]}},"type":"App"},"type":"App"},"identifier":"eq1"},{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"bindType":"NonRec","expression":{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"argument":"head","body":{"annotation":{"meta":null,"sourceSpan":{"end":[11,40],"start":[11,1]}},"argument":"tail","body":{"abstraction":{"annotation":{"meta":{"constructorType":"SumType","identifiers":["value0"],"metaType":"IsConstructor"},"sourceSpan":{"end":[12,22],"start":[12,18]}},"type":"Var","value":{"identifier":"Cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[12,37],"start":[12,18]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[12,37],"start":[12,23]}},"type":"Literal","value":{"literalType":"ObjectLiteral","value":[["head",{"annotation":{"meta":null,"sourceSpan":{"end":[12,29],"start":[12,25]}},"type":"Var","value":{"identifier":"head","sourcePos":[12,1]}}],["tail",{"annotation":{"meta":null,"sourceSpan":{"end":[12,35],"start":[12,31]}},"type":"Var","value":{"identifier":"tail","sourcePos":[12,1]}}]]}},"type":"App"},"type":"Abs"},"type":"Abs"},"identifier":"cons"},{"annotation":{"meta":null,"sourceSpan":{"end":[29,20],"start":[29,1]}},"bindType":"NonRec","expression":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq1","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[31,17],"start":[31,13]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,19],"start":[31,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[31,19],"start":[31,18]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,32],"start":[31,13]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[31,25],"start":[31,21]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,27],"start":[31,21]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[31,27],"start":[31,26]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,31],"start":[31,21]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[31,31],"start":[31,28]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[31,40],"start":[31,36]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,42],"start":[31,36]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[31,42],"start":[31,41]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,36]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[31,48],"start":[31,44]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[31,50],"start":[31,44]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[31,50],"start":[31,49]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,54],"start":[31,44]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[31,54],"start":[31,51]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[31,55],"start":[31,3]}},"argument":"$__unused","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq1","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[32,17],"start":[32,13]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[32,19],"start":[32,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[32,19],"start":[32,18]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[32,23],"start":[32,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[32,23],"start":[32,20]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[32,31],"start":[32,27]}},"type":"Var","value":{"identifier":"cons","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[32,33],"start":[32,27]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[32,33],"start":[32,32]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,27]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[32,37],"start":[32,34]}},"type":"Var","value":{"identifier":"Nil","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[32,37],"start":[32,3]}},"argument":"$__unused","body":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"discard","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[33,17],"start":[33,13]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,22],"start":[33,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,22],"start":[33,18]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,24],"start":[33,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[33,24],"start":[33,23]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,43],"start":[33,13]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[33,30],"start":[33,26]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,35],"start":[33,26]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,35],"start":[33,31]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,37],"start":[33,26]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[33,37],"start":[33,36]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,42],"start":[33,26]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,42],"start":[33,38]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[33,51],"start":[33,47]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,56],"start":[33,47]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,56],"start":[33,52]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,58],"start":[33,47]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[33,58],"start":[33,57]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,47]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[33,64],"start":[33,60]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[33,69],"start":[33,60]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,69],"start":[33,65]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,71],"start":[33,60]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[33,71],"start":[33,70]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,76],"start":[33,60]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[33,76],"start":[33,72]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[33,77],"start":[33,3]}},"argument":"$__unused","body":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"logShow","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[34,3]}},"argument":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[0,0],"start":[0,0]}},"type":"Var","value":{"identifier":"eq","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[34,3]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[34,17],"start":[34,13]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[34,22],"start":[34,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[34,22],"start":[34,18]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[34,24],"start":[34,13]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[34,24],"start":[34,23]}},"type":"Literal","value":{"literalType":"IntLiteral","value":1}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[34,29],"start":[34,13]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[34,29],"start":[34,25]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[34,3]}},"argument":{"abstraction":{"abstraction":{"abstraction":{"annotation":{"meta":null,"sourceSpan":{"end":[34,37],"start":[34,33]}},"type":"Var","value":{"identifier":"node","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"annotation":{"meta":null,"sourceSpan":{"end":[34,42],"start":[34,33]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[34,42],"start":[34,38]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[34,44],"start":[34,33]}},"argument":{"annotation":{"meta":null,"sourceSpan":{"end":[34,44],"start":[34,43]}},"type":"Literal","value":{"literalType":"IntLiteral","value":2}},"type":"App"},"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[34,33]}},"argument":{"annotation":{"meta":{"constructorType":"SumType","identifiers":[],"metaType":"IsConstructor"},"sourceSpan":{"end":[34,49],"start":[34,45]}},"type":"Var","value":{"identifier":"Leaf","moduleName":["Golden","GenericEqTwoTypes","Test"]}},"type":"App"},"type":"App"},"type":"App"},"type":"Abs"},"type":"App"},"type":"Abs"},"type":"App"},"type":"Abs"},"type":"App"},"identifier":"main"}],"exports":["Nil","Cons","cons","Leaf","Node","node","main","genericList","eqList","genericTree","eqTree"],"foreign":[],"imports":[{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Control","Bind"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Eq"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Eq","Generic"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Function"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Generic","Rep"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Show"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Data","Symbol"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Effect"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Effect","Console"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Golden","GenericEqTwoTypes","Test"]},{"annotation":{"meta":null,"sourceSpan":{"end":[3,15],"start":[3,1]}},"moduleName":["Prelude"]},{"annotation":{"meta":null,"sourceSpan":{"end":[34,49],"start":[1,1]}},"moduleName":["Prim"]}],"moduleName":["Golden","GenericEqTwoTypes","Test"],"modulePath":"golden/Golden/GenericEqTwoTypes/Test.purs","reExports":{},"sourceSpan":{"end":[34,49],"start":[1,1]}} \ No newline at end of file diff --git a/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/.gitignore b/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/.gitignore new file mode 100644 index 0000000..d2dc29b --- /dev/null +++ b/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/.gitignore @@ -0,0 +1 @@ +actual.txt diff --git a/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/golden.txt b/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/golden.txt new file mode 100644 index 0000000..2cdda45 --- /dev/null +++ b/test/ps/output/Golden.GenericEqTwoTypes.Test/eval/golden.txt @@ -0,0 +1,4 @@ +true +false +true +false From 718cef8753ec91a0b6aaf1cb3f6582827527e7d6 Mon Sep 17 00:00:00 2001 From: Yura Lazarev Date: Fri, 12 Jun 2026 14:45:14 +0200 Subject: [PATCH 2/2] fix: remove unsound eta reduction (closes #32) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a strict language, rewriting (λx. M x) to M moves the evaluation of M from every call of the lambda to the point where the lambda was constructed. When M transitively references the binding being defined, as it does in instance dictionaries deriving Eq via Generic for recursive data types, the eagerly evaluated self-reference recurses without a base case and overflows the Lua stack at dictionary construction time. Eta-expanding the method by hand is the documented PureScript idiom for breaking exactly this cycle, and the upstream JS backend preserves it; pslua's optimizer destroyed it. The rule is removed rather than restricted: every shape of M worth reducing is unsafe in its own way. Details are in the new Note [Eta reduction is unsound]. Removing eta reduction surfaced a latent gap in renameShadowedNames: it only processed uberModuleExports, leaving shadowed locals in uberModuleBindings unrenamed. Previously eta reduction happened to collapse the offending nested lambdas; without it, luacheck flags the shadowing, and a shadowed reference with a non-zero index inside a binding would crash the Lua code generator with UnexpectedRefBound. The renaming pass now covers bindings as well. Golden files change shape only: lambdas that used to be eta-reduced are now preserved. All eval goldens, including the new repros, pass. --- .../PureScript/Backend/IR/Optimizer.hs | 57 +- .../PureScript/Backend/IR/Optimizer/Spec.hs | 11 + .../output/Golden.ArrayOfUnits.Test/golden.ir | 192 ++- .../Golden.ArrayOfUnits.Test/golden.lua | 20 +- test/ps/output/Golden.Beta.Test/golden.ir | 4 +- test/ps/output/Golden.Beta.Test/golden.lua | 2 +- .../Golden.BugListGenericEq.Test/golden.ir | 1067 ++++++++++++ .../Golden.BugListGenericEq.Test/golden.lua | 255 +++ test/ps/output/Golden.Currying.Test/golden.ir | 8 +- .../ps/output/Golden.Currying.Test/golden.lua | 2 +- .../Golden.DerivedFunctor.Test/golden.ir | 783 +++++++++ .../Golden.DerivedFunctor.Test/golden.lua | 186 ++ .../Golden.GenericEqTwoTypes.Test/golden.ir | 1531 +++++++++++++++++ .../Golden.GenericEqTwoTypes.Test/golden.lua | 326 ++++ .../output/Golden.HelloPrelude.Test/golden.ir | 45 +- .../Golden.HelloPrelude.Test/golden.lua | 4 +- test/ps/output/Golden.Issue37.Test/golden.ir | 53 +- test/ps/output/Golden.Issue37.Test/golden.lua | 8 +- .../Golden.NameShadowing.Test/golden.ir | 4 +- .../Golden.NameShadowing.Test/golden.lua | 4 +- .../Golden.RecursiveBindings.Test/golden.ir | 8 +- .../Golden.RecursiveBindings.Test/golden.lua | 2 +- 22 files changed, 4426 insertions(+), 146 deletions(-) create mode 100644 test/ps/output/Golden.BugListGenericEq.Test/golden.ir create mode 100644 test/ps/output/Golden.BugListGenericEq.Test/golden.lua create mode 100644 test/ps/output/Golden.DerivedFunctor.Test/golden.ir create mode 100644 test/ps/output/Golden.DerivedFunctor.Test/golden.lua create mode 100644 test/ps/output/Golden.GenericEqTwoTypes.Test/golden.ir create mode 100644 test/ps/output/Golden.GenericEqTwoTypes.Test/golden.lua diff --git a/lib/Language/PureScript/Backend/IR/Optimizer.hs b/lib/Language/PureScript/Backend/IR/Optimizer.hs index 905ad74..cce95af 100644 --- a/lib/Language/PureScript/Backend/IR/Optimizer.hs +++ b/lib/Language/PureScript/Backend/IR/Optimizer.hs @@ -80,7 +80,10 @@ Two consequences: renameShadowedNames ∷ UberModule → UberModule renameShadowedNames uberModule = uberModule - { uberModuleExports = + { uberModuleBindings = + fmap (renameShadowedNamesInExpr mempty) + <<$>> uberModuleBindings uberModule + , uberModuleExports = renameShadowedNamesInExpr mempty <<$>> uberModuleExports uberModule } @@ -265,10 +268,10 @@ substituteInExports qname inlinee = map \case optimizedExpression ∷ Exp → Exp optimizedExpression = + -- See Note [Eta reduction is unsound] rewriteExpTopDown $ constantFolding `thenRewrite` betaReduce - `thenRewrite` etaReduce `thenRewrite` betaReduceUnusedParams `thenRewrite` removeUnreachableThenBranch `thenRewrite` removeUnreachableElseBranch @@ -301,14 +304,48 @@ betaReduce = Rewritten Recurse $ substitute (Local param) 0 r body _ → NoChange --- (λx. M x) where x not free in M ===> M -etaReduce ∷ RewriteRule Ann -etaReduce = - pure . \case - Abs _ (ParamNamed _ param) (App _ m (Ref _ (Local param') 0)) - | param == param' && countFreeRef (Local param) m == 0 → - Rewritten Recurse m - _ → NoChange +{- Note [Eta reduction is unsound] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The optimizer used to rewrite (λx. M x) to M whenever x was not free +in M. In a strict language this is not semantics-preserving: it moves +the evaluation of M from every call of the lambda to the point where +the lambda itself was constructed. + +That breaks self-referential instance dictionaries (issue #32). For + + data Tree a = Leaf | Node { left ∷ Tree a, value ∷ a, right ∷ Tree a } + derive instance genericTree ∷ Generic (Tree a) _ + instance eqTree ∷ Eq a ⇒ Eq (Tree a) where + eq x y = genericEq x y + +the method is deliberately eta-expanded by the user: the dictionary +chain built by genericEq contains `eqTree dictEq` — a self-reference — +and hiding it under λx λy is the documented PureScript way to break +the cycle (upstream purs relies on it too: its JS output keeps the +chain under the lambdas). Eta reduction rewrote the method to a bare +application chain + + eqTree = \dictEq → { eq = genericEq genericTree (… eqTree dictEq …) } + +which recurses at dictionary-construction time: calling `eqTree d` +evaluates `eqTree d` eagerly and overflows the stack before any +comparison happens. Golden/GenericEqTwoTypes is the regression test +(two generic types, so the chain is multiply-used and the inliner +cannot mask the problem by inlining it under another lambda). + +Reducing only special cases of M does not help either: + + * M is an application — may diverge (the case above); + * M is a reference — a recursive-group member `f = λx. g x` + becomes the value binding `f = g`, but the laziness analysis + (CoreFn.Laziness.applyLazinessTransform) already ran on CoreFn + and never saw it, so nothing wraps it in runtime-lazy and `g` + may still be uninitialized when `f` is assigned; + * M is an abstraction — the redex (λy. K) x is already handled by + betaReduce, so nothing is left to gain. + +Hence no eta reduction is performed at all. +-} betaReduceUnusedParams ∷ RewriteRule Ann betaReduceUnusedParams = diff --git a/test/Language/PureScript/Backend/IR/Optimizer/Spec.hs b/test/Language/PureScript/Backend/IR/Optimizer/Spec.hs index 3f6a47a..bb98952 100644 --- a/test/Language/PureScript/Backend/IR/Optimizer/Spec.hs +++ b/test/Language/PureScript/Backend/IR/Optimizer/Spec.hs @@ -65,6 +65,17 @@ spec = describe "IR Optimizer" do let f = abstraction paramUnused body body === optimizedExpression (application f arg) + -- See Note [Eta reduction is unsound] + test "does not eta-reduce λx. M x to M" do + param ← forAll Gen.name + let dict = moduleNameFromString "Dict" + m = + application + (refImported dict (Name "eqList") 0) + (refImported dict (Name "eqInt") 0) + original = abstraction (paramNamed param) (application m (refLocal0 param)) + optimizedExpression original === original + describe "inlines expressions" do test "inlines literals" do name ← forAll Gen.name diff --git a/test/ps/output/Golden.ArrayOfUnits.Test/golden.ir b/test/ps/output/Golden.ArrayOfUnits.Test/golden.ir index 52e2626..7d484a1 100644 --- a/test/ps/output/Golden.ArrayOfUnits.Test/golden.ir +++ b/test/ps/output/Golden.ArrayOfUnits.Test/golden.ir @@ -113,22 +113,28 @@ UberModule ) ( Abs Nothing ( ParamNamed Nothing ( Name "x" ) ) - ( App Nothing - ( ObjectProp Nothing + ( Abs Nothing + ( ParamNamed Nothing ( Name "acc" ) ) + ( App Nothing ( App Nothing ( ObjectProp Nothing - ( Ref Nothing ( Local ( Name "dictMonoid" ) ) 0 ) - ( PropName "Semigroup0" ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "dictMonoid" ) ) 0 ) + ( PropName "Semigroup0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( PropName "append" ) ) - ( Ref Nothing - ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ( App Nothing + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) ) - ( PropName "append" ) - ) - ( App Nothing - ( Ref Nothing ( Local ( Name "f" ) ) 0 ) - ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( Ref Nothing ( Local ( Name "acc" ) ) 0 ) ) ) ) @@ -205,31 +211,42 @@ UberModule [ ( PropName "map", Abs Nothing ( ParamNamed Nothing ( Name "f" ) ) - ( App Nothing + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) ( App Nothing - ( Ref Nothing - ( Imported ( ModuleName "Control.Apply" ) ( Name "apply" ) ) 0 - ) ( App Nothing - ( ObjectProp Nothing + ( App Nothing ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( Imported ( ModuleName "Control.Apply" ) ( Name "apply" ) ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) ) - ( PropName "Apply0" ) - ) - ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) - ) - ) - ( App Nothing - ( App Nothing - ( Ref Nothing - ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 ) - ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) ) ) - ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) ) ) ) @@ -375,8 +392,14 @@ UberModule ( ObjectProp Nothing ( LiteralObject Nothing [ - ( PropName "discard", Ref Nothing - ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ( PropName "discard", Abs Nothing + ( ParamNamed Nothing ( Name "dictBind" ) ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictBind" ) ) 0 ) + ) ) ] ) @@ -406,76 +429,85 @@ UberModule ) ( Abs Nothing ( ParamNamed Nothing ( Name "a" ) ) - ( App Nothing + ( Abs Nothing + ( ParamNamed Nothing ( Name "b" ) ) ( App Nothing - ( Ref Nothing - ( Imported ( ModuleName "Control.Apply" ) ( Name "apply" ) ) 0 - ) ( App Nothing - ( ObjectProp Nothing + ( App Nothing ( Ref Nothing - ( Imported - ( ModuleName "Effect" ) - ( Name "applicativeEffect" ) - ) 0 + ( Imported ( ModuleName "Control.Apply" ) ( Name "apply" ) ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) ) - ( PropName "Apply0" ) - ) - ( Ref Nothing - ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) - ) - ) - ( App Nothing - ( App Nothing - ( ObjectProp Nothing + ( App Nothing ( App Nothing ( ObjectProp Nothing ( App Nothing ( ObjectProp Nothing - ( Ref Nothing - ( Imported - ( ModuleName "Effect" ) - ( Name "applicativeEffect" ) - ) 0 + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Prim" ) + ( Name "undefined" ) + ) 0 + ) ) - ( PropName "Apply0" ) + ( PropName "Functor0" ) ) ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) ) - ( PropName "Functor0" ) + ( PropName "map" ) ) - ( Ref Nothing - ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 - ) - ) - ( PropName "map" ) - ) - ( Abs Nothing ( ParamUnused Nothing ) - ( ObjectProp Nothing - ( LiteralObject Nothing - [ - ( PropName "identity", Abs Nothing - ( ParamNamed Nothing ( Name "x" ) ) - ( Ref Nothing ( Local ( Name "x" ) ) 0 ) - ), - ( PropName "Semigroupoid0", Abs Nothing ( ParamUnused Nothing ) - ( Ref Nothing - ( Imported - ( ModuleName "Control.Semigroupoid" ) - ( Name "semigroupoidFn" ) - ) 0 - ) + ( Abs Nothing ( ParamUnused Nothing ) + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "identity", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ), + ( PropName "Semigroupoid0", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing + ( Imported + ( ModuleName "Control.Semigroupoid" ) + ( Name "semigroupoidFn" ) + ) 0 + ) + ) + ] ) - ] + ( PropName "identity" ) + ) ) - ( PropName "identity" ) ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) ) ) - ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ( Ref Nothing ( Local ( Name "b" ) ) 0 ) ) ) ) diff --git a/test/ps/output/Golden.ArrayOfUnits.Test/golden.lua b/test/ps/output/Golden.ArrayOfUnits.Test/golden.lua index b02e938..8bf2834 100644 --- a/test/ps/output/Golden.ArrayOfUnits.Test/golden.lua +++ b/test/ps/output/Golden.ArrayOfUnits.Test/golden.lua @@ -81,7 +81,9 @@ M.Data_Foldable_foldableArray = { foldMap = function(dictMonoid) return function(f) return M.Data_Foldable_foldr(M.Data_Foldable_foldableArray)(function(x) - return (dictMonoid.Semigroup0()).append(f(x)) + return function(acc) + return (dictMonoid.Semigroup0()).append(f(x))(acc) + end end)(dictMonoid.mempty) end end @@ -101,7 +103,9 @@ M.Effect_applicativeEffect = { M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() return { map = function(f) - return M.Control_Apply_apply(M.Effect_applicativeEffect.Apply0())(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f)) + return function(a) + return M.Control_Apply_apply(M.Effect_applicativeEffect.Apply0())(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end end } end) @@ -133,10 +137,14 @@ return (function() [2] = M.Data_Unit_foreign.unit, [3] = M.Data_Unit_foreign.unit } - return M.Control_Bind_bind(M.Effect_bindEffect)(M.Data_Foldable_foldr(M.Data_Foldable_foldableArray)(M.Control_Semigroupoid_semigroupoidFn.compose(function( a ) - return M.Control_Apply_apply(M.Effect_applicativeEffect.Apply0())(((M.Effect_applicativeEffect.Apply0()).Functor0()).map(function( ) - return function(x) return x end - end)(a)) + return (function(dictBind) + return M.Control_Bind_bind(dictBind) + end)(M.Effect_bindEffect)(M.Data_Foldable_foldr(M.Data_Foldable_foldableArray)(M.Control_Semigroupoid_semigroupoidFn.compose(function( a ) + return function(b) + return M.Control_Apply_apply(M.Effect_applicativeEffect.Apply0())(((M.Effect_applicativeEffect.Apply0()).Functor0()).map(function( ) + return function(x) return x end + end)(a))(b) + end end)(M.Effect_Console_logShow({ show = function() return "unit" end })))(M.Control_Applicative_pure(M.Effect_applicativeEffect)(M.Data_Unit_foreign.unit))(arr))(function( ) diff --git a/test/ps/output/Golden.Beta.Test/golden.ir b/test/ps/output/Golden.Beta.Test/golden.ir index 3291dea..52d7dc0 100644 --- a/test/ps/output/Golden.Beta.Test/golden.ir +++ b/test/ps/output/Golden.Beta.Test/golden.ir @@ -2,9 +2,9 @@ UberModule { uberModuleBindings = [], uberModuleForeigns = [], uberModuleExports = [ ( Name "g", Abs Nothing - ( ParamNamed Nothing ( Name "v" ) ) + ( ParamNamed Nothing ( Name "x" ) ) ( IfThenElse Nothing - ( Eq Nothing ( LiteralInt Nothing 42 ) ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ( Eq Nothing ( LiteralInt Nothing 42 ) ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) ( LiteralInt Nothing 42 ) ( LiteralInt Nothing 1 ) ) diff --git a/test/ps/output/Golden.Beta.Test/golden.lua b/test/ps/output/Golden.Beta.Test/golden.lua index facc122..b7811db 100644 --- a/test/ps/output/Golden.Beta.Test/golden.lua +++ b/test/ps/output/Golden.Beta.Test/golden.lua @@ -1 +1 @@ -return { g = function(v) if 42 == v then return 42 else return 1 end end } +return { g = function(x) if 42 == x then return 42 else return 1 end end } diff --git a/test/ps/output/Golden.BugListGenericEq.Test/golden.ir b/test/ps/output/Golden.BugListGenericEq.Test/golden.ir new file mode 100644 index 0000000..672bd68 --- /dev/null +++ b/test/ps/output/Golden.BugListGenericEq.Test/golden.ir @@ -0,0 +1,1067 @@ +UberModule + { uberModuleBindings = + [ Standalone + ( QName + { qnameModuleName = ModuleName "Data.HeytingAlgebra", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Data.HeytingAlgebra" ) ".spago/prelude/v7.2.0/src/Data/HeytingAlgebra.purs" + [ ( Nothing, Name "boolConj" ), ( Nothing, Name "boolDisj" ), ( Nothing, Name "boolNot" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Effect" ) ".spago/effect/v4.1.0/src/Effect.purs" + [ ( Nothing, Name "pureE" ), ( Nothing, Name "bindE" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Type.Proxy", qnameName = Name "Proxy" + }, Ctor Nothing ProductType + ( ModuleName "Type.Proxy" ) + ( TyName "Proxy" ) + ( CtorName "Proxy" ) [] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Data.HeytingAlgebra", qnameName = Name "heytingAlgebraBoolean" + }, LiteralObject Nothing + [ + ( PropName "ff", LiteralBool Nothing False ), + ( PropName "tt", LiteralBool Nothing True ), + ( PropName "implies", Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "b" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "disj" ) + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "not" ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ( Ref Nothing ( Local ( Name "b" ) ) 0 ) + ) + ) + ), + ( PropName "conj", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolConj" ) + ), + ( PropName "disj", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolDisj" ) + ), + ( PropName "not", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolNot" ) + ) + ] + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eqRecord" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "eqRecord" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eq" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "eq" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eqRowCons" }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEqRecord" ) ) + ( Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictIsSymbol" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "eqRecord", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "ra" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "rb" ) ) + ( Let Nothing + ( Standalone + ( Nothing, Name "key", App Nothing + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "dictIsSymbol" ) ) 0 ) + ( PropName "reflectSymbol" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Type.Proxy" ) ( Name "Proxy" ) ) 0 + ) + ) :| + [ Standalone + ( Nothing, Name "get", App Nothing + ( ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Record.Unsafe" ) ".spago/prelude/v7.2.0/src/Record/Unsafe.purs" + [ ( Nothing, Name "unsafeGet" ) ] + ) + ( PropName "unsafeGet" ) + ) + ( Ref Nothing ( Local ( Name "key" ) ) 0 ) + ) + ] + ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "conj" ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "get" ) ) 0 ) + ( Ref Nothing ( Local ( Name "ra" ) ) 0 ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "get" ) ) 0 ) + ( Ref Nothing ( Local ( Name "rb" ) ) 0 ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq" ) ( Name "eqRecord" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEqRecord" ) ) 0 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Type.Proxy" ) ( Name "Proxy" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "ra" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "rb" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ] + ) + ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Applicative", qnameName = Name "pure" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "pure" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Bind", qnameName = Name "bind" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "bind" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEq'" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "genericEq'" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEqConstructor" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictGenericEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v1" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq'" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictGenericEq" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ) + ) + ) + ] + ) + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "monadEffect" + }, LiteralObject Nothing + [ + ( PropName "Applicative0", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 ) + ), + ( PropName "Bind1", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ) + ] + ) :| + [ + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "bindEffect" + }, LiteralObject Nothing + [ + ( PropName "bind", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "bindE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "applicativeEffect" + }, LiteralObject Nothing + [ + ( PropName "pure", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "pureE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_functorEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "functorEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "map", Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( PropName "apply" ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ) + ] + ) + ) + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_applyEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "applyEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "apply", Let Nothing + ( Standalone + ( Nothing, Name "bind", App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "monadEffect" ) ) 0 + ) + ( PropName "Bind1" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) + ) + ) :| [] + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Control.Applicative" ) + ( Name "pure" ) + ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "monadEffect" ) + ) 0 + ) + ( PropName "Applicative0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f'" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a'" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ( PropName "Functor0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_functorEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ) + ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "discard" + }, App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "discard", Abs Nothing + ( ParamNamed Nothing ( Name "dictBind" ) ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictBind" ) ) 0 ) + ) + ) + ] + ) + ( PropName "discard" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "logShow" + }, Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Effect.Console" ) ".spago/console/v6.1.0/src/Effect/Console.purs" + [ ( Nothing, Name "log" ) ] + ) + ( PropName "log" ) + ) + ( App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "show", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( IfThenElse Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( LiteralString Nothing "true" ) + ( IfThenElse Nothing + ( Eq Nothing ( LiteralBool Nothing False ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( LiteralString Nothing "false" ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ] + ) + ( PropName "show" ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "Nil" + }, Ctor Nothing SumType + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( TyName "List" ) + ( CtorName "Nil" ) [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "Cons" + }, Ctor Nothing SumType + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( TyName "List" ) + ( CtorName "Cons" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "genericList" + }, LiteralObject Nothing + [ + ( PropName "to", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Cons" ) ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ), + ( PropName "from", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.BugListGenericEq.Test∷List.Nil" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ctor Nothing SumType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "Sum" ) + ( CtorName "Inl" ) + [ FieldName "value0" ] + ) + ( Ctor Nothing ProductType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "NoArguments" ) + ( CtorName "NoArguments" ) [] + ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.BugListGenericEq.Test∷List.Cons" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ctor Nothing SumType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "Sum" ) + ( CtorName "Inr" ) + [ FieldName "value0" ] + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "eqList" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "eq", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "y" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Let Nothing + ( Standalone + ( Nothing, Name "from", ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "genericList" ) + ) 0 + ) + ( PropName "from" ) + ) :| [] + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictGenericEq" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "x1" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "y1" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEq'" ) + ) 0 + ) + ( Ref Nothing ( Local ( Name "dictGenericEq" ) ) 0 ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "from" ) ) 0 ) + ( Ref Nothing ( Local ( Name "x1" ) ) 0 ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "from" ) ) 0 ) + ( Ref Nothing ( Local ( Name "y1" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v1" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEq'" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqConstructor" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) ( LiteralBool Nothing True ) ) + ) + ] + ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ( PropName "value0" ) + ) + ) ( LiteralBool Nothing False ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEq'" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqConstructor" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v2" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v11" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eq" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "eq", App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRecord" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "eqRecord", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) ( LiteralBool Nothing True ) ) + ) + ) + ] + ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Prim" ) + ( Name "undefined" ) + ) 0 + ) + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "tail" ) + ) + ] + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "eqList" ) + ) 0 + ) + ( Ref Nothing + ( Local + ( Name "dictEq" ) + ) 0 + ) + ) + ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Prim" ) + ( Name "undefined" ) + ) 0 + ) + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "head" ) + ) + ] + ) + ) + ( Ref Nothing + ( Local + ( Name "dictEq" ) + ) 0 + ) + ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Type.Proxy" ) + ( Name "Proxy" ) + ) 0 + ) + ) + ] + ) + ) + ( Ref Nothing ( Local ( Name "v2" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v11" ) ) 0 ) + ) + ) + ) + ] + ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ( PropName "value0" ) + ) + ) ( LiteralBool Nothing False ) + ) ( LiteralBool Nothing False ) + ) + ) + ) + ) + ] + ) + ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "y" ) ) 0 ) + ) + ) + ) + ] + ) + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "eq" + }, App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "eqList" ) ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "eq", ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Data.Eq" ) ".spago/prelude/v7.2.0/src/Data/Eq.purs" + [ ( Nothing, Name "eqIntImpl" ) ] + ) + ( PropName "eqIntImpl" ) + ) + ] + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.BugListGenericEq.Test", qnameName = Name "cons" + }, Abs Nothing + ( ParamNamed Nothing ( Name "head" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "tail" ) ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Cons" ) ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "head", Ref Nothing ( Local ( Name "head" ) ) 0 ), + ( PropName "tail", Ref Nothing ( Local ( Name "tail" ) ) 0 ) + ] + ) + ) + ) + ) + ], uberModuleForeigns = [], uberModuleExports = + [ + ( Name "Nil", Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ), + ( Name "Cons", Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Cons" ) ) 0 + ), + ( Name "cons", Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "cons" ) ) 0 + ), + ( Name "main", App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "eq" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "eq" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "Nil" ) + ) 0 + ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "cons" ) ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "eq" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.BugListGenericEq.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "cons" ) ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ) + ) + ) + ), + ( Name "genericList", Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "genericList" ) ) 0 + ), + ( Name "eqList", Ref Nothing + ( Imported ( ModuleName "Golden.BugListGenericEq.Test" ) ( Name "eqList" ) ) 0 + ) + ] + } \ No newline at end of file diff --git a/test/ps/output/Golden.BugListGenericEq.Test/golden.lua b/test/ps/output/Golden.BugListGenericEq.Test/golden.lua new file mode 100644 index 0000000..f5acb82 --- /dev/null +++ b/test/ps/output/Golden.BugListGenericEq.Test/golden.lua @@ -0,0 +1,255 @@ +local function PSLUA_runtime_lazy(name) + return function(init) + return function() + local state = 0 + local val = nil + if state == 2 then + return val + else + if state == 1 then + return error(name .. " was needed before it finished initializing") + else + state = 1 + val = init() + state = 2 + return val + end + end + end + end +end +local M = {} +M.Data_HeytingAlgebra_foreign = { + boolConj = function(b1) return function(b2) return b1 and b2 end end, + boolDisj = function(b1) return function(b2) return b1 or b2 end end, + boolNot = function(b) return not b end +} +M.Effect_foreign = { + pureE = function(a) + return function() + return a + end + end, + bindE = function(a) + return function(f) + return function() + return f(a())() + end + end + end +} +M.Type_Proxy_Proxy = { ["$ctor"] = "Type.Proxy∷Proxy.Proxy" } +M.Data_HeytingAlgebra_heytingAlgebraBoolean = { + ff = false, + tt = true, + implies = function(a) + return function(b) + return M.Data_HeytingAlgebra_heytingAlgebraBoolean.disj(M.Data_HeytingAlgebra_heytingAlgebraBoolean._not_(a))(b) + end + end, + conj = M.Data_HeytingAlgebra_foreign.boolConj, + disj = M.Data_HeytingAlgebra_foreign.boolDisj, + _not_ = M.Data_HeytingAlgebra_foreign.boolNot +} +M.Data_Eq_eqRecord = function(dict) return dict.eqRecord end +M.Data_Eq_eq = function(dict) return dict.eq end +M.Data_Eq_eqRowCons = function(dictEqRecord) + return function() + return function(dictIsSymbol) + return function(dictEq) + return { + eqRecord = function() + return function(ra) + return function(rb) + local key = dictIsSymbol.reflectSymbol(M.Type_Proxy_Proxy) + local get = (function(l) return function(r) return r[l] end end)(key) + return M.Data_HeytingAlgebra_heytingAlgebraBoolean.conj(M.Data_Eq_eq(dictEq)(get(ra))(get(rb)))(M.Data_Eq_eqRecord(dictEqRecord)(M.Type_Proxy_Proxy)(ra)(rb)) + end + end + end + } + end + end + end +end +M.Control_Applicative_pure = function(dict) return dict.pure end +M.Control_Bind_bind = function(dict) return dict.bind end +M.Data_Eq_Generic_genericEqPrime = function(dict) return dict.genericEqPrime end +M.Data_Eq_Generic_genericEqConstructor = function(dictGenericEq) + return { + genericEqPrime = function(v) + return function(v1) + return M.Data_Eq_Generic_genericEqPrime(dictGenericEq)(v)(v1) + end + end + } +end +M.Effect_monadEffect = { + Applicative0 = function() return M.Effect_applicativeEffect end, + Bind1 = function() return M.Effect_bindEffect end +} +M.Effect_bindEffect = { + bind = M.Effect_foreign.bindE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_applicativeEffect = { + pure = M.Effect_foreign.pureE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() + return { + map = function(f) + return function(a) + return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end + end + } +end) +M.Effect_Lazy_applyEffect = PSLUA_runtime_lazy("applyEffect")(function() + return { + apply = (function() + return function(f) + local bind = M.Control_Bind_bind(M.Effect_monadEffect.Bind1()) + return function(a) + return bind(f)(function(fPrime) + return bind(a)(function(aPrime) + return M.Control_Applicative_pure(M.Effect_monadEffect.Applicative0())(fPrime(aPrime)) + end) + end) + end + end + end)(), + Functor0 = function() return M.Effect_Lazy_functorEffect(0) end + } +end) +M.Golden_BugListGenericEq_Test_discard = (function(dictBind) + return M.Control_Bind_bind(dictBind) +end)(M.Effect_bindEffect) +M.Golden_BugListGenericEq_Test_logShow = function(a) + return (function(s) return function() print(s) end end)((function(v) + if v then + return "true" + else + if false == v then + return "false" + else + return error("No patterns matched") + end + end + end)(a)) +end +M.Golden_BugListGenericEq_Test_Nil = { + ["$ctor"] = "Golden.BugListGenericEq.Test∷List.Nil" +} +M.Golden_BugListGenericEq_Test_Cons = function(value0) + return { + ["$ctor"] = "Golden.BugListGenericEq.Test∷List.Cons", + value0 = value0 + } +end +M.Golden_BugListGenericEq_Test_genericList = { + to = function(x) + if "Data.Generic.Rep∷Sum.Inl" == x["$ctor"] then + return M.Golden_BugListGenericEq_Test_Nil + else + if "Data.Generic.Rep∷Sum.Inr" == x["$ctor"] then + return M.Golden_BugListGenericEq_Test_Cons(x.value0) + else + return error("No patterns matched") + end + end + end, + from = function(x) + if "Golden.BugListGenericEq.Test∷List.Nil" == x["$ctor"] then + return (function(value0) + return { ["$ctor"] = "Data.Generic.Rep∷Sum.Inl", value0 = value0 } + end)({ ["$ctor"] = "Data.Generic.Rep∷NoArguments.NoArguments" }) + else + if "Golden.BugListGenericEq.Test∷List.Cons" == x["$ctor"] then + return (function(value0) + return { ["$ctor"] = "Data.Generic.Rep∷Sum.Inr", value0 = value0 } + end)(x.value0) + else + return error("No patterns matched") + end + end + end +} +M.Golden_BugListGenericEq_Test_eqList = function(dictEq) + return { + eq = function(x) + return function(y) + return (function() + return function(dictGenericEq) + local from = M.Golden_BugListGenericEq_Test_genericList.from + return function(x1) + return function(y1) + return M.Data_Eq_Generic_genericEqPrime(dictGenericEq)(from(x1))(from(y1)) + end + end + end + end)()({ + genericEqPrime = function(v) + return function(v1) + if "Data.Generic.Rep∷Sum.Inl" == v["$ctor"] then + if "Data.Generic.Rep∷Sum.Inl" == v1["$ctor"] then + return M.Data_Eq_Generic_genericEqPrime(M.Data_Eq_Generic_genericEqConstructor({ + genericEqPrime = function() + return function() return true end + end + }))(v.value0)(v1.value0) + else + return false + end + else + if "Data.Generic.Rep∷Sum.Inr" == v["$ctor"] then + if "Data.Generic.Rep∷Sum.Inr" == v1["$ctor"] then + return M.Data_Eq_Generic_genericEqPrime(M.Data_Eq_Generic_genericEqConstructor({ + genericEqPrime = function(v2) + return function(v11) + return M.Data_Eq_eq({ + eq = M.Data_Eq_eqRecord(M.Data_Eq_eqRowCons(M.Data_Eq_eqRowCons({ + eqRecord = function() + return function() + return function() return true end + end + end + })()({ + reflectSymbol = function() return "tail" end + })(M.Golden_BugListGenericEq_Test_eqList(dictEq)))()({ + reflectSymbol = function() return "head" end + })(dictEq))(M.Type_Proxy_Proxy) + })(v2)(v11) + end + end + }))(v.value0)(v1.value0) + else + return false + end + else + return false + end + end + end + end + })(x)(y) + end + end + } +end +M.Golden_BugListGenericEq_Test_eq = M.Data_Eq_eq(M.Golden_BugListGenericEq_Test_eqList({ + eq = ((function() + local refEq = function(r1) return function(r2) return r1 == r2 end end + return { eqIntImpl = refEq } + end)()).eqIntImpl +})) +M.Golden_BugListGenericEq_Test_cons = function(head) + return function(tail) + return M.Golden_BugListGenericEq_Test_Cons({ head = head, tail = tail }) + end +end +return M.Golden_BugListGenericEq_Test_discard(M.Golden_BugListGenericEq_Test_logShow(M.Golden_BugListGenericEq_Test_eq(M.Golden_BugListGenericEq_Test_Nil)(M.Golden_BugListGenericEq_Test_Nil)))(function( ) + return M.Golden_BugListGenericEq_Test_discard(M.Golden_BugListGenericEq_Test_logShow(M.Golden_BugListGenericEq_Test_eq(M.Golden_BugListGenericEq_Test_cons(1)(M.Golden_BugListGenericEq_Test_cons(2)(M.Golden_BugListGenericEq_Test_Nil)))(M.Golden_BugListGenericEq_Test_cons(1)(M.Golden_BugListGenericEq_Test_cons(2)(M.Golden_BugListGenericEq_Test_Nil)))))(function( ) + return M.Golden_BugListGenericEq_Test_logShow(M.Golden_BugListGenericEq_Test_eq(M.Golden_BugListGenericEq_Test_cons(1)(M.Golden_BugListGenericEq_Test_Nil))(M.Golden_BugListGenericEq_Test_cons(2)(M.Golden_BugListGenericEq_Test_Nil))) + end) +end)() diff --git a/test/ps/output/Golden.Currying.Test/golden.ir b/test/ps/output/Golden.Currying.Test/golden.ir index 5839809..abd1f9a 100644 --- a/test/ps/output/Golden.Currying.Test/golden.ir +++ b/test/ps/output/Golden.Currying.Test/golden.ir @@ -3,7 +3,13 @@ UberModule [ ( Name "apply", Abs Nothing ( ParamNamed Nothing ( Name "f1" ) ) - ( Ref Nothing ( Local ( Name "f1" ) ) 0 ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f1" ) ) 0 ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ) + ) ), ( Name "f", Abs Nothing ( ParamUnused Nothing ) ( Abs Nothing ( ParamUnused Nothing ) diff --git a/test/ps/output/Golden.Currying.Test/golden.lua b/test/ps/output/Golden.Currying.Test/golden.lua index 0bf7a3c..93f2467 100644 --- a/test/ps/output/Golden.Currying.Test/golden.lua +++ b/test/ps/output/Golden.Currying.Test/golden.lua @@ -1,5 +1,5 @@ return { - apply = function(f1) return f1 end, + apply = function(f1) return function(x) return f1(x) end end, f = function() return function() return function() return function() return "ok" end end diff --git a/test/ps/output/Golden.DerivedFunctor.Test/golden.ir b/test/ps/output/Golden.DerivedFunctor.Test/golden.ir new file mode 100644 index 0000000..021f2f6 --- /dev/null +++ b/test/ps/output/Golden.DerivedFunctor.Test/golden.ir @@ -0,0 +1,783 @@ +UberModule + { uberModuleBindings = + [ Standalone + ( QName + { qnameModuleName = ModuleName "Data.Semiring", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Data.Semiring" ) ".spago/prelude/v7.2.0/src/Data/Semiring.purs" + [ ( Nothing, Name "intAdd" ), ( Nothing, Name "intMul" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Effect" ) ".spago/effect/v4.1.0/src/Effect.purs" + [ ( Nothing, Name "pureE" ), ( Nothing, Name "bindE" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Semiring", qnameName = Name "semiringInt" + }, LiteralObject Nothing + [ + ( PropName "add", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Data.Semiring" ) ( Name "foreign" ) ) 0 ) + ( PropName "intAdd" ) + ), + ( PropName "zero", LiteralInt Nothing 0 ), + ( PropName "mul", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Data.Semiring" ) ( Name "foreign" ) ) 0 ) + ( PropName "intMul" ) + ), + ( PropName "one", LiteralInt Nothing 1 ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Functor", qnameName = Name "map" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "map" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Applicative", qnameName = Name "pure" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "pure" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Bind", qnameName = Name "bind" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "bind" ) ) + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "monadEffect" + }, LiteralObject Nothing + [ + ( PropName "Applicative0", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 ) + ), + ( PropName "Bind1", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ) + ] + ) :| + [ + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "bindEffect" + }, LiteralObject Nothing + [ + ( PropName "bind", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "bindE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "applicativeEffect" + }, LiteralObject Nothing + [ + ( PropName "pure", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "pureE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_functorEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "functorEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "map", Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( PropName "apply" ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ) + ] + ) + ) + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_applyEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "applyEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "apply", Let Nothing + ( Standalone + ( Nothing, Name "bind", App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "monadEffect" ) ) 0 + ) + ( PropName "Bind1" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) + ) + ) :| [] + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Control.Applicative" ) + ( Name "pure" ) + ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "monadEffect" ) + ) 0 + ) + ( PropName "Applicative0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f'" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a'" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ( PropName "Functor0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_functorEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ) + ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "add" + }, ObjectProp Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Semiring" ) ( Name "semiringInt" ) ) 0 ) + ( PropName "add" ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "discard" + }, App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "discard", Abs Nothing + ( ParamNamed Nothing ( Name "dictBind" ) ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictBind" ) ) 0 ) + ) + ) + ] + ) + ( PropName "discard" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "logShow" + }, Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Effect.Console" ) ".spago/console/v6.1.0/src/Effect/Console.purs" + [ ( Nothing, Name "log" ) ] + ) + ( PropName "log" ) + ) + ( App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "show", ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Data.Show" ) ".spago/prelude/v7.2.0/src/Data/Show.purs" + [ ( Nothing, Name "showIntImpl" ) ] + ) + ( PropName "showIntImpl" ) + ) + ] + ) + ( PropName "show" ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "Leaf" + }, Ctor Nothing SumType + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( TyName "Tree" ) + ( CtorName "Leaf" ) [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "Node" + }, Ctor Nothing SumType + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( TyName "Tree" ) + ( CtorName "Node" ) + [ FieldName "value0", FieldName "value1", FieldName "value2" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "Left" + }, Ctor Nothing SumType + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( TyName "Either" ) + ( CtorName "Left" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "Right" + }, Ctor Nothing SumType + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( TyName "Either" ) + ( CtorName "Right" ) + [ FieldName "value0" ] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "sumTree" + }, Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Tree.Leaf" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( LiteralInt Nothing 0 ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Tree.Node" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "add" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "add" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "sumTree" ) + ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value1" ) + ) + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "sumTree" ) ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value2" ) + ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) :| [] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "functorTree" + }, LiteralObject Nothing + [ + ( PropName "map", Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "m" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Tree.Leaf" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "m" ) ) 0 ) ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Leaf" ) ) 0 + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Tree.Node" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "m" ) ) 0 ) ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Node" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Functor" ) ( Name "map" ) ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "functorTree" ) + ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "m" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "m" ) ) 0 ) + ( PropName "value1" ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Functor" ) ( Name "map" ) ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "functorTree" ) + ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "m" ) ) 0 ) + ( PropName "value2" ) + ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ) + ] + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "functorEither" + }, LiteralObject Nothing + [ + ( PropName "map", Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "m" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Either.Left" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "m" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Left" ) ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "m" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Either.Right" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "m" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Right" ) ) 0 + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "m" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "map1" + }, App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Functor" ) ( Name "map" ) ) 0 ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "functorEither" ) ) 0 + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.DerivedFunctor.Test", qnameName = Name "fromRight" + }, Abs Nothing + ( ParamNamed Nothing ( Name "fallback" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Either.Left" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( Ref Nothing ( Local ( Name "fallback" ) ) 0 ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.DerivedFunctor.Test∷Either.Right" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ( PropName "value0" ) ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ) + ], uberModuleForeigns = [], uberModuleExports = + [ + ( Name "Left", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Left" ) ) 0 + ), + ( Name "Right", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Right" ) ) 0 + ), + ( Name "Leaf", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Leaf" ) ) 0 + ), + ( Name "Node", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Node" ) ) 0 + ), + ( Name "fromRight", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "fromRight" ) ) 0 + ), + ( Name "sumTree", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "sumTree" ) ) 0 + ), + ( Name "main", App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "fromRight" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "map1" ) ) 0 + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "add" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( LiteralInt Nothing 1 ) + ) + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Right" ) ) 0 + ) + ( LiteralInt Nothing 41 ) + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "fromRight" ) + ) 0 + ) + ( LiteralInt Nothing 7 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "map1" ) ) 0 + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "add" ) + ) 0 + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( LiteralInt Nothing 1 ) + ) + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Left" ) ) 0 + ) + ( LiteralString Nothing "no" ) + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "sumTree" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Functor" ) ( Name "map" ) ) 0 ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "functorTree" ) + ) 0 + ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Semiring" ) ( Name "semiringInt" ) ) 0 + ) + ( PropName "mul" ) + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( LiteralInt Nothing 2 ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Node" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 1 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ) + ( LiteralInt Nothing 2 ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.DerivedFunctor.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 3 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "Leaf" ) ) 0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ( Name "functorEither", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "functorEither" ) ) 0 + ), + ( Name "functorTree", Ref Nothing + ( Imported ( ModuleName "Golden.DerivedFunctor.Test" ) ( Name "functorTree" ) ) 0 + ) + ] + } \ No newline at end of file diff --git a/test/ps/output/Golden.DerivedFunctor.Test/golden.lua b/test/ps/output/Golden.DerivedFunctor.Test/golden.lua new file mode 100644 index 0000000..98a7157 --- /dev/null +++ b/test/ps/output/Golden.DerivedFunctor.Test/golden.lua @@ -0,0 +1,186 @@ +local function PSLUA_runtime_lazy(name) + return function(init) + return function() + local state = 0 + local val = nil + if state == 2 then + return val + else + if state == 1 then + return error(name .. " was needed before it finished initializing") + else + state = 1 + val = init() + state = 2 + return val + end + end + end + end +end +local M = {} +M.Data_Semiring_foreign = { + intAdd = function(x) return function(y) return x + y end end, + intMul = function(x) return function(y) return x * y end end +} +M.Effect_foreign = { + pureE = function(a) + return function() + return a + end + end, + bindE = function(a) + return function(f) + return function() + return f(a())() + end + end + end +} +M.Data_Semiring_semiringInt = { + add = M.Data_Semiring_foreign.intAdd, + zero = 0, + mul = M.Data_Semiring_foreign.intMul, + one = 1 +} +M.Data_Functor_map = function(dict) return dict.map end +M.Control_Applicative_pure = function(dict) return dict.pure end +M.Control_Bind_bind = function(dict) return dict.bind end +M.Effect_monadEffect = { + Applicative0 = function() return M.Effect_applicativeEffect end, + Bind1 = function() return M.Effect_bindEffect end +} +M.Effect_bindEffect = { + bind = M.Effect_foreign.bindE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_applicativeEffect = { + pure = M.Effect_foreign.pureE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() + return { + map = function(f) + return function(a) + return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end + end + } +end) +M.Effect_Lazy_applyEffect = PSLUA_runtime_lazy("applyEffect")(function() + return { + apply = (function() + return function(f) + local bind = M.Control_Bind_bind(M.Effect_monadEffect.Bind1()) + return function(a) + return bind(f)(function(fPrime) + return bind(a)(function(aPrime) + return M.Control_Applicative_pure(M.Effect_monadEffect.Applicative0())(fPrime(aPrime)) + end) + end) + end + end + end)(), + Functor0 = function() return M.Effect_Lazy_functorEffect(0) end + } +end) +M.Golden_DerivedFunctor_Test_add = M.Data_Semiring_semiringInt.add +M.Golden_DerivedFunctor_Test_discard = (function(dictBind) + return M.Control_Bind_bind(dictBind) +end)(M.Effect_bindEffect) +M.Golden_DerivedFunctor_Test_logShow = function(a) + return (function(s) return function() print(s) end end)((function(n) return tostring(n) end)(a)) +end +M.Golden_DerivedFunctor_Test_Leaf = { + ["$ctor"] = "Golden.DerivedFunctor.Test∷Tree.Leaf" +} +M.Golden_DerivedFunctor_Test_Node = function(value0) + return function(value1) + return function(value2) + return { + ["$ctor"] = "Golden.DerivedFunctor.Test∷Tree.Node", + value0 = value0, + value1 = value1, + value2 = value2 + } + end + end +end +M.Golden_DerivedFunctor_Test_Left = function(value0) + return { + ["$ctor"] = "Golden.DerivedFunctor.Test∷Either.Left", + value0 = value0 + } +end +M.Golden_DerivedFunctor_Test_Right = function(value0) + return { + ["$ctor"] = "Golden.DerivedFunctor.Test∷Either.Right", + value0 = value0 + } +end +M.Golden_DerivedFunctor_Test_sumTree = function(v) + if "Golden.DerivedFunctor.Test∷Tree.Leaf" == v["$ctor"] then + return 0 + else + if "Golden.DerivedFunctor.Test∷Tree.Node" == v["$ctor"] then + return M.Golden_DerivedFunctor_Test_add(M.Golden_DerivedFunctor_Test_add(M.Golden_DerivedFunctor_Test_sumTree(v.value0))(v.value1))(M.Golden_DerivedFunctor_Test_sumTree(v.value2)) + else + return error("No patterns matched") + end + end +end +M.Golden_DerivedFunctor_Test_functorTree = { + map = function(f) + return function(m) + if "Golden.DerivedFunctor.Test∷Tree.Leaf" == m["$ctor"] then + return M.Golden_DerivedFunctor_Test_Leaf + else + if "Golden.DerivedFunctor.Test∷Tree.Node" == m["$ctor"] then + return M.Golden_DerivedFunctor_Test_Node(M.Data_Functor_map(M.Golden_DerivedFunctor_Test_functorTree)(f)(m.value0))(f(m.value1))(M.Data_Functor_map(M.Golden_DerivedFunctor_Test_functorTree)(f)(m.value2)) + else + return error("No patterns matched") + end + end + end + end +} +M.Golden_DerivedFunctor_Test_functorEither = { + map = function(f) + return function(m) + if "Golden.DerivedFunctor.Test∷Either.Left" == m["$ctor"] then + return M.Golden_DerivedFunctor_Test_Left(m.value0) + else + if "Golden.DerivedFunctor.Test∷Either.Right" == m["$ctor"] then + return M.Golden_DerivedFunctor_Test_Right(f(m.value0)) + else + return error("No patterns matched") + end + end + end + end +} +M.Golden_DerivedFunctor_Test_map1 = M.Data_Functor_map(M.Golden_DerivedFunctor_Test_functorEither) +M.Golden_DerivedFunctor_Test_fromRight = function(fallback) + return function(v) + if "Golden.DerivedFunctor.Test∷Either.Left" == v["$ctor"] then + return fallback + else + if "Golden.DerivedFunctor.Test∷Either.Right" == v["$ctor"] then + return v.value0 + else + return error("No patterns matched") + end + end + end +end +return M.Golden_DerivedFunctor_Test_discard(M.Golden_DerivedFunctor_Test_logShow(M.Golden_DerivedFunctor_Test_fromRight(0)(M.Golden_DerivedFunctor_Test_map1(function( v ) + return M.Golden_DerivedFunctor_Test_add(v)(1) +end)(M.Golden_DerivedFunctor_Test_Right(41)))))(function() + return M.Golden_DerivedFunctor_Test_discard(M.Golden_DerivedFunctor_Test_logShow(M.Golden_DerivedFunctor_Test_fromRight(7)(M.Golden_DerivedFunctor_Test_map1(function( v ) + return M.Golden_DerivedFunctor_Test_add(v)(1) + end)(M.Golden_DerivedFunctor_Test_Left("no")))))(function() + return M.Golden_DerivedFunctor_Test_logShow(M.Golden_DerivedFunctor_Test_sumTree(M.Data_Functor_map(M.Golden_DerivedFunctor_Test_functorTree)(function( v ) + return M.Data_Semiring_semiringInt.mul(v)(2) + end)(M.Golden_DerivedFunctor_Test_Node(M.Golden_DerivedFunctor_Test_Node(M.Golden_DerivedFunctor_Test_Leaf)(1)(M.Golden_DerivedFunctor_Test_Leaf))(2)(M.Golden_DerivedFunctor_Test_Node(M.Golden_DerivedFunctor_Test_Leaf)(3)(M.Golden_DerivedFunctor_Test_Leaf))))) + end) +end)() diff --git a/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.ir b/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.ir new file mode 100644 index 0000000..35a5c01 --- /dev/null +++ b/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.ir @@ -0,0 +1,1531 @@ +UberModule + { uberModuleBindings = + [ Standalone + ( QName + { qnameModuleName = ModuleName "Data.HeytingAlgebra", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Data.HeytingAlgebra" ) ".spago/prelude/v7.2.0/src/Data/HeytingAlgebra.purs" + [ ( Nothing, Name "boolConj" ), ( Nothing, Name "boolDisj" ), ( Nothing, Name "boolNot" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "foreign" + }, ForeignImport Nothing + ( ModuleName "Effect" ) ".spago/effect/v4.1.0/src/Effect.purs" + [ ( Nothing, Name "pureE" ), ( Nothing, Name "bindE" ) ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Type.Proxy", qnameName = Name "Proxy" + }, Ctor Nothing ProductType + ( ModuleName "Type.Proxy" ) + ( TyName "Proxy" ) + ( CtorName "Proxy" ) [] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Data.HeytingAlgebra", qnameName = Name "heytingAlgebraBoolean" + }, LiteralObject Nothing + [ + ( PropName "ff", LiteralBool Nothing False ), + ( PropName "tt", LiteralBool Nothing True ), + ( PropName "implies", Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "b" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "disj" ) + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "not" ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ( Ref Nothing ( Local ( Name "b" ) ) 0 ) + ) + ) + ), + ( PropName "conj", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolConj" ) + ), + ( PropName "disj", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolDisj" ) + ), + ( PropName "not", ObjectProp ( Just Always ) + ( Ref Nothing + ( Imported ( ModuleName "Data.HeytingAlgebra" ) ( Name "foreign" ) ) 0 + ) + ( PropName "boolNot" ) + ) + ] + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eqRecord" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "eqRecord" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eqInt" }, LiteralObject Nothing + [ + ( PropName "eq", ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Data.Eq" ) ".spago/prelude/v7.2.0/src/Data/Eq.purs" + [ ( Nothing, Name "eqIntImpl" ) ] + ) + ( PropName "eqIntImpl" ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eq" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "eq" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq", qnameName = Name "eqRowCons" }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEqRecord" ) ) + ( Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictIsSymbol" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "eqRecord", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "ra" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "rb" ) ) + ( Let Nothing + ( Standalone + ( Nothing, Name "key", App Nothing + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "dictIsSymbol" ) ) 0 ) + ( PropName "reflectSymbol" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Type.Proxy" ) ( Name "Proxy" ) ) 0 + ) + ) :| + [ Standalone + ( Nothing, Name "get", App Nothing + ( ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Record.Unsafe" ) ".spago/prelude/v7.2.0/src/Record/Unsafe.purs" + [ ( Nothing, Name "unsafeGet" ) ] + ) + ( PropName "unsafeGet" ) + ) + ( Ref Nothing ( Local ( Name "key" ) ) 0 ) + ) + ] + ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.HeytingAlgebra" ) + ( Name "heytingAlgebraBoolean" ) + ) 0 + ) + ( PropName "conj" ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "get" ) ) 0 ) + ( Ref Nothing ( Local ( Name "ra" ) ) 0 ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "get" ) ) 0 ) + ( Ref Nothing ( Local ( Name "rb" ) ) 0 ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq" ) ( Name "eqRecord" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEqRecord" ) ) 0 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Type.Proxy" ) ( Name "Proxy" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "ra" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "rb" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ] + ) + ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Applicative", qnameName = Name "pure" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "pure" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Control.Bind", qnameName = Name "bind" }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "bind" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Generic.Rep", qnameName = Name "Inl" + }, Ctor Nothing SumType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "Sum" ) + ( CtorName "Inl" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Generic.Rep", qnameName = Name "Inr" + }, Ctor Nothing SumType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "Sum" ) + ( CtorName "Inr" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Generic.Rep", qnameName = Name "NoArguments" + }, Ctor Nothing ProductType + ( ModuleName "Data.Generic.Rep" ) + ( TyName "NoArguments" ) + ( CtorName "NoArguments" ) [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEqArgument" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v1" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ) + ) + ) + ] + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEq'" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dict" ) ) + ( ObjectProp Nothing ( Ref Nothing ( Local ( Name "dict" ) ) 0 ) ( PropName "genericEq'" ) ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEqConstructor" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictGenericEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v1" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq'" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictGenericEq" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ) + ) + ) + ] + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Data.Eq.Generic", qnameName = Name "genericEq" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictGeneric" ) ) + ( Let Nothing + ( Standalone + ( Nothing, Name "from", ObjectProp Nothing + ( Ref Nothing ( Local ( Name "dictGeneric" ) ) 0 ) + ( PropName "from" ) + ) :| [] + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "dictGenericEq" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "y" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq'" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictGenericEq" ) ) 0 ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "from" ) ) 0 ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "from" ) ) 0 ) + ( Ref Nothing ( Local ( Name "y" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "monadEffect" + }, LiteralObject Nothing + [ + ( PropName "Applicative0", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 ) + ), + ( PropName "Bind1", Abs Nothing ( ParamUnused Nothing ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ) + ] + ) :| + [ + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "bindEffect" + }, LiteralObject Nothing + [ + ( PropName "bind", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "bindE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "applicativeEffect" + }, LiteralObject Nothing + [ + ( PropName "pure", ObjectProp ( Just Always ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "foreign" ) ) 0 ) + ( PropName "pureE" ) + ), + ( PropName "Apply0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_applyEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_functorEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "functorEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "map", Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( ObjectProp Nothing + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( PropName "apply" ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ) + ] + ) + ) + ), + ( QName + { qnameModuleName = ModuleName "Effect", qnameName = Name "Lazy_applyEffect" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "PSLUA_runtime_lazy" ) ) 0 ) + ( LiteralString Nothing "applyEffect" ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( LiteralObject Nothing + [ + ( PropName "apply", Let Nothing + ( Standalone + ( Nothing, Name "bind", App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "monadEffect" ) ) 0 + ) + ( PropName "Bind1" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) + ) + ) :| [] + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "f'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing ( Local ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "a'" ) ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Control.Applicative" ) + ( Name "pure" ) + ) 0 + ) + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "monadEffect" ) + ) 0 + ) + ( PropName "Applicative0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ) + ( App Nothing + ( Ref Nothing ( Local ( Name "f'" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a'" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ( PropName "Functor0", Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "Lazy_functorEffect" ) ) 0 + ) + ( LiteralInt Nothing 0 ) + ) + ) + ] + ) + ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "genericEqSum" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictGenericEq1" ) ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "v1" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq'" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqConstructor" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "genericEq'", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) ( LiteralBool Nothing True ) ) + ) + ] + ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ( PropName "value0" ) + ) + ) ( LiteralBool Nothing False ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v" ) ) 0 ) ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq'" ) ) 0 + ) + ( Ref Nothing ( Local ( Name "dictGenericEq1" ) ) 0 ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "v1" ) ) 0 ) + ( PropName "value0" ) + ) + ) ( LiteralBool Nothing False ) + ) ( LiteralBool Nothing False ) + ) + ) + ) + ) + ] + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eqRec" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEqRecord" ) ) + ( LiteralObject Nothing + [ + ( PropName "eq", App Nothing + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eqRecord" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictEqRecord" ) ) 0 ) + ) + ( Ref Nothing ( Imported ( ModuleName "Type.Proxy" ) ( Name "Proxy" ) ) 0 ) + ) + ] + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eqRowCons" + }, App Nothing + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eqRowCons" ) ) 0 ) + ( LiteralObject Nothing + [ + ( PropName "eqRecord", Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) + ( Abs Nothing ( ParamUnused Nothing ) ( LiteralBool Nothing True ) ) + ) + ) + ] + ) + ) + ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "discard" + }, App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "discard", Abs Nothing + ( ParamNamed Nothing ( Name "dictBind" ) ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictBind" ) ) 0 ) + ) + ) + ] + ) + ( PropName "discard" ) + ) + ( Ref Nothing ( Imported ( ModuleName "Effect" ) ( Name "bindEffect" ) ) 0 ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "logShow" + }, Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing + ( ObjectProp ( Just Always ) + ( ForeignImport Nothing + ( ModuleName "Effect.Console" ) ".spago/console/v6.1.0/src/Effect/Console.purs" + [ ( Nothing, Name "log" ) ] + ) + ( PropName "log" ) + ) + ( App Nothing + ( ObjectProp Nothing + ( LiteralObject Nothing + [ + ( PropName "show", Abs Nothing + ( ParamNamed Nothing ( Name "v" ) ) + ( IfThenElse Nothing + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ( LiteralString Nothing "true" ) + ( IfThenElse Nothing + ( Eq Nothing ( LiteralBool Nothing False ) + ( Ref Nothing ( Local ( Name "v" ) ) 0 ) + ) + ( LiteralString Nothing "false" ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ] + ) + ( PropName "show" ) + ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "Leaf" + }, Ctor Nothing SumType + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( TyName "Tree" ) + ( CtorName "Leaf" ) [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "Node" + }, Ctor Nothing SumType + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( TyName "Tree" ) + ( CtorName "Node" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "Nil" + }, Ctor Nothing SumType + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( TyName "List" ) + ( CtorName "Nil" ) [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "Cons" + }, Ctor Nothing SumType + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( TyName "List" ) + ( CtorName "Cons" ) + [ FieldName "value0" ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "node" + }, Abs Nothing + ( ParamNamed Nothing ( Name "left" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "value" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "right" ) ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Node" ) ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "left", Ref Nothing ( Local ( Name "left" ) ) 0 ), + ( PropName "value", Ref Nothing ( Local ( Name "value" ) ) 0 ), + ( PropName "right", Ref Nothing ( Local ( Name "right" ) ) 0 ) + ] + ) + ) + ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "genericTree" + }, LiteralObject Nothing + [ + ( PropName "to", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Leaf" ) ) 0 + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Node" ) ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ), + ( PropName "from", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.GenericEqTwoTypes.Test∷Tree.Leaf" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "Inl" ) ) 0 ) + ( Ref Nothing + ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "NoArguments" ) ) 0 + ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.GenericEqTwoTypes.Test∷Tree.Node" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "Inr" ) ) 0 ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "genericList" + }, LiteralObject Nothing + [ + ( PropName "to", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inl" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Data.Generic.Rep∷Sum.Inr" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Cons" ) ) 0 + ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ), + ( PropName "from", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.GenericEqTwoTypes.Test∷List.Nil" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "Inl" ) ) 0 ) + ( Ref Nothing + ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "NoArguments" ) ) 0 + ) + ) + ( IfThenElse Nothing + ( Eq Nothing + ( LiteralString Nothing "Golden.GenericEqTwoTypes.Test∷List.Cons" ) + ( ReflectCtor Nothing ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) + ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Generic.Rep" ) ( Name "Inr" ) ) 0 ) + ( ObjectProp Nothing + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ( PropName "value0" ) + ) + ) + ( Exception Nothing "No patterns matched" ) + ) + ) + ) + ] + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eqTree" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "eq", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "y" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq" ) ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "genericTree" ) + ) 0 + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "genericEqSum" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqConstructor" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqArgument" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqRec" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "value" ) + ) + ] + ) + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Prim" ) + ( Name "undefined" ) + ) 0 + ) + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "right" ) + ) + ] + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqTree" ) + ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "left" ) + ) + ] + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqTree" ) + ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "y" ) ) 0 ) + ) + ) + ) + ] + ) + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eq" + }, App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eqTree" ) ) 0 + ) + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eqInt" ) ) 0 ) + ) + ), RecursiveGroup + ( + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eqList" + }, Abs Nothing + ( ParamNamed Nothing ( Name "dictEq" ) ) + ( LiteralObject Nothing + [ + ( PropName "eq", Abs Nothing + ( ParamNamed Nothing ( Name "x" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "y" ) ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Data.Eq.Generic" ) ( Name "genericEq" ) ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "genericList" ) + ) 0 + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "genericEqSum" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqConstructor" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq.Generic" ) + ( Name "genericEqArgument" ) + ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqRec" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Data.Eq" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqRowCons" ) + ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "tail" ) + ) + ] + ) + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eqList" ) + ) 0 + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) + ) + ( LiteralObject Nothing + [ + ( PropName "reflectSymbol", Abs Nothing ( ParamUnused Nothing ) + ( LiteralString Nothing "head" ) + ) + ] + ) + ) + ( Ref Nothing ( Local ( Name "dictEq" ) ) 0 ) + ) + ) + ) + ) + ) + ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) + ) + ( Ref Nothing ( Local ( Name "y" ) ) 0 ) + ) + ) + ) + ] + ) + ) :| [] + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "eq1" + }, App Nothing + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eq" ) ) 0 ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eqList" ) ) 0 + ) + ( Ref Nothing ( Imported ( ModuleName "Data.Eq" ) ( Name "eqInt" ) ) 0 ) + ) + ), Standalone + ( QName + { qnameModuleName = ModuleName "Golden.GenericEqTwoTypes.Test", qnameName = Name "cons" + }, Abs Nothing + ( ParamNamed Nothing ( Name "head" ) ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "tail" ) ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Cons" ) ) 0 + ) + ( LiteralObject Nothing + [ + ( PropName "head", Ref Nothing ( Local ( Name "head" ) ) 0 ), + ( PropName "tail", Ref Nothing ( Local ( Name "tail" ) ) 0 ) + ] + ) + ) + ) + ) + ], uberModuleForeigns = [], uberModuleExports = + [ + ( Name "Nil", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ), + ( Name "Cons", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Cons" ) ) 0 + ), + ( Name "cons", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "cons" ) ) 0 + ), + ( Name "Leaf", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Leaf" ) ) 0 + ), + ( Name "Node", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Node" ) ) 0 + ), + ( Name "node", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "node" ) ) 0 + ), + ( Name "main", App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eq1" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "cons" ) ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "cons" ) ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "cons" ) ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "logShow" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eq1" ) ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 1 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "cons" ) + ) 0 + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "Nil" ) ) 0 + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "discard" ) ) 0 + ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "logShow" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eq" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 1 ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ) + ) + ) + ) + ( Abs Nothing ( ParamUnused Nothing ) + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "logShow" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "eq" ) + ) 0 + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 1 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ) + ( App Nothing + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "node" ) + ) 0 + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ( LiteralInt Nothing 2 ) + ) + ( Ref Nothing + ( Imported + ( ModuleName "Golden.GenericEqTwoTypes.Test" ) + ( Name "Leaf" ) + ) 0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ), + ( Name "genericList", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "genericList" ) ) 0 + ), + ( Name "eqList", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eqList" ) ) 0 + ), + ( Name "genericTree", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "genericTree" ) ) 0 + ), + ( Name "eqTree", Ref Nothing + ( Imported ( ModuleName "Golden.GenericEqTwoTypes.Test" ) ( Name "eqTree" ) ) 0 + ) + ] + } \ No newline at end of file diff --git a/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.lua b/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.lua new file mode 100644 index 0000000..5f1c3f7 --- /dev/null +++ b/test/ps/output/Golden.GenericEqTwoTypes.Test/golden.lua @@ -0,0 +1,326 @@ +local function PSLUA_runtime_lazy(name) + return function(init) + return function() + local state = 0 + local val = nil + if state == 2 then + return val + else + if state == 1 then + return error(name .. " was needed before it finished initializing") + else + state = 1 + val = init() + state = 2 + return val + end + end + end + end +end +local M = {} +M.Data_HeytingAlgebra_foreign = { + boolConj = function(b1) return function(b2) return b1 and b2 end end, + boolDisj = function(b1) return function(b2) return b1 or b2 end end, + boolNot = function(b) return not b end +} +M.Effect_foreign = { + pureE = function(a) + return function() + return a + end + end, + bindE = function(a) + return function(f) + return function() + return f(a())() + end + end + end +} +M.Type_Proxy_Proxy = { ["$ctor"] = "Type.Proxy∷Proxy.Proxy" } +M.Data_HeytingAlgebra_heytingAlgebraBoolean = { + ff = false, + tt = true, + implies = function(a) + return function(b) + return M.Data_HeytingAlgebra_heytingAlgebraBoolean.disj(M.Data_HeytingAlgebra_heytingAlgebraBoolean._not_(a))(b) + end + end, + conj = M.Data_HeytingAlgebra_foreign.boolConj, + disj = M.Data_HeytingAlgebra_foreign.boolDisj, + _not_ = M.Data_HeytingAlgebra_foreign.boolNot +} +M.Data_Eq_eqRecord = function(dict) return dict.eqRecord end +M.Data_Eq_eqInt = { + eq = ((function() + local refEq = function(r1) return function(r2) return r1 == r2 end end + return { eqIntImpl = refEq } + end)()).eqIntImpl +} +M.Data_Eq_eq = function(dict) return dict.eq end +M.Data_Eq_eqRowCons = function(dictEqRecord) + return function() + return function(dictIsSymbol) + return function(dictEq) + return { + eqRecord = function() + return function(ra) + return function(rb) + local key = dictIsSymbol.reflectSymbol(M.Type_Proxy_Proxy) + local get = (function(l) return function(r) return r[l] end end)(key) + return M.Data_HeytingAlgebra_heytingAlgebraBoolean.conj(M.Data_Eq_eq(dictEq)(get(ra))(get(rb)))(M.Data_Eq_eqRecord(dictEqRecord)(M.Type_Proxy_Proxy)(ra)(rb)) + end + end + end + } + end + end + end +end +M.Control_Applicative_pure = function(dict) return dict.pure end +M.Control_Bind_bind = function(dict) return dict.bind end +M.Data_Generic_Rep_Inl = function(value0) + return { ["$ctor"] = "Data.Generic.Rep∷Sum.Inl", value0 = value0 } +end +M.Data_Generic_Rep_Inr = function(value0) + return { ["$ctor"] = "Data.Generic.Rep∷Sum.Inr", value0 = value0 } +end +M.Data_Generic_Rep_NoArguments = { + ["$ctor"] = "Data.Generic.Rep∷NoArguments.NoArguments" +} +M.Data_Eq_Generic_genericEqArgument = function(dictEq) + return { + genericEqPrime = function(v) + return function(v1) return M.Data_Eq_eq(dictEq)(v)(v1) end + end + } +end +M.Data_Eq_Generic_genericEqPrime = function(dict) return dict.genericEqPrime end +M.Data_Eq_Generic_genericEqConstructor = function(dictGenericEq) + return { + genericEqPrime = function(v) + return function(v1) + return M.Data_Eq_Generic_genericEqPrime(dictGenericEq)(v)(v1) + end + end + } +end +M.Data_Eq_Generic_genericEq = function(dictGeneric) + return function(dictGenericEq) + local from = dictGeneric.from + return function(x) + return function(y) + return M.Data_Eq_Generic_genericEqPrime(dictGenericEq)(from(x))(from(y)) + end + end + end +end +M.Effect_monadEffect = { + Applicative0 = function() return M.Effect_applicativeEffect end, + Bind1 = function() return M.Effect_bindEffect end +} +M.Effect_bindEffect = { + bind = M.Effect_foreign.bindE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_applicativeEffect = { + pure = M.Effect_foreign.pureE, + Apply0 = function() return M.Effect_Lazy_applyEffect(0) end +} +M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() + return { + map = function(f) + return function(a) + return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end + end + } +end) +M.Effect_Lazy_applyEffect = PSLUA_runtime_lazy("applyEffect")(function() + return { + apply = (function() + return function(f) + local bind = M.Control_Bind_bind(M.Effect_monadEffect.Bind1()) + return function(a) + return bind(f)(function(fPrime) + return bind(a)(function(aPrime) + return M.Control_Applicative_pure(M.Effect_monadEffect.Applicative0())(fPrime(aPrime)) + end) + end) + end + end + end)(), + Functor0 = function() return M.Effect_Lazy_functorEffect(0) end + } +end) +M.Golden_GenericEqTwoTypes_Test_genericEqSum = function(dictGenericEq1) + return { + genericEqPrime = function(v) + return function(v1) + if "Data.Generic.Rep∷Sum.Inl" == v["$ctor"] then + if "Data.Generic.Rep∷Sum.Inl" == v1["$ctor"] then + return M.Data_Eq_Generic_genericEqPrime(M.Data_Eq_Generic_genericEqConstructor({ + genericEqPrime = function() return function() return true end end + }))(v.value0)(v1.value0) + else + return false + end + else + if "Data.Generic.Rep∷Sum.Inr" == v["$ctor"] then + if "Data.Generic.Rep∷Sum.Inr" == v1["$ctor"] then + return M.Data_Eq_Generic_genericEqPrime(dictGenericEq1)(v.value0)(v1.value0) + else + return false + end + else + return false + end + end + end + end + } +end +M.Golden_GenericEqTwoTypes_Test_eqRec = function(dictEqRecord) + return { eq = M.Data_Eq_eqRecord(dictEqRecord)(M.Type_Proxy_Proxy) } +end +M.Golden_GenericEqTwoTypes_Test_eqRowCons = M.Data_Eq_eqRowCons({ + eqRecord = function() + return function() return function() return true end end + end +})() +M.Golden_GenericEqTwoTypes_Test_discard = (function(dictBind) + return M.Control_Bind_bind(dictBind) +end)(M.Effect_bindEffect) +M.Golden_GenericEqTwoTypes_Test_logShow = function(a) + return (function(s) return function() print(s) end end)((function(v) + if v then + return "true" + else + if false == v then + return "false" + else + return error("No patterns matched") + end + end + end)(a)) +end +M.Golden_GenericEqTwoTypes_Test_Leaf = { + ["$ctor"] = "Golden.GenericEqTwoTypes.Test∷Tree.Leaf" +} +M.Golden_GenericEqTwoTypes_Test_Node = function(value0) + return { + ["$ctor"] = "Golden.GenericEqTwoTypes.Test∷Tree.Node", + value0 = value0 + } +end +M.Golden_GenericEqTwoTypes_Test_Nil = { + ["$ctor"] = "Golden.GenericEqTwoTypes.Test∷List.Nil" +} +M.Golden_GenericEqTwoTypes_Test_Cons = function(value0) + return { + ["$ctor"] = "Golden.GenericEqTwoTypes.Test∷List.Cons", + value0 = value0 + } +end +M.Golden_GenericEqTwoTypes_Test_node = function(left) + return function(value) + return function(right) + return M.Golden_GenericEqTwoTypes_Test_Node({ + left = left, + value = value, + right = right + }) + end + end +end +M.Golden_GenericEqTwoTypes_Test_genericTree = { + to = function(x) + if "Data.Generic.Rep∷Sum.Inl" == x["$ctor"] then + return M.Golden_GenericEqTwoTypes_Test_Leaf + else + if "Data.Generic.Rep∷Sum.Inr" == x["$ctor"] then + return M.Golden_GenericEqTwoTypes_Test_Node(x.value0) + else + return error("No patterns matched") + end + end + end, + from = function(x) + if "Golden.GenericEqTwoTypes.Test∷Tree.Leaf" == x["$ctor"] then + return M.Data_Generic_Rep_Inl(M.Data_Generic_Rep_NoArguments) + else + if "Golden.GenericEqTwoTypes.Test∷Tree.Node" == x["$ctor"] then + return M.Data_Generic_Rep_Inr(x.value0) + else + return error("No patterns matched") + end + end + end +} +M.Golden_GenericEqTwoTypes_Test_genericList = { + to = function(x) + if "Data.Generic.Rep∷Sum.Inl" == x["$ctor"] then + return M.Golden_GenericEqTwoTypes_Test_Nil + else + if "Data.Generic.Rep∷Sum.Inr" == x["$ctor"] then + return M.Golden_GenericEqTwoTypes_Test_Cons(x.value0) + else + return error("No patterns matched") + end + end + end, + from = function(x) + if "Golden.GenericEqTwoTypes.Test∷List.Nil" == x["$ctor"] then + return M.Data_Generic_Rep_Inl(M.Data_Generic_Rep_NoArguments) + else + if "Golden.GenericEqTwoTypes.Test∷List.Cons" == x["$ctor"] then + return M.Data_Generic_Rep_Inr(x.value0) + else + return error("No patterns matched") + end + end + end +} +M.Golden_GenericEqTwoTypes_Test_eqTree = function(dictEq) + return { + eq = function(x) + return function(y) + return M.Data_Eq_Generic_genericEq(M.Golden_GenericEqTwoTypes_Test_genericTree)(M.Golden_GenericEqTwoTypes_Test_genericEqSum(M.Data_Eq_Generic_genericEqConstructor(M.Data_Eq_Generic_genericEqArgument(M.Golden_GenericEqTwoTypes_Test_eqRec(M.Data_Eq_eqRowCons(M.Data_Eq_eqRowCons(M.Golden_GenericEqTwoTypes_Test_eqRowCons({ + reflectSymbol = function() return "value" end + })(dictEq))()({ + reflectSymbol = function() return "right" end + })(M.Golden_GenericEqTwoTypes_Test_eqTree(dictEq)))()({ + reflectSymbol = function() return "left" end + })(M.Golden_GenericEqTwoTypes_Test_eqTree(dictEq)))))))(x)(y) + end + end + } +end +M.Golden_GenericEqTwoTypes_Test_eq = M.Data_Eq_eq(M.Golden_GenericEqTwoTypes_Test_eqTree(M.Data_Eq_eqInt)) +M.Golden_GenericEqTwoTypes_Test_eqList = function(dictEq) + return { + eq = function(x) + return function(y) + return M.Data_Eq_Generic_genericEq(M.Golden_GenericEqTwoTypes_Test_genericList)(M.Golden_GenericEqTwoTypes_Test_genericEqSum(M.Data_Eq_Generic_genericEqConstructor(M.Data_Eq_Generic_genericEqArgument(M.Golden_GenericEqTwoTypes_Test_eqRec(M.Data_Eq_eqRowCons(M.Golden_GenericEqTwoTypes_Test_eqRowCons({ + reflectSymbol = function() return "tail" end + })(M.Golden_GenericEqTwoTypes_Test_eqList(dictEq)))()({ + reflectSymbol = function() return "head" end + })(dictEq))))))(x)(y) + end + end + } +end +M.Golden_GenericEqTwoTypes_Test_eq1 = M.Data_Eq_eq(M.Golden_GenericEqTwoTypes_Test_eqList(M.Data_Eq_eqInt)) +M.Golden_GenericEqTwoTypes_Test_cons = function(head) + return function(tail) + return M.Golden_GenericEqTwoTypes_Test_Cons({ head = head, tail = tail }) + end +end +return M.Golden_GenericEqTwoTypes_Test_discard(M.Golden_GenericEqTwoTypes_Test_logShow(M.Golden_GenericEqTwoTypes_Test_eq1(M.Golden_GenericEqTwoTypes_Test_cons(1)(M.Golden_GenericEqTwoTypes_Test_cons(2)(M.Golden_GenericEqTwoTypes_Test_Nil)))(M.Golden_GenericEqTwoTypes_Test_cons(1)(M.Golden_GenericEqTwoTypes_Test_cons(2)(M.Golden_GenericEqTwoTypes_Test_Nil)))))(function( ) + return M.Golden_GenericEqTwoTypes_Test_discard(M.Golden_GenericEqTwoTypes_Test_logShow(M.Golden_GenericEqTwoTypes_Test_eq1(M.Golden_GenericEqTwoTypes_Test_cons(1)(M.Golden_GenericEqTwoTypes_Test_Nil))(M.Golden_GenericEqTwoTypes_Test_cons(2)(M.Golden_GenericEqTwoTypes_Test_Nil))))(function( ) + return M.Golden_GenericEqTwoTypes_Test_discard(M.Golden_GenericEqTwoTypes_Test_logShow(M.Golden_GenericEqTwoTypes_Test_eq(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(1)(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(2)(M.Golden_GenericEqTwoTypes_Test_Leaf)))(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(1)(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(2)(M.Golden_GenericEqTwoTypes_Test_Leaf)))))(function( ) + return M.Golden_GenericEqTwoTypes_Test_logShow(M.Golden_GenericEqTwoTypes_Test_eq(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(1)(M.Golden_GenericEqTwoTypes_Test_Leaf))(M.Golden_GenericEqTwoTypes_Test_node(M.Golden_GenericEqTwoTypes_Test_Leaf)(2)(M.Golden_GenericEqTwoTypes_Test_Leaf))) + end) + end) +end)() diff --git a/test/ps/output/Golden.HelloPrelude.Test/golden.ir b/test/ps/output/Golden.HelloPrelude.Test/golden.ir index e7afbf6..b7675b7 100644 --- a/test/ps/output/Golden.HelloPrelude.Test/golden.ir +++ b/test/ps/output/Golden.HelloPrelude.Test/golden.ir @@ -75,29 +75,40 @@ UberModule [ ( PropName "map", Abs Nothing ( ParamNamed Nothing ( Name "f" ) ) - ( App Nothing - ( ObjectProp Nothing + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing ( App Nothing ( ObjectProp Nothing - ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) ) - ( PropName "Apply0" ) - ) - ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) - ) - ( PropName "apply" ) - ) - ( App Nothing - ( App Nothing - ( Ref Nothing - ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ( PropName "apply" ) ) - ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) ) ) - ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) ) ) ) diff --git a/test/ps/output/Golden.HelloPrelude.Test/golden.lua b/test/ps/output/Golden.HelloPrelude.Test/golden.lua index 16977dd..8b4fad2 100644 --- a/test/ps/output/Golden.HelloPrelude.Test/golden.lua +++ b/test/ps/output/Golden.HelloPrelude.Test/golden.lua @@ -49,7 +49,9 @@ M.Effect_applicativeEffect = { M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() return { map = function(f) - return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f)) + return function(a) + return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end end } end) diff --git a/test/ps/output/Golden.Issue37.Test/golden.ir b/test/ps/output/Golden.Issue37.Test/golden.ir index 1019739..346ed34 100644 --- a/test/ps/output/Golden.Issue37.Test/golden.ir +++ b/test/ps/output/Golden.Issue37.Test/golden.ir @@ -86,29 +86,40 @@ UberModule [ ( PropName "map", Abs Nothing ( ParamNamed Nothing ( Name "f" ) ) - ( App Nothing - ( ObjectProp Nothing + ( Abs Nothing + ( ParamNamed Nothing ( Name "a" ) ) + ( App Nothing ( App Nothing ( ObjectProp Nothing - ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( App Nothing + ( ObjectProp Nothing + ( Ref Nothing + ( Imported + ( ModuleName "Effect" ) + ( Name "applicativeEffect" ) + ) 0 + ) + ( PropName "Apply0" ) + ) + ( Ref Nothing + ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 + ) ) - ( PropName "Apply0" ) + ( PropName "apply" ) ) - ( Ref Nothing ( Imported ( ModuleName "Prim" ) ( Name "undefined" ) ) 0 ) - ) - ( PropName "apply" ) - ) - ( App Nothing - ( App Nothing - ( Ref Nothing - ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 - ) - ( Ref Nothing - ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ( App Nothing + ( App Nothing + ( Ref Nothing + ( Imported ( ModuleName "Control.Applicative" ) ( Name "pure" ) ) 0 + ) + ( Ref Nothing + ( Imported ( ModuleName "Effect" ) ( Name "applicativeEffect" ) ) 0 + ) + ) + ( Ref Nothing ( Local ( Name "f" ) ) 0 ) ) ) - ( Ref Nothing ( Local ( Name "f" ) ) 0 ) + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) ) ) ) @@ -215,8 +226,12 @@ UberModule }, ObjectProp Nothing ( LiteralObject Nothing [ - ( PropName "discard", Ref Nothing - ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 + ( PropName "discard", Abs Nothing + ( ParamNamed Nothing ( Name "dictBind" ) ) + ( App Nothing + ( Ref Nothing ( Imported ( ModuleName "Control.Bind" ) ( Name "bind" ) ) 0 ) + ( Ref Nothing ( Local ( Name "dictBind" ) ) 0 ) + ) ) ] ) diff --git a/test/ps/output/Golden.Issue37.Test/golden.lua b/test/ps/output/Golden.Issue37.Test/golden.lua index fe39af7..cf75054 100644 --- a/test/ps/output/Golden.Issue37.Test/golden.lua +++ b/test/ps/output/Golden.Issue37.Test/golden.lua @@ -51,7 +51,9 @@ M.Effect_applicativeEffect = { M.Effect_Lazy_functorEffect = PSLUA_runtime_lazy("functorEffect")(function() return { map = function(f) - return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f)) + return function(a) + return (M.Effect_applicativeEffect.Apply0()).apply(M.Control_Applicative_pure(M.Effect_applicativeEffect)(f))(a) + end end } end) @@ -72,7 +74,9 @@ M.Effect_Lazy_applyEffect = PSLUA_runtime_lazy("applyEffect")(function() Functor0 = function() return M.Effect_Lazy_functorEffect(0) end } end) -M.Golden_Issue37_Test_discard = M.Control_Bind_bind +M.Golden_Issue37_Test_discard = function(dictBind) + return M.Control_Bind_bind(dictBind) +end return { baz = (function() return function(f) diff --git a/test/ps/output/Golden.NameShadowing.Test/golden.ir b/test/ps/output/Golden.NameShadowing.Test/golden.ir index a0cce51..8014d23 100644 --- a/test/ps/output/Golden.NameShadowing.Test/golden.ir +++ b/test/ps/output/Golden.NameShadowing.Test/golden.ir @@ -52,7 +52,7 @@ UberModule ) ), ( Name "c", Abs Nothing - ( ParamNamed Nothing ( Name "y" ) ) + ( ParamNamed Nothing ( Name "x" ) ) ( Abs Nothing ( ParamNamed Nothing ( Name "x1" ) ) ( App Nothing @@ -62,7 +62,7 @@ UberModule ) ( Ref Nothing ( Local ( Name "x1" ) ) 0 ) ) - ( Ref Nothing ( Local ( Name "y" ) ) 0 ) + ( Ref Nothing ( Local ( Name "x" ) ) 0 ) ) ) ) diff --git a/test/ps/output/Golden.NameShadowing.Test/golden.lua b/test/ps/output/Golden.NameShadowing.Test/golden.lua index 272f73a..fb96f85 100644 --- a/test/ps/output/Golden.NameShadowing.Test/golden.lua +++ b/test/ps/output/Golden.NameShadowing.Test/golden.lua @@ -10,7 +10,7 @@ return { return M.Golden_NameShadowing_Test_f(M.Golden_NameShadowing_Test_f(x)(x1))(M.Golden_NameShadowing_Test_f(42)(1)) end end, - c = function(y) - return function(x1) return M.Golden_NameShadowing_Test_f(x1)(y) end + c = function(x) + return function(x1) return M.Golden_NameShadowing_Test_f(x1)(x) end end } diff --git a/test/ps/output/Golden.RecursiveBindings.Test/golden.ir b/test/ps/output/Golden.RecursiveBindings.Test/golden.ir index a08c841..155d0a7 100644 --- a/test/ps/output/Golden.RecursiveBindings.Test/golden.ir +++ b/test/ps/output/Golden.RecursiveBindings.Test/golden.ir @@ -112,7 +112,13 @@ UberModule ] ), Standalone ( Nothing, Name "f", Abs Nothing ( ParamUnused Nothing ) - ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ( Abs Nothing + ( ParamNamed Nothing ( Name "k" ) ) + ( App Nothing + ( Ref Nothing ( Local ( Name "a" ) ) 0 ) + ( Ref Nothing ( Local ( Name "k" ) ) 0 ) + ) + ) ), Standalone ( Nothing, Name "y", App Nothing ( App Nothing diff --git a/test/ps/output/Golden.RecursiveBindings.Test/golden.lua b/test/ps/output/Golden.RecursiveBindings.Test/golden.lua index e6c3208..13547c0 100644 --- a/test/ps/output/Golden.RecursiveBindings.Test/golden.lua +++ b/test/ps/output/Golden.RecursiveBindings.Test/golden.lua @@ -59,7 +59,7 @@ return { local b a = function() return b(z) end b = function() return a(z) end - local f = function() return a end + local f = function() return function(k) return a(k) end end local y = f(z)(z) return f(f(y)(y))(f(y)(0)) end)()