chr and ord not in standard prelude
When I try to use functions chr or ord, I get a not in scope error. If I :browse Prelude I do not see these functions. Is there another module I should load? ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: chr and ord not in standard prelude
It looks like these are in module Char: ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for help. Loading package base ... linking ... done. Prelude Char.chr 65 'A' Prelude Char.ord 'A' 65 Colletta, Edward wrote: When I try to use functions chr or ord, I get a not in scope error. If I :browse Prelude I do not see these functions. Is there another module I should load? ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: chr and ord not in standard prelude
On Fri, Mar 09, 2007 at 03:40:08PM -0500, Colletta, Edward wrote: When I try to use functions chr or ord, I get a not in scope error. If I :browse Prelude I do not see these functions. Is there another module I should load? Don't use chr and ord - they aren't polymorphic, they restrict your code to work only on Chars. Use fromEnum and toEnum (which are in the Prelude) instead. Stefan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users