
Monads in Elixir - zabi_rauf
http://www.zohaib.me/monads-in-elixir-2/
======
pbowyer
> This post is not about what monads are, I expect that you already know about
> them.

And a good resource if you don't would be..?

I enjoyed watching [1] last week so I suspect I have seen the concept, even if
I don't grasp what's meant by a monad.

1\. [https://vimeo.com/113707214](https://vimeo.com/113707214)

~~~
zabi_rauf
I've seen the same video before i knew what a monad was, it helped me in
understanding the use case of monad and ultimately monad. Monad is just a
generalization of that particular use case. Some resources that helped me in
understanding monads

1\. Brian Beckman: Don't fear the Monad -
[https://www.youtube.com/watch?v=ZhuHCtR3xq8&feature=share](https://www.youtube.com/watch?v=ZhuHCtR3xq8&feature=share)

2\. Functors, Applicatives, And Monads In Pictures -
[http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html)

3\. Three Useful Monads - [http://adit.io/posts/2013-06-10-three-useful-
monads.html](http://adit.io/posts/2013-06-10-three-useful-monads.html)

So its been not just one resource but multiple resource before it hit me that
it was such a simple concept. So i would suggest to go over them (in order)
and also look at other resources (mentioned by others).

------
kaeluka
This is an example where you'd really want static types for ergonomics. Having
to name the monad explicitly does not allow to write generic code (i.e,
instead of saying `Maybe.return` to just say `return).

~~~
LesZedCB
Yes, in writing ruby during my day job, I often have conflicting feelings
about dynamic typing. The other advantage would be being able to do real
static analysis, I would love that.

~~~
rozap
In Elixir you can annotate functions with type signatures and then use a tool
like Dialyzer(1) to perform static analysis on the compiled bytecode. There is
tooling that integrates with mix in Elixir called which makes this easy(2)

1)
[http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.htm...](http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html)
2)
[https://github.com/jeremyjh/dialyxir](https://github.com/jeremyjh/dialyxir)

