a.d.clark at ed.ac.uk
Tue Aug 26 05:53:29 EDT 2008
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'
Prelude Data.Char> chr 97
Remember you can use hoogle to look up library functions:
Paul Johnston wrote:
> Using the book by Hutton and in chapter 5 it talks about 'ord' and 'chr'
> being in the standard prelude.
> paulj at 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'
> They seem to do what you would expect from their perl counterparts
> Any ideas?
> Cheers Paul
> Beginners mailing list
> Beginners at haskell.org
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the Beginners