News for hackers. Stuff that matters.
Re:Show HN: Learn Functional Programming Using Haskell by dmix on Tuesday August 02, 2016 @11:08AM (#12210482)
One benefit of learning Haskell if you're a JS developer is that you'll understand how awesome Purescript is and will already know how to use it: http://www.purescript.org/

It was for me at least. As a front-end dev I'm not always able to use Haskell day-to-day but I've found ways to use Purescript.

Re:Show HN: Learn Functional Programming Using Haskell by wry_discontent on Tuesday August 02, 2016 @11:19AM (#12210566)
How would you say Purescript compares to something like Elm?
Re:Show HN: Learn Functional Programming Using Haskell by dmix on Tuesday August 02, 2016 @01:17PM (#12211469)
The Elm wikipedia page has a good example of it's limitations compared to PureScript/Haskell:

> Unlike Haskell, Elm has no support for higher-kinded types, and thus cannot provide generic abstractions for many common operations.[20] For example, there is no generic map, apply, fold, or filter function. Instead, such names are used prefixed by their module, such as List.map and Dict.map. [1]

And from the above source link:

> You can't define higher-kinded things like Functor/Applicative/Monad/Foldable and do dictionary-passing style for ad-hoc polymorphism in Elm. [2]

But personally, I haven't tried Elm yet so I can't comment. I'm not sure I want to invest in learning a whole new language/framework just to do front-end work. By learning PureScript I can transfer the same knowledge/experience coding in that language to the backend when using Haskell. Much like Clojurescript and a lesser extent Node.js. While Elm is limited to front-end use.

[1] https://en.wikipedia.org/wiki/Elm_(programming_language)#Lim...

[2] https://github.com/elm-lang/elm-compiler/issues/396

Re:Show HN: Learn Functional Programming Using Haskell by hellofunk on Tuesday August 02, 2016 @01:20PM (#12211485)
> By learning PureScript I transfer the same skillset to the backend

do you mean "frontend" ?

Re:Show HN: Learn Functional Programming Using Haskell by dmix on Tuesday August 02, 2016 @02:43PM (#12212207)
No I mean the better I get at PureScript programming the better I will be at Haskell. As the syntax is very similar and the programming paradigm (purity, algebraic data types, etc).

Elm is a niche platform without applications outside of front-end (AFAIK).

Re:Show HN: Learn Functional Programming Using Haskell by nilkn on Tuesday August 02, 2016 @11:23AM (#12210600)
As a very superficial comparison, PureScript is a lot more similar to Haskell than to Elm. All three are great languages, but of the three Elm is definitely the simplest and IMHO most beginner-friendly. It's also the least flexible and general.

In many ways, PureScript is actually a better version of Haskell (e.g., with extensible records). But it's currently very focused on front-end development, and it's missing amazing Haskell features like STM. So outside of front-end stuff it's not nearly as practical to use as Haskell.