
4 Feb
2007
4 Feb
'07
1:44 p.m.
Hi, I'm still somewhat new to Haskell, so I'm wondering if there are better ways I could implement the following functions, especially shiftl:
moves the first element to the end of the list shiftr :: [a] -> [a] shiftr [] = [] shiftr (x:y) = y ++ [x]
moves the last element to the head of the list shiftl :: [a] -> [a] shiftl [] = [] shiftl x = [last x] ++ init x
-Eric