[Haskell-cafe] Doubting Haskell

Colin Paul Adams colin at colina.demon.co.uk
Sun Feb 17 01:47:25 EST 2008

>>>>> "Cale" == Cale Gibbard <cgibbard at gmail.com> writes:

    Cale> So, the first version:

    Cale> import System.IO import Control.Exception (try)

    Cale> main = do mfh <- try (openFile "myFile" ReadMode) case mfh
    Cale> of Left err -> do putStr "Error opening file for reading: "
    Cale> print err Right fh -> do mline <- try (hGetLine fh) case
    Cale> mline of Left err -> do putStr "Error reading line: " print
    Cale> err hClose fh Right line -> putStrLn ("Read: " ++ line)

Left? Right?

Hardly descriptive terms. Sounds like a sinister language to me.
Colin Adams
Preston Lancashire

More information about the Haskell-Cafe mailing list