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
-- When your code grows too big for a line: | |
separateParens = foldr (\ head tail -> if head == '(' then head : ' ' : tail else if head == ')' then ' ' : head : tail else head : tail) [] | |
-- Your natural instinct is to add new lines and comments: | |
separateParens = | |
foldr (\ head tail -> | |
if head == '(' | |
then head : ' ' : tail -- inserts space after left parens |