Haskell match
simplify patterns
match in javascript
formatting