[ALGOM-7] maybe-m breaks the monad laws. Created: 15/Sep/12 Updated: 15/Sep/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Seth J. Gold | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
One of the monad laws is that (m-bind (m-result v) f) should be the same as (f v). However, this is not the case in maybe-m: user=> (with-monad maybe-m (m-bind (m-result nil) nil?)) user=> (nil? nil) The crux of the problem is that in algo.monad's maybe-m, there is no way to wrap a nil in a Just-like container. |
| Comments |
| Comment by Seth J. Gold [ 15/Sep/12 3:27 PM ] |
|
Just realized that that demonstration doesn't actually work, because the function passed to m-bind is supposed to return a monadic value. Here's a better one: user=> (with-monad maybe-m (m-bind (m-result nil) (comp m-result nil?))) |
[ALGOM-2] Adding support for both :if-:then-:else and :cond statements on domacro implementations Created: 21/Jan/12 Updated: 24/Jan/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Major |
| Reporter: | Roman Gonzalez | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Mac OS X Lion |
||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
This patch contains the same features as http://dev.clojure.org/jira/browse/ALGOM-1 plus a new one, the ability to add :cond statements using the domonad macro. More info can be found on the commit history of the given patch. |
| Comments |
| Comment by Roman Gonzalez [ 24/Jan/12 11:15 AM ] |
|
This is a new version of the patch that handles the conflicts with whitespaces vs tabs. |