sig2dot rewrite in Haskell