
5 Feb
2021
5 Feb
'21
11:18 p.m.
I'm looking through *An Introduction to Functional Programming Systems Using Haskell *by Davie and one of the exercises is *Define a function* f *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] [4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3]
but when he says *make a version that elaborates cases *I'm not sure what more there is to do. What am I missing? LB
1564
Age (days ago)
1564
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lawrence Bottorff