I'm not sure I understand what is going on here, but it seems to me that the following assignment of "mult = (*)" causes "mult" to lose out on some of the polymorphic behavior of (*). Is that right? If so, why?


Prelude Data.Function Data.List Data.Char> let sizeMult = (*) `on` length
Prelude Data.Function Data.List Data.Char> sizeMult "Duane" "Johnson"
35
Prelude Data.Function Data.List Data.Char> let mult = (*)
Prelude Data.Function Data.List Data.Char> let sizeMult2 = mult `on` length

<interactive>:1:26:
    Couldn't match expected type `Integer' against inferred type `Int'
    In the second argument of `on', namely `length'
    In the expression: mult `on` length
    In the definition of `sizeMult2': sizeMult2 = mult `on` length
Prelude Data.Function Data.List Data.Char>



Thanks,
Duane Johnson
http://blog.inquirylabs.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to