[Yhc] YHC Core Semantics

Neil Mitchell ndmitchell at gmail.com
Mon Mar 12 07:41:24 EDT 2007


Hi

> increase :: NumDictionary a -> a -> a
>
> where NumDictionary is a data value which contains the
> implementations of the methods of the num class.
>
> It might look something like this:
>
>    data NumDictionary a =
>       NumDict
>       { numPlus :: a -> a -> a
>       , numTimes :: a -> a -> a
>       , numFromInteger :: Integer -> a
>       ... and so on ...
>       }

> Hopefully my explanation is correct and helpful.

Much clearer than my explanation. The only slight detail is that Yhc
uses tuples for the dictionaries, although we're not convinced that is
a great idea anyway.

Thanks

Neil


More information about the Yhc mailing list