On Mar 12, 2013, at 12:44 AM, "Richard A. O'Keefe" <o...@cs.otago.ac.nz> wrote:
> 
> Prelude> :type (+)
> (+) :: Num a => a -> a -> a
> 
> The predefined (+) in Haskell requires its arguments and its result
> to be precisely the same type.
> 
> I think you had better justify the claim that Date+Period -> Date and
> Date+Period -> Period are possible at the same time by showing us
> actual code.

Ehm...

import Prelude hiding (Num)
class SumDP a where (+) :: Date -> Period -> a
instance SumDP Date where date + period = <your_implementation_here>
instance SumDP Period where date + period = <and_here>

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to