6 ms·
I would love to learn what a nomad is. Can you explain what it is to someone who already is programming for many years? I just find the Wikipedia article very
by simplehuman 10y ago
I would love to learn what a nomad is. Can you explain what it is to someone who already is programming for many years? I just find the Wikipedia article very hard
- simplehuman 10y agoI hope everyone had fun because of my typo :)
- pryelluw 10y agoIts pretty much a way to chain functions together in order to do something. This is a good read: http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/MONADS/Noel/research/monads.html http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/MONADS...
- cosinetau 10y agoA nomad is something that goes "nom!" ;) A monad is basically an function, in the algebra sense, that will take a set of input, and map it to a different output. That's the most simple definition I can give without getting into the math, and it's been a minute since I've really gotten into Group theory. Maybe through a Haskell tutorial for some hands-on guidance? http://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters https://www.youtube.com/watch?v=9QveBbn7t_c https://www.youtube.com/watch?v=9QveBbn7t_c
- lmm 10y agoA nomad is a wanderer. A monad is just a particular abstract interface that turns out to come up a lot and so lead to very reusable code. It's hard to talk about monads in general because the concept is very abstract, I find the best thing is to understand a couple of specific examples first (Writer and Future are good simple cases, and then Nondeterminism or Continuation gives you some idea of the powerful things you can do) and then try to work up from there to the abstract part that unifies all these things and lets you write general-purpose functions that will work with any of them. http://m50d.github.io/2013/01/16/generic-contexts http://m50d.github.io/2013/01/16/generic-contexts is an explanation of a case where I found myself using the Applicative interface - Monad is very similar to Applicative (it just adds one extra possible operation).
- shae 10y agoMy favorite description of monads is "decorators for function composition". You write a chunk of code to compose functions in one place. That turns out to be extremely useful in many cases. Even so, I don't believe that monads are the only way to write good code.
- btilly 10y agoMonads are like burritos. This is explained very well at http://blog.plover.com/prog/burritos.html http://blog.plover.com/prog/burritos.html. In short they are way to automate building new types out of old types in such a way that code written for the old types can immediately be turned into code written for the new types. This allows a lot of otherwise repetitive code that you might otherwise wind up writing to be pushed to your type system. Which in turn makes it feasible to build a richer type system. Haskell takes this idea to an extreme.