Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
j14159 opened this issue Jan 15, 2018 · 0 comments
Open

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

j14159 opened this issue Jan 15, 2018 · 0 comments

Comments

@j14159
Copy link
Collaborator

j14159 commented Jan 15, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant