mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
1.4 KiB
1.4 KiB
META
description=Lambda inside a collection
type=expr
SOURCE
(
|
a,
b,
| {
a + b
},
|a, b| {
a - b
},
)
EXPECTED
NIL
PROBLEMS
NIL
TOKENS
OpenRound,
OpBar,
LowerIdent,Comma,
LowerIdent,Comma,
OpBar,OpenCurly,
LowerIdent,OpPlus,LowerIdent,
CloseCurly,Comma,
OpBar,LowerIdent,Comma,LowerIdent,OpBar,OpenCurly,
LowerIdent,OpBinaryMinus,LowerIdent,
CloseCurly,Comma,
CloseRound,
EndOfFile,
PARSE
(e-tuple
(e-lambda
(args
(p-ident (raw "a"))
(p-ident (raw "b")))
(e-block
(statements
(e-binop (op "+")
(e-ident (raw "a"))
(e-ident (raw "b"))))))
(e-lambda
(args
(p-ident (raw "a"))
(p-ident (raw "b")))
(e-block
(statements
(e-binop (op "-")
(e-ident (raw "a"))
(e-ident (raw "b")))))))
FORMATTED
NO CHANGE
CANONICALIZE
(e-tuple
(elems
(e-lambda
(args
(p-assign (ident "a"))
(p-assign (ident "b")))
(e-block
(e-binop (op "add")
(e-lookup-local
(p-assign (ident "a")))
(e-lookup-local
(p-assign (ident "b"))))))
(e-lambda
(args
(p-assign (ident "a"))
(p-assign (ident "b")))
(e-block
(e-binop (op "sub")
(e-lookup-local
(p-assign (ident "a")))
(e-lookup-local
(p-assign (ident "b"))))))))
TYPES
(expr (type "(c, c -> c, d, d -> d)"))