Created
September 21, 2014 19:54
-
-
Save cvogt/bda9bd48578ccccc2d1e to your computer and use it in GitHub Desktop.
Scala approximation of https://gist.github.com/lazyvalue/af7cd9562937e75c2eaf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaz._ | |
import Scalaz._ | |
object MyApp extends App{ | |
type Scott[V] = EitherT[Option,String,V] | |
type ScottI = Scott[Int] | |
def myf: Int => ScottI = _.point[Scott] | |
def lar: ScottI = for{ | |
x <- myf(4) | |
y <- myf(9) | |
} yield y + x | |
println("lar lar lar") | |
print(lar.run.get) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment