Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/main/tut/3.4-monads-programmers-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,6 @@ def flatten[A, W: Monoid]
```
................
```Haskell
upCase :: String -> Writer String String
upCase s = Writer (map toUpper s, "upCase ")
```
```tut:silent
def upCase
: String => Writer[String, String] =
s => Writer(s.toUpperCase, "upCase ")
```
................
```Haskell
process :: String -> Writer String [String]
process = upCase >=> toWords
```
Expand Down Expand Up @@ -291,6 +281,16 @@ def process
```
................
```Haskell
upCase :: String -> Writer String String
upCase s = Writer (map toUpper s, "upCase ")
```
```tut:silent
def upCase
: String => Writer[String, String] =
s => Writer(s.toUpperCase, "upCase ")
```
................
```Haskell
process s =
upCase s >>= \ upStr ->
toWords upStr
Expand Down