Is it fair to say abstraction and expressiveness are Elm's weak points?


#23

I would also like to add that type-classes can be done in Elm. Not everything that can be done in Haskell is possible, but there are still many ways in which they can be used effectively in Elm. Here is an example:

And see the implementations of the Buffer class on lines 287, 304 and 314.


#24

Very rudimentary typeclasses are possible, but neither higher-kinded classes [1] nor hierarchies [2] are supported.

[1] can’t have higher-kinded types - apparently the type aliases compile (bug), but you can’t use them
[2] http://reasonablypolymorphic.com/blog/elm-is-wrong/


#25

Hi, here is my take after 4 years of Haskell, and several months of Elm and front-end stuff.

I think that the most important piece in FP is Functors. Elm has them, albeit in many flavours as the typeclasses are not there to help factor the code.

Typeclasses does not bring additional power to the application developper, because in that case a union type can handle all the given cases. It seems to me on the other that library development would greatly benefit from typeclasses, because then you can define typeclasses for cases you cannot know yet.

The aim of Elm being to develop front end applications, I must admit (reluctantly because I love those abstraction stuff) that the balance between power and simplicity is good as it is.


#26

I personallly would love Elm to have Zygohistomorphic prepromorphisms

Not to use them of course, since it is utterly out of my intellectual reach. But I kinda like the idea of added expressiveness (of course they are joke also in Haskell…)


#27

I must have read about 3 text books on Haskell, and somehow never got past the Monads chapter on all of them. I think Elm has hit the sweet spot, as you say, somewhere between power and simplicity that is just right.


#28

I think that when you understand what all the andThen functions have in common you can read the Monads chapter and get it easily.

After all:

Maybe.andThen : (a -> Maybe b) -> Maybe a -> Maybe b

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1

#29

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.