roc/test/snapshots/expr/lambda_with_args.md
2025-11-19 10:31:11 -05:00

678 B

META

description=Lambda with multiple arguments
type=expr

SOURCE

|x, y| x + y

EXPECTED

NIL

PROBLEMS

NIL

TOKENS

OpBar,LowerIdent,Comma,LowerIdent,OpBar,LowerIdent,OpPlus,LowerIdent,
EndOfFile,

PARSE

(e-lambda
	(args
		(p-ident (raw "x"))
		(p-ident (raw "y")))
	(e-binop (op "+")
		(e-ident (raw "x"))
		(e-ident (raw "y"))))

FORMATTED

NO CHANGE

CANONICALIZE

(e-lambda
	(args
		(p-assign (ident "x"))
		(p-assign (ident "y")))
	(e-binop (op "add")
		(e-lookup-local
			(p-assign (ident "x")))
		(e-lookup-local
			(p-assign (ident "y")))))

TYPES

(expr (type "a, a -> a"))