Live data from Hacker News

Functional Programming Patterns

slideshare.net

1–10 of 70 posts

Re: Functional Programming Patterns

#2
This a good read. I like the railway analogy.

"Functional Programming in Scala" is also well worth a read as well if you're trying to learn FP... I've found it to be excellent, especially since it has lots of exercises to use for practice.

Re: Functional Programming Patterns

#3
I thank the lord every day that the language I work in (Javascript) supports functions! I try to write pure functions as often as possible, so it's easy to refactor the code when I come back three months later.

But is there, except for Clojurescript, any true (like Haskell) FP language for browsers? Something that has the tools, and community to back it, so it's viable to actually make projects in it?

Re: Functional Programming Patterns

#4
post #3

I thank the lord every day that the language I work in (Javascript) supports functions! I try to write pure functions as often as possible, so it's easy to refactor the code when I come back three months later. But is there, except for Clojurescript, any true (like Haskell) FP language for browsers? Something that has the tools, and community to back it, so it's viable to actually make projects in it?

Elm is worth checking out: http://elm-lang.org/

Re: Functional Programming Patterns

#5
post #3

I thank the lord every day that the language I work in (Javascript) supports functions! I try to write pure functions as often as possible, so it's easy to refactor the code when I come back three months later. But is there, except for Clojurescript, any true (like Haskell) FP language for browsers? Something that has the tools, and community to back it, so it's viable to actually make projects in it?

The most Haskell-like and popular are:

- http://www.purescript.org/

- https://github.com/faylang/fay

- https://github.com/ghcjs/ghcjs

- http://elm-lang.org/

Each has it's own focus and strengths and weaknesses.

There is a long page on the Haskell wiki on the subject: https://www.haskell.org/haskellwiki/The_JavaScript_Problem

Michael Snoyman gave a really good talk recently which covers GHCJS and Fay: https://www.youtube.com/watch?v=XfINRj5OzGw

Re: Functional Programming Patterns

#6
A good read, I especially like the parts about error handling and maps/applicatives. They are well-illustrated and tackle some difficult common problems I had shortly after I started using functional languages.

The part about functors/monads/monoids is also nice, although I feel like it would be better with the accompanying talk to bind it together a bit more.

Re: Functional Programming Patterns

#8
post #3

I thank the lord every day that the language I work in (Javascript) supports functions! I try to write pure functions as often as possible, so it's easy to refactor the code when I come back three months later. But is there, except for Clojurescript, any true (like Haskell) FP language for browsers? Something that has the tools, and community to back it, so it's viable to actually make projects in it?

I use LiveScript. Sadly it's not typed. But with it's standard lib prelude.ls it makes a nice package.
Post reply on HN