Skip to content

Instantly share code, notes, and snippets.

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"
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 }
module Main where
main = ioA where
ioA = putStrLn "Hola"
ioB = putStrLn "Chao!"
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