Created
April 10, 2010 22:13
-
-
Save moonmaster9000/362332 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module LiquidLayouts (columnSort) where | |
import List | |
columnSort xs n = concat (transpose (slice sliceSize xs)) | |
where | |
sliceSize = | |
ceiling (fromIntegral(length xs) / fromIntegral(n)) | |
slice _ [] = [] | |
slice n xs = firstSlice : remainingSlices | |
where | |
firstSlice = take n xs | |
remainingSlices = slice n (drop n xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment