i.e. it takes an Int and returns the corresponding Char for that Int i.e. 75 would return 'K'?
The answer to this question is chr
as others have pointed out.
Frequently questions like this, "Does there exist a function Int -> Char
?" can be quickly answered using Hoogle.
Searching hoogle for Int -> Char
lists chr
as the top match: http://www.haskell.org/hoogle/?hoogle=Int+-%3E+Char
Furthermore, in most browsers you can customize the address bar so that you can quickly search from your browser. In Chrome, go to Settings, "Manage search engines...", scroll to the bottom of the list and add "hoogle", "h", and "http://www.haskell.org/hoogle/?hoogle=%s" as an entry. Then you can go to the address bar, type "h Int -> Char" and it will take you to the results.
You're looking for the chr
function in Data.Char
> :m Data.Char
> chr 75
'K'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With