- http://pragprog.com/magazines/2012-08/thinking-functionally-with-haskell
- http://pragprog.com/magazines/2012-09/thinking-functionally-with-haskell
- http://pragprog.com/magazines/2012-10/thinking-functionally-with-haskell
- http://pragprog.com/magazines/2012-11/thinking-functionally-with-haskell
- http://pragprog.com/magazines/2012-12/web-programming-in-haskell
- http://pragprog.com/magazines/2013-01/web-programming-in-haskell-part-ii
- http://pragprog.com/magazines/2013-03/uncle-bob-and-functional-programming
- http://pragprog.com/magazines/2013-04/dependent-types
- http://pragprog.com/magazines/2013-05/dependent-types-part-ii
- http://pragprog.com/magazines/2013-06/unification
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
-- see below for commentary | |
makeUpTo :: Int -> [String] -> [String] | |
makeUpTo n = mlu [] | |
where | |
mlu pre [] = [pre] | |
mlu [] (w:ws) = mlu w ws | |
mlu pre (w:ws) | length pre + 1 + length w <= n = mlu (pre ++ ' ' : w) ws | |
| otherwise = pre : mlu [] (w:ws) |
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
class Valid a where | |
valid :: a -> OkF Errors | |
class Valid a => Persist m a where | |
save :: a -> m (OkF a) -- or errors | |
data User = User {name :: String} | |
data Organisation = Organisation {name :: String, users :: [User]} |