Port numeric extensions to Haskell