This file contains hidden or 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 Data.IORef | |
readAndPrint :: IORef Int -> IO () | |
readAndPrint ioRef = do | |
n <- readIORef ioRef | |
print $ "ioRef = " ++ show n | |
main = do | |
ioRef <- newIORef 3 | |
readAndPrint ioRef -- "ioRef 3" |
This file contains hidden or 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._ | |
case class Cosa(str: String, f: Float, n: Int) | |
import scalaz.Order.orderBy | |
val orderByStr = orderBy { c: Cosa => c.str } | |
val orderByF = orderBy { c: Cosa => c.f } | |
val orderByN = orderBy { c: Cosa => c.n } |
This file contains hidden or 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
module Main where | |
main = ioA where | |
ioA = putStrLn "Hola" | |
ioB = putStrLn "Chao!" |
This file contains hidden or 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
scala> import scalaz.std.list.listInstance | |
import scalaz.std.list.listInstance | |
scala> import scalaz.Traverse | |
import scalaz.Traverse | |
scala> import scalaz.ValidationNel | |
import scalaz.ValidationNel | |
scala> import scalaz.Validation |
OlderNewer