re: Daily Challenge #53 - Faro Shuffle VIEW POST

TOP OF THREAD FULL DISCUSSION
re: import Control.Arrow (arr, (&&&)) faroShuffle :: [a] -> [a] faroShuffle a = let d = length a `div` 2 in concat $ ...
 

I managed to get it point free!

import Control.Arrow (arr, (&&&))

faroShuffle :: [a] -> [a]
faroShuffle = concat .
              uncurry (zipWith (\a b -> [a, b])) .
              uncurry splitAt .
              ((arr ((`div`2) . length)) &&& (arr id))

I remember looking for the splitAt function when I was writing my first answer, not sure how I missed it in hoogle.

Also, I've never seen Control.Arrow before (I'm pretty new to Haskell). Seems useful.

code of conduct - report abuse