alpaca icon indicating copy to clipboard operation
alpaca copied to clipboard

Defining the function (>>) does not yield a helpful error

Open j14159 opened this issue 6 years ago • 0 comments

Given:

module m

let (>>) f g x =
  g (f x)

The Alpaca compiler will crash in alpaca_scanner:infer_breaks/1 with a bad match here because inferring breaks tracks whether or not the procedure is inside a binary expression.

Expected: at minimum, a syntax error as we see when defining the function (<<) though perhaps the ideal is to say "this is not legal for use outside a binary expression" or something like that. Maybe we need a set of "symbols" like <<, >>, | that are not permitted as function names?

j14159 avatar Jan 15 '18 17:01 j14159