[Haskell-cafe] Polymorphic addition function with variable number of arguments?

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Mar 13 22:36:30 CET 2012


The problem seems to be that numeric literals are polymorphic.
With your code, this works:

*Main> let x = 8 :: Int
*Main> add x x x :: Int
24
*Main> add x x :: Int
16





More information about the Haskell-Cafe mailing list