Compiler: Higher-Kinded types Not Expressible

Created on 19 Dec 2013  Â·  4Comments  Â·  Source: elm/compiler

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 }

request

Most helpful comment

but but but... the types...

All 4 comments

Yeah, @johnpmayer and I have talked about this. It's lame, but it's nontrivial to add and is not critical for most cases.

I feel like this can safely be closed, 18+ months later. :wink:

but but but... the types...

This is a known feature request that I have in my rough roadmap. This issue won't be the major factor in any decision about when/if this gets added, so I am going to close in an effort to clear out the issues here.

Earlier on, it was okay to handle feature requests on this repo, but it's not working out anymore. So I want this repo to be more for bugs and such. We will do project and feature planning in a different way.

Was this page helpful?
0 / 5 - 0 ratings