That's a clever routine.  It should be faster than mine since it only makes a single pass though the list.  Thanks for all the suggestions from everyone that responded.  Here is a link to some more info on the project I'm working on if anyone is interested:  
<a href="http://ehaskell.blogspot.com/">http://ehaskell.blogspot.com/</a><br><br>-Eric<br><br><div><span class="gmail_quote">On 2/5/07, <b class="gmail_sendername">ihope</b> &lt;<a href="mailto:ihope127@gmail.com">ihope127@gmail.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 2/4/07, Eric Olander &lt;<a href="mailto:olandere@gmail.com">olandere@gmail.com
</a>&gt; wrote:<br>&gt; Hi,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I&#39;m still somewhat new to Haskell, so I&#39;m wondering if there are better<br>&gt; ways I could implement the following functions, especially shiftl:<br>&gt;<br>&gt; &gt;&gt; moves the last element to the head of the list
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; shiftl :: [a] -&gt; [a]<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; shiftl [] = []<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; shiftl x = [last x] ++ init x<br><br>Well, you could try this, though I&#39;m actually sure it&#39;s any faster:<br><br>&gt; shiftl (x1:x2:xs) = last:x1:init
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where last:init = shiftl (x2:xs)<br>&gt; shiftl [x] = [x]<br>&gt; shiftl [] = error &quot;shiftl: empty list&quot;<br><br>Or, if you don&#39;t want to give an error on [], omit the last line and
<br>replace both of the [x] with xs.<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">
http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>