Skip to content

Commit a0f25f1

Browse files
committed
typo
1 parent 11de1c8 commit a0f25f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/monad-transformers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ In the first argument of ‘lift’, namely ‘getLine’
107107
In a stmt of a 'do' block: password <- lift getLine
108108
```
109109

110-
The error means we have another layer of our stack that we need to traverse before we can lift the IO action into our stack. In other words, we would need to do `lift (lift getLine)`. This is precisely what `liftIO` gives us. Doing `lift . lift . lift ...` is unmaintainable because it relies on the stack being a specific depth. If we decided to add another monad to our stack, our nested lifting would break. With `liftIO` we can short circuit this and simply life the IO action all the way to the bottom of our stack.
110+
The error means we have another layer of our stack that we need to traverse before we can lift the IO action into our stack. In other words, we would need to do `lift (lift getLine)`. This is precisely what `liftIO` gives us. Doing `lift . lift . lift ...` is unmaintainable because it relies on the stack being a specific depth. If we decided to add another monad to our stack, our nested lifting would break. With `liftIO` we can short circuit this and simply lift the IO action all the way to the bottom of our stack.
111111

112112

113113
* More transformer usage examples

0 commit comments

Comments
 (0)