On Mon, 2008-10-13 at 18:28 +0100, Andrew Coppin wrote:
Reid Barton wrote:
It's not difficult: the operation is called
mplus :: MyMonad a - MyMonad a - MyMonad a
and already exists (assuming the author of ListT has not forgotten to
write a MonadPlus instance).
I see... I was
Reid Barton wrote:
It's not difficult: the operation is called
mplus :: MyMonad a - MyMonad a - MyMonad a
and already exists (assuming the author of ListT has not forgotten to
write a MonadPlus instance).
I see... I was under the impression that mplus is just any arbitrary
binary
Jonathan Cast wrote:
I see... I was under the impression that mplus is just any arbitrary
binary operation over a given monad. How do you know what it does for a
specific monad?
Process of elimination. Sometimes, this doesn't narrow things down to a
single operation, but it gives you a
On Mon, 2008-10-13 at 18:58 +0100, Andrew Coppin wrote:
Jonathan Cast wrote:
I see... I was under the impression that mplus is just any arbitrary
binary operation over a given monad. How do you know what it does for a
specific monad?
Process of elimination. Sometimes, this
On Mon, 13 Oct 2008, Andrew Coppin wrote:
Reid Barton wrote:
It's not difficult: the operation is called
mplus :: MyMonad a - MyMonad a - MyMonad a
and already exists (assuming the author of ListT has not forgotten to
write a MonadPlus instance).
I see... I was under the impression that
Hi Andrew,
On Mon, Oct 13, 2008 at 19:58, Andrew Coppin
[EMAIL PROTECTED] wrote:
Right. OK. So... isn't there a class somewhere called MonadChoice or
similar, which defines (|)?
Just to pitch in a helpful tip, Hoogle is excellent for these kind of
questions (which come up very often):
Dino Morelli wrote:
I was wishing I could do this:
let foo = str `or-if-empty` default
If it was a Maybe, this works with mplus:
(Just foo) `mplus` (Just bar) == Just foo
Nothing `mplus` (Just bar) == Just bar
But not so much for list, mplus just ain't defined that way,
I am becoming extremely frustrated now. The task I want to perform is
simple, yet I simply cannot make Haskell do what I want.
I've given up hope of ever getting my program to handle infinite result
sets. That means I can make do with just ListT. So I have the following
monad:
type MyMonad
On Sun, 2008-10-12 at 18:08 +0100, Andrew Coppin wrote:
I am becoming extremely frustrated now. The task I want to perform is
simple, yet I simply cannot make Haskell do what I want.
I've given up hope of ever getting my program to handle infinite result
sets. That means I can make do with
On 12 Oct 2008, at 21:08, Andrew Coppin wrote:
I found that by using the brief and easily memorable construction
runIdentity $ runListT $ runStateT foo state I can get at the
result set for each action, and combine them. But nothing in hell
seems to transform this from [((), MyState)]
On Sun, Oct 12, 2008 at 1:08 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
I am becoming extremely frustrated now. The task I want to perform is
simple, yet I simply cannot make Haskell do what I want.
I've given up hope of ever getting my program to handle infinite result sets.
Did you miss
David Menendez wrote:
On Sun, Oct 12, 2008 at 1:08 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
I am becoming extremely frustrated now. The task I want to perform is
simple, yet I simply cannot make Haskell do what I want.
I've given up hope of ever getting my program to handle infinite result
12 matches
Mail list logo