Help !!!
I am interested in the Glasgow Haskell monadic IO system. I have
read 'Imperative Functional Programming' by Peyton Jones and Wadler
and have tried to implement some of the sample functions but with
little success.
1. Can you shed some light on what I am doing wrong and
2. Point me in the right direction to obtain some more detailed
documentation on using monadic IO with the Glasgow Haskell compiler
version 0.16 (if any exists!).
Many thanks,
Aiden McCaughey
Dept Applied Computing
Magee College
University Of Ulster
email: [EMAIL PROTECTED]
P.S My sample program and error messages are listed below
----------------------------------------------------------------------
-- Script monio.hs
module Main where
import PreludeGlaIO
putcIO :: Char -> IO ()
putcIO c = ccall putchar c
mainIO :: IO ()
mainIO = putcIO '?'
-- end
Compiled as follows:
$ ghc -o test monio.hs -fglasgow-exts
with following error
"monio.hs", line 5
couldn't match the type "pt4" against "Char"
when combining a functions equation(s) & type signature (if applicable)
putcIO c = ccall putchar c
Fail: compilation had errors
ghc: execution of Haskell Compiler had trouble
-------------------------------------------------------------------
The following program compiles but on execution does nothing !
-- Script monio1.hs
module Main where
import PreludeGlaIO
mainIO :: IO ()
mainIO = appendChanIO "stdout" "Hello World"
-- end
-------------------------------------------------------------------