This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Description
let x <|> y =
match x with
| Some _ -> x
| None -> y
let chainr1 p op =
let rec scan =
let! x = p
rest x
and rest x =
( let! f = op
let! y = scan
pure (f x y)
) <|> pure x
scan
This code oughtta be compiled something like:
local scan, rest
scan = bind(dict)(p)(function(x)
return rest(x)
end)
rest = ...
But, nah, amc eta-contracts the fun x -> rest x into just rest, which forces it early, which results in attempt to call nil.
local scan, rest
scan = _greater_greater_equals(p, rest)
rest = function(x)