]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/monads/monads.factor
monads: fix ordering of writer monad logs.
[factor.git] / extra / monads / monads.factor
index 485e5431605af1b6ab7c9724c969eed5972cbe1c..19ac7f8c076eafd12105172c1e020aa300a79d88 100644 (file)
@@ -188,7 +188,7 @@ M: writer-monad fail   "Fail" throw ;
 
 : run-writer ( writer -- value log ) [ value>> ] [ log>> ] bi ;
 
-M: writer >>= '[ [ _ run-writer ] dip '[ @ run-writer ] dip append <writer> ] ;
+M: writer >>= '[ [ _ run-writer ] dip '[ @ run-writer ] dip prepend <writer> ] ;
 
 : pass ( writer -- writer' ) run-writer [ first2 ] dip swap call( x -- y ) <writer> ;
 : listen ( writer -- writer' ) run-writer [ 2array ] keep <writer> ;