{-# LANGUAGE NoImplicitPrelude #-} module Main where import Prelude (putStrLn, (+), (*), show) return a = a infix 1 >>=; a >>= b = b a infix 1 >>; a >> b = b a fail a = a fromInteger a = a test = do x <- return 1 y <- return 2 test2 x 10 test3 y test2 a b = a + b test3 a b = a * b main = putStrLn (show test)
Thursday, March 11, 2010
GHC DO syntax desugaring is very intuitive and conforming
Thursday, February 25, 2010
Lazy list division (Haskell)
firstHalf :: [a] -> [a]
firstHalf list0 = div list0 list0
where
div (a,b:arg) (r:res) = r:div arg res
div _ _ = []
Subscribe to:
Posts (Atom)