Shuffle a deck without local variables
Haskell

Here is a point-free implementation.  No variables, formal parameters, or explicit recursion.  I used lambdabot's @pl ("pointless") refactoring feature quite a bit.

import Data.List
import Control.Applicative
import Control.Monad
import System.Random

shuffle :: [a] -&gt; IO [a]
shuffle = liftM2 (&lt;$&gt;) ((fst .) . foldl' (uncurry ((. flip splitAt) . (.) .
          (`ap` snd) . (. fst) . flip flip tail . (ap .) . flip flip head .
          ((.) .) . (. (++)) . flip . (((.) . (,)) .) . flip (:))) . (,) [])
          (sequence . map (randomRIO . (,) 0 . subtract 1) . reverse .
          enumFromTo 1 . length)

main = print =&lt;&lt; shuffle [1..52]


Here's my test procedure to make sure the numbers were uniformly distributed:

main = print . foldl' (zipWith (+)) (replicate 52 0)
       =&lt;&lt; replicateM 1000 (shuffle [1..52])


Here is the original algorithm:

shuffle :: [a] -&gt; IO [a]
shuffle xs = shuffleWith xs &lt;$&gt;
             sequence [randomRIO (0, i - 1) | i &lt;- reverse [1..length xs]]

shuffleWith :: [a] -&gt; [Int] -&gt; [a]
shuffleWith xs ns = fst $ foldl' f ([], xs) ns where
    f (a,b) n = (x:a, xs++ys) where
        (xs, x:ys) = splitAt n b