Function with mod cases?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Function with mod cases?

Galaxy Being
I'm looking through An Introduction to Functional Programming Systems Using Haskell by Davie and one of the exercises is

Define a function such that

f(x) = x + 3 (mod 5)

Make a version that elaborates cases, as well as a straightforward way.

I'm not really sure what's being asked, so this is what I've come up with

myMods xs = map (\x -> (x + 3) `mod` 5) xs

> myMods [1..20]

but when he says make a version that elaborates cases I'm not sure what more there is to do. 
What am I missing?


Beginners mailing list
[hidden email]