chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] [ANN] Monad Egg


From: Jörg F . Wittenberger
Subject: Re: [Chicken-users] [ANN] Monad Egg
Date: 13 Apr 2012 22:06:37 +0200

On Apr 13 2012, Daniel Leslie wrote:

I have written a small egg to ease the usage of lazily-evaluated monads.

Very welcome!

But there's one thing I find confusing.

You posting continues with this example identical to the one in
the "Basic Monads" section.

For example, after defining the identity monad:

(define-monad
  <id>
  (lambda (a) a)
  (lambda (a f) (f a)))

However the "Description" section introduces the bind function
with the "f" and "a" parameters exchanged:

For instance, the identity monad is:

1. Bind: (lambda (f a) (f a))

So far I fail to see a reason.

Short of other arguments I'd prefer the latter one as more
consistent.

One more question: would it be feasible to support
multi-valued monads like this made up one:

(define-monad
  <complex-id>
  (lambda (r i) (values r i))
  (lambda (f r i) (f r i)))

best regards

/Jörg

.....



reply via email to

[Prev in Thread] Current Thread [Next in Thread]