4 ms·
I had the same reaction. The only part of this that I could read was a little surprising: pop :: CallstackIO () pop = modify popFrame wher
by gavinpc 9y ago
I had the same reaction. The only part of this that I could read was a little surprising:
pop :: CallstackIO ()
pop =
modify popFrame
where popFrame (_:xs) =
xs
popFrame xs =
xs
Not that it's very onerous to implement, but I would expect these "pop" semantics to be imported from some more general type (or trait, or whatever Haskell uses for type composition). That said, I don't know what `modify` means.
- reinvdwoerd 9y agoFrom the documentation: "Maps an old state to a new state inside a state monad. The old state is thrown away." https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-State-Lazy.html https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-M...