use some haskell idioms
Merge pull request #1 from sdiehl/master

use some haskell idioms