Created
November 16, 2009 22:33
-
-
Save Raynes/236383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
middleList xs@(_:_:_:_) = | |
let n = length xs | |
en = if n < 5 then 1 else 2 * (n `div` 4) | |
in take (if odd n then 1 else 2) $ drop en xs | |
middleList xs = xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment