Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. case class Writer[A](value: A, diary: String) = {
  2.    def flatMap[B](f: A => Writer[B]) = {
  3.        f(value) match {
  4.            case Writer(result, d) => Writer(result, diary + d)
  5.        }
  6.    }    
  7.    def map[B](f: A => B]) = Writer(f(value), diary)
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top