A monad in programming is a composable computation description. Monads are an important construct in functional programming languages like Haskell.

learn more… | top users | synonyms

10
votes
1answer
141 views

Probably unneeded returns

This is my first "useful" Haskell program. It's invoked with filenames as arguments where the last filename is the destination to which the content of all other files will be concatenated. As far as I ...
6
votes
2answers
209 views

An Either Monad in Java

Interested in a review of this code, in particular the (hopefully monadic) bind. I actually put this to good use. It was a nice complement to Guava's Optional, and shorter than: ...
6
votes
1answer
51 views

Monadic Immutable Linked List in the Least Functional Language Evar

I've written a List monad as an example for a related question. This is a rather frustrating experience as I wanted to use Java, which (as of Java 7) still lacks lambda expressions and lacks ...
6
votes
2answers
91 views

A monad in Java (FriendSpace and People)

After asking a similar question on Stack Overflow, I'm picking up on the answer there to improve my monad. I'm not trying to solve the general case, just come up with one to see how it works. If I'm ...
2
votes
1answer
94 views

Is this a reasonable Scala monad?

I found myself writing code of the form... ...
4
votes
0answers
672 views

Performance of List representation of MonadPlus versus Tree representation

I am working on a code where I represent a MonadPlus using a Tree data structure and then explore it, summing over all of the ...
1
vote
0answers
121 views

Scalaz state monad exercise

I can't tag this with scalaz and state-monad yet since I don't have sufficient reputation to add tags. Below is a self imposed exercise and solution to learn Scalaz state monad. How can I ...
3
votes
2answers
576 views

C# state monad implementation

I want to know whether this thing I wrote in C# is a correct implementation of the state monad. I've used it in code and it does what I expect it to do, but I'm still not quite sure if I'm doing this ...
19
votes
0answers
564 views
+50

How can I make my stack monad faster?

I made a stack monad that lets one manipulate and control values on a stack. I want to know if it's correct, (it seems correct), how to make it faster, and how I could detect stack overflows without ...