2db18c6c1d5299d1b48a8949c3aef5e3f8b459f6
[ghc.git] / libraries / base / GHC / Char.hs
1
2 {-# LANGUAGE NoImplicitPrelude, MagicHash #-}
3
4 module GHC.Char (chr) where
5
6 import GHC.Base
7 import GHC.Show
8
9 -- | The 'Prelude.toEnum' method restricted to the type 'Data.Char.Char'.
10 chr :: Int -> Char
11 chr i@(I# i#)
12 | isTrue# (int2Word# i# `leWord#` 0x10FFFF##) = C# (chr# i#)
13 | otherwise
14 = error ("Prelude.chr: bad argument: " ++ showSignedInt (I# 9#) i "")
15