[ALGOM-3] Bug in writer-monad-protocol for lists Created: 18/Apr/12 Updated: 05/Feb/14 Resolved: 05/Feb/14
|Reporter:||Greg Chapman||Assignee:||Konrad Hinsen|
Clojure 1.4, Java 1.7, Windows 7
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:
|Comment by Konrad Hinsen [ 05/Feb/14 5:45 AM ]|
I fixed this using a somewhat different approach: ensure that the return type of writer-m-combine is a list if it is called with list arguments:
I prefer this solution because ISeq is implemented by so many types that a writer-m-combine implementation for this protocol may well cause trouble elsewhere.