
Hi Using the book by Hutton and in chapter 5 it talks about 'ord' and 'chr' being in the standard prelude. paulj@opensolaris4:~$ ghci GHCi, version 6.8.3: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> ord 3 <interactive>:1:0: Not in scope: `ord' Prelude> chr 67 <interactive>:1:0: Not in scope: `chr' Prelude> They seem to do what you would expect from their perl counterparts Any ideas? Cheers Paul

Hi These are both defined in the module Data.Char, I guess they were in the Prelude when the book was written. GHCi, version 6.8.3: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :m Data.Char Prelude Data.Char> ord 'a' 97 Prelude Data.Char> chr 97 'a' Prelude Data.Char> Remember you can use hoogle to look up library functions: http://haskell.org/hoogle/ regards allan Paul Johnston wrote:
Hi Using the book by Hutton and in chapter 5 it talks about 'ord' and 'chr' being in the standard prelude.
paulj@opensolaris4:~$ ghci GHCi, version 6.8.3: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> ord 3
<interactive>:1:0: Not in scope: `ord' Prelude> chr 67
<interactive>:1:0: Not in scope: `chr' Prelude>
They seem to do what you would expect from their perl counterparts Any ideas?
Cheers Paul _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
participants (2)
-
allan
-
Paul Johnston