Haskell web programming - 0 views
The Flying Frog Blog: Purely functional games (tetris clone in haskell) - 0 views
Typed type-level programming in Haskell, part I: functional dependencies « bl... - 0 views
Applicative-what? Functor-who? « wxfz :: Blog - 0 views
-
Monads Are a kind of abstract data type used to represent computations (instead of data in the domain model).
Why we use Haskell - lablog - 0 views
Hope - About Hope - 2 views
Understanding Monads Via Python List Comprehensions « All Unkept - 0 views
-
But here we have taken it to a higher level -- the Monad interface is like an abstraction of any kind of container.
-
This in turn leads to the concept that a monadic value represents a computation -- a method for computing a value, bound together with its input value.
-
Writing monads is hard, but it pays off as using them in Haskell is surprisingly easy, and allows you to do some very powerful things.
- ...3 more annotations...
A Neighborhood of Infinity: Haskell Monoids and their Uses - 0 views
-
The Writer MonadYou can think of monoids as being accumulators. Given a running total, n, we can add in a new value a to get a new running total n' = n `mappend` a. Accumulating totals is a very common design pattern in real code so it's useful to abstract this idea. This is exactly what the Writer monad allows. We can write monadic code that accumulates values as a "side effect". The function to perform the accumulation is (somewhat confusingly) called tell. Here's an example where we're logging a trace of what we're doing.
-
This is an implementation of the factorial function that tells us what it did.
-
We use runWriter to extract the results back out. If we run> ex1 = runWriter (fact1 10)we get back both 10! and a list of what it took to compute this.
- ...6 more annotations...
A Neighborhood of Infinity: The IO Monad for People who Simply Don't Care - 0 views
-
Many programming languages make a distinction between expressions and commands.
-
Like other languages it makes the distinction, and like other languages it has its own slightly idiosyncratic notion of what the difference is. The IO monad is just a device to help make this distinction.
-
There is no room for anything like a print command here because a print command doesn't return a value, it produces output as a side-effect
- ...18 more annotations...
1 - 16 of 16
Showing 20▼ items per page