Skip to content

Instantly share code, notes, and snippets.

@SrPeixinho
SrPeixinho / gist:3c34f66fd86f12af165f
Last active August 29, 2015 14:23
Syntax considered harmful
-- 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