News for hackers. Stuff that matters.
Re:Real World Haskell by girishso on Friday November 06, 2020 @04:32AM (#25006345)
You might want to give a try to Elm. Most of the Haskell goodies but way simpler, except no type classes and too restrictive.
Re:Real World Haskell by tasuki on Friday November 06, 2020 @07:31AM (#25007143)
+1 for Elm to learn Haskell. It is indeed way simpler, and has very friendly error messages. It lets you concentrate on grokking the basics: no side effects, pattern matching, recursion, currying.

After some time you start wondering why you have to type `List.map` and `Maybe.map` and `Set.map` when they all do the same thing. Then you'll be ready for some Haskell :)

Re:Real World Haskell by cies on Friday November 06, 2020 @05:19AM (#25006540)
Then PureScript also deserves a mention. It has several frameworks (some akin to the one built in in Elm). If you want to do this in Haskell (which is a lot harder) you may want to look at Miso.
Re:Real World Haskell by tiew9Vii on Friday November 06, 2020 @07:57PM (#25012498)
Not used Elm since early 2014 and heard it’s changed a bit since then.

Elm was a great Trojan horse. It limited feature set made it quick to learn and get familiar with the syntax.

When sufficiently proficient in Elm you then find yourself missing some of the features of Haskell i.e. higher kinder types. At that stage Purescript / Haskell is a natural transition as they feel familiar but with more functionality.

Re:Real World Haskell by miguendes on Friday November 06, 2020 @09:11AM (#25007668)
Thanks for the suggestion. I've heard people suggesting Elm on reddit but in terms of learning materials there isn't much compared to haskell. But I think that shouldn't be much of a problem.

I know that Elm works great for front end but how is it for desktop and backend stuff?

Re:Real World Haskell by piaste on Friday November 06, 2020 @09:17AM (#25007722)
> I know that Elm works great for front end but how is it for desktop and backend stuff?

It isn't. It's explicitly designed as a purely web front-end language, that's its scope.

Of course, many Elm users like to run another ML-family language in the backend as well. Haskell's Servant backend library, the one used in this article, has a project to automatically generate Elm client code [1]. Elixir is popular as well.

But in general, I'd say that any backend framework that can provide an OpenAPI spec will work well, as you'll be able to auto-generate most if not all of the Elm client code (which is normally dull work and one of the main complaints about Elm).

[1] https://github.com/haskell-servant/servant-elm

Re:Real World Haskell by tasuki on Friday November 06, 2020 @09:50AM (#25007940)
Yes, no desktop and backend. It might be possible to use Elm outside of web frontend, but probably wouldn't be much fun.

> in terms of learning materials there isn't much compared to haskell.

To whet your apetite, see https://elm-lang.org/

Then read through the excellent https://guide.elm-lang.org/ - not very long but absolutely enough to hit the ground running.

Re:Real World Haskell by girishso on Friday November 06, 2020 @10:51AM (#25008470)
Agreed official elm guide is more than enough to get “started” with real world examples.
Re:Real World Haskell by dmix on Friday November 06, 2020 @05:03AM (#25006481)
Learning Haskell sideways is a good approach. There are so many usecases in JS as well and Typescript has made it all the better (but not nearly so restrictive).