[Haskell-cafe] Haskell-Newbie and Char-Function

Jochem Berndsen jochem at functor.nl
Sat Dec 5 10:48:26 EST 2009


MeAdAstra wrote:
> Hi guys,
> I only started learning Haskell some days ago. Maybe one of you can give me
> a hint on how to implement a function that needs a character in the range
> (a,b,...z) and an integer number k and returns the k-next neighbor of the
> character? For example, fct a 5 would result in output f.

You might want to use the functions ord and chr from Data.Char, and the
mod function from the Prelude.

Regards, Jochem

-- 
Jochem Berndsen | jochem at functor.nl | jochem@牛在田里.com


More information about the Haskell-Cafe mailing list