haskell optimiziations

Signed-off-by: Michael Karg <mgoremeier@gmail.com>