On Sat, Dec 5, 2009 at 10:02 PM, ??????? ?????? <[email protected]> wrote:
> fct a n = (snd $ break (==a) ['a'..'z']) !! n

Not bad but you forgot that it might need to wrap around, besides
break isn't really the best function to use here since we don't need
the first part of the pair :

> shift n ch = dropWhile (/=ch) (cycle ['a'..'z']) !! n

Still I think the ord and mod version will be faster.

-- 
Jedaï
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to