O'Haskell OOP Polymorphic Functions

Johan Nordlander nordland@cse.ogi.edu
Tue, 16 Jan 2001 10:38:30 -0800


Magnus Carlsson wrote:
> 
> You can use overloading for the definition of theValue instead:
> 
>   class TheValue a where theValue :: a -> Maybe Int
> 
>   instance TheValue Base    where theValue _ = Nothing
>   instance TheValue Derived where theValue x = Just (x.value)
> 

... or rather, you will be able to use overloading when the new version of
O'Hugs is released in a few days :-)

-- Johan