Skip to content

Commit c520bbc

Browse files
authored
add logFirstAndRetSecond (#25)
1 parent 5576348 commit c520bbc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module LogFirstAndRetSecond where
2+
3+
4+
import Control.Monad.Trans.Writer
5+
import Control.Monad.Trans.Reader
6+
import Control.Monad.Trans (lift)
7+
import Data.Char (toUpper)
8+
9+
10+
logFirstAndRetSecond :: WriterT String (Reader [String]) String
11+
logFirstAndRetSecond = do
12+
e2 <- lift $ asks (map toUpper . head . tail)
13+
e1 <- lift $ asks head
14+
tell e1
15+
return e2

0 commit comments

Comments
 (0)