[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. |
[ALGOM-9] Replace calls to deprecated functions Created: 28/Oct/12 Updated: 28/Oct/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Andy Fingerhut | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
There are several calls to replicate, which was deprecated in Clojure 1.3. Recommended replacement is repeat, which was added in 1.0. |
| Comments |
| Comment by Andy Fingerhut [ 28/Oct/12 5:23 PM ] |
|
algom-9-replace-calls-to-deprecated-fns-v1.txt dated Oct 28 2012 replaces calls to replicate with repeat. |
[ALGOM-6] algo.monads README has no artifacts information Created: 14/Sep/12 Updated: 14/Sep/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Andy Fingerhut | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
algo.monads README has no artifacts information and does not conform to the Contrib README standards in any way. Because clojure-dev is a closed group, I am filing it here. (originally filed by Michael Klishin in project CLJ, but seems to belong better here) |
[ALGOM-5] continuation monad can easily overflow stack Created: 10/Sep/12 Updated: 10/Sep/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | ben wolfson | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The continuation monad uses tail calls, and because they aren't optimized out it's vulnerable to stack overflows for large computations: ;; there is a function clojure.algo.monads/m-reduce, but it has a (defn add [s] (add (range 1 10000)) ;; stack overflow Can be worked around with a trampoline: (defmonad cont-tramp-m (defn call-cc-tramp [f] (defn run-cont-tramp [cont] (defn add2 [s] (add2 (range 1 1000000)) ;; -> 1 |
| Comments |
| Comment by ben wolfson [ 10/Sep/12 12:01 PM ] |
|
I neglected to include m-result-cont and m-bind-cont for the cont-tramp-m call! (defn m-result-cont [v] (fn [c] [c v ::cont])) (defn m-bind-cont [mv f] (fn [c] [mv (fn [v] [(f v) c ::cont ]) ::cont])) |
[ALGOM-4] algo.monad state-m fetch-val bug and efficiency issue Created: 08/Sep/12 Updated: 08/Sep/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Sacha De Vos | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | bug, performance | ||
| Environment: |
irrelevant |
||
| Description |
|
;; the bug (defn fetch-val ;; I propose replacing it with (get s key) ;; the efficiency issue : (defn fetch-val ;; - we avoid the monad map lookups |
[ALGOM-3] Bug in writer-monad-protocol for lists Created: 18/Apr/12 Updated: 18/Apr/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Greg Chapman | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Clojure 1.4, Java 1.7, Windows 7 |
||
| Attachments: |
|
| Description |
|
The writer-monad-protocol for lists uses concat in writer-m-combine, the result of which has type LazySeq. However, LazySeq does not have an implementation in writer-monad-protocol (the first example, using vectors, shows expected output): {{ I suggest changing the protocol extension to ISeq as in the attached diff. With that change: {{ |
[ALGOM-1] Add conditionals stratements to domonad forms Created: 06/Jan/12 Updated: 10/Jan/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Roman Gonzalez | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
The extension was developed in Mac OS X Lion |
||
| Attachments: |
|
| Patch: | Code |
| Description |
|
I implemented a patch that would allow us to do conditionals on domonad macros Example: (domonad monad-m Conditional blocks can be nested. One gotcha one has to be aware of is: you may use bindings from a conditional branch in the m-result sexp as long as that branch gets called, given that one doesn't know for sure which branch is going to be called, you should set the same bindings on both branches. The patch code is on: github.com/roman/algo.monads I didn't do a pull request given that you need to this first. NOTE: I've added this feature in some other projects I've been working on (parser combinators) and is working perfectly so far, there is tests in the patch but I wanted to give you that safe net as well. |
| Comments |
| Comment by Roman Gonzalez [ 10/Jan/12 12:28 AM ] |
|
Adding support for monadic conditionals on the domonad macro |
[ALGOM-8] Cosmetic change in maybe-m Created: 12/Oct/12 Updated: 12/Oct/12 |
|
| Status: | Open |
| Project: | algo.monads |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Trivial |
| Reporter: | Edward Tsech | Assignee: | Konrad Hinsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Diff: |