]> git.rkrishnan.org Git - yorgey.git/blobdiff - hw7/JoinList.hs
convert to point free style
[yorgey.git] / hw7 / JoinList.hs
index 84c3a41b268295200a7e22e24c1d7d70e79b5b60..58d1c9f8efc22f51627a3b02fab0fae0a85edb01 100644 (file)
@@ -90,8 +90,7 @@ scoreLine l = let scores = map scoreString . words $ l
 instance Buffer (JoinList (Score, Size) String) where
   toString = unlines . jlToList
 
-  fromString s = let ls = lines s in
-                  foldr (+++) Empty $ map (\x -> Single (scoreString x, Size 1) x) ls
+  fromString = foldr (+++) Empty . map (\x -> Single (scoreString x, Size 1) x) . lines 
   line n b = indexJ n b
   replaceLine n l b = let pre = takeJ (n - 1) b
                           post = dropJ n b