Hi,<br>&nbsp;&nbsp; I&#39;m still somewhat new to Haskell, so I&#39;m wondering if there are better ways I could implement the following functions, especially shiftl:<br><br>&gt;&gt; moves the first element to the end of the list<br>
&nbsp;&nbsp;&nbsp; shiftr :: [a] -&gt; [a]<br>&nbsp;&nbsp; &nbsp;shiftr [] = []<br>&nbsp;&nbsp; &nbsp;shiftr (x:y) = y ++ [x]<br>&nbsp;&nbsp;&nbsp; <br>&gt;&gt; moves the last element to the head of the list<br>&nbsp;&nbsp; &nbsp;shiftl :: [a] -&gt; [a]<br>&nbsp;&nbsp; &nbsp;shiftl [] = []<br>&nbsp;&nbsp; &nbsp;shiftl x = [last x] ++ init x
<br><br>-Eric<br>