Skip to content

Higher-Kinded types Not Expressible #396

@maxsnew

Description

@maxsnew

I don't know if this is a parser bug or if Elm just doesn't support this, but the following yield parse errors:

type Functor f = { map : (a -> b) -> f a -> f b }
and
data Ap f a = Ap (f a)

This means you can't define higher-kinded things like Functor/Applicative/Monad/Foldable and do dictionary-passing style for ad-hoc polymorphism.

You can do first-order things like Monoid though:
type Monoid m = { unit : m, op : m -> m -> m }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions