Skip to content

Allow case expressions without branches #2922

@no-longer-on-githu-b

Description

@no-longer-on-githu-b

Can be used for empty data decls such as Void. Proposed syntax is to leave off the of keyword.

data Void

absurd :: forall a. Void -> a
absurd = case _

Type inference may suffer. What would the inferred type of absurd be if no explicit type was given?

Issue about exhaustiveness checker exists elsewhere.

Not a breaking change, but existing code that uses data X as a short-hand for foreign import data X :: Type must be modified to use the latter; an empty data declaration is now truly an empty type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions