Skip to content

Can't put functions in structs or data constructors #1338

@duvenaud

Description

@duvenaud

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions