Created
October 14, 2012 14:21
-
-
Save thomwiggers/3888740 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
horz :: AlignV -> [Text] -> Text | |
horz av ts = Text LeftH av 0 0 (foldr addList [] (equalizeLists [] mahlines)) | |
where | |
mahlines = [["foo","bar"],["foo","bar"]] --map (lines . show) ts | |
maxLenList = maxLength mahlines | |
equalizeLists list [] = list | |
equalizeLists list (l:ls) | |
| length l == maxLenList = equalizeLists (list++l) ls | |
| av == TopV | |
= equalizeLists list ((l++[replicate (length (head l)) ' ']):ls) | |
| av == CenterV && (length l + 2) <= maxLenList | |
= equalizeLists list (([replicate (length (head l)) ' '] ++ l | |
++[replicate (length (head l)) ' ']):ls) | |
| av == CenterV | |
= equalizeLists list ((l++[replicate (length (head l)) ' ']):ls) | |
| av == BottomV | |
= equalizeLists list (([replicate (length (head l)) ' ']++l):ls) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
opdracht6.8.hs:97:39:
Couldn't match expected type
Char' with actual type
[a0]'Expected type: [[a0]] -> String -> String
Actual type: [[a0]] -> [[a0]] -> [[a0]]
In the first argument of
foldr', namely
addList'In the fifth argument of
Text', namely
(foldr addList [](equalizeLists [] mahlines))'