dex-lang icon indicating copy to clipboard operation
dex-lang copied to clipboard

Can't put functions in structs or data constructors

Open duvenaud opened this issue 2 years ago • 0 comments

I'm trying to make a custom datatype that carries around a function. This used to work, but seems to have been broken by the new syntax. For example:

data SortsBy(a) =
  MkSortsBy(less_than:(a -> Bool))
Syntax error: Argument types should be in parentheses

  MkSortsBy(less_than:(a -> Bool))
                         ^^^

If this change was deliberate, then the error message is confusing.

duvenaud avatar Oct 08 '23 21:10 duvenaud