writer-monad Questions

1

Solved

Question is in bold at the bottom. LYAH gives this example of using the do notation with the Writer monad import Control.Monad.Writer logNumber :: Int -> Writer [String] Int logNumber x = write...
Ephemeris asked 3/6, 2020 at 20:19

2

Solved

There's a great tutorial here that seems to suggest to me that the Writer Monad is basically a special case tuple object that does operations on behalf of (A,B). The writer accumulates values on th...
Allies asked 29/5, 2014 at 20:58

1

Solved

I am using the Writer monad to keep track of an error ("collision") flag on arbitrary values (such as Int). Once the flag is set it is "sticky" and attaches itself to all values produced as a resul...
Testimony asked 7/3, 2017 at 23:32

1

Solved

I wrote a monad with Writer functionality, using the Operational Monad approach. Then I noticed it does not work lazily. In the code below, there is a rogueWriter that performs infinitely many sta...
Menagerie asked 26/12, 2011 at 10:48

3

Solved

I've been playing with the Writer Monad recently, and I've run into what appears to be a space leak. I can't say I fully understand these things yet, so I'd like to know what's happening here, and ...
Delete asked 11/10, 2011 at 2:54
1

© 2022 - 2024 — McMap. All rights reserved.