everyone keeps talking about monads and monadic style and Haskell. i can't find much information or tutorial on haskell monads.
Well, "nomads" are people who wander from place to place. I assume you mean "monads". :-)
That's a very tricky question. Wikipedia has some information, and tons of tutorials are available around the web.. In a nutshell, a monad is a type constructor with associated functions which behave according to certain laws. Incidentally, a type constructor is what languages like Java or C++ might call a generic instantiation (e.g. List<String>
). The two main monadic methods:
unit
- Wraps up the relevant data within an instance of the monad. For example, theunit
function for theOption
monad in Scala would be used as follows:Some(42)
.bind
- This is the important (and confusing) one. This function has the following signature for some monadic typeM
:bind(M[A], (A)=>M[B]): M[B]
. Thus, it is a function which takes a monad of "component type"A
, unwraps it and passes the value to the specified function value, which returns another instance of the monad with component typeB
. The final result of the function is a (possibly the returned) instance of the monad with component typeB
.
The applications of monads are almost innumerable; they are quite literally everywhere, even in imperative languages. If you actually play around with Haskell a bit, you'll find yourself using them constantly. That's probably the best way to get a handle on them: see how they're used in real-world algorithm design.
Nomadic people, (from the Greek: νομάδες, nomádes, "those who let pasture herds"), also known as nomads, are communities of people that move with cattle from one place to another, rather than settling down in one location. They aren't renown for their coding abilities, reliable electricity being hard for them to come by, but give them a place to plug their laptops into and they'll soon be hammering away on their keyboards. In fact, early powersaving support was added to Linux by an anonymous desert wanderer, and the hobo community of Los Angeles were responsible for roaming support in FreeBSD.