Re: data or class inheritance

1998-06-05 Thread Simon L Peyton Jones
> I have a base class,Organization, with name and address functions. > I want classes Buyer and Seller from Organization. > > Now if I want to create an 2 instances of Seller > > data Yahoo = Yahoo > > instance Organization Yahoo where > > name _= "Yahoo" > > addreess = ... > > > data DoubleC

exceptions and emacs mode

1998-06-05 Thread S. Alexander Jacobson
Two addenda. I added > value::RetVal () a -> a which extracts the return value from a RetVal in a typesafe manner. Also, I figured out that exceptions work well with layout so that they form a column of exception annotations on the right hand side of the actual code. Does anyone on the l

Re: Question about a monad property.

1998-06-05 Thread S.M.Kahrs
> f (x then k) = x then (f . k)(*) > = x then (\y -> f (k y)) > > where, of course, f is an adequate polymorphic function i.e. > f : M a -> M a for any type $a$. You really want here f : M a -> M b. > It is easy to se

Re: Question about a monad property.

1998-06-05 Thread Valery Trifonov
S.M.Kahrs wrote: > > > f (x then k) = x then (f . k)(*) > > = x then (\y -> f (k y)) > > [...] > > In the case of the list monad (M a = [a]), equation (*) > > holds only if $f$ is a morphism over the concat operator > > i.e. f (u ++ v) = (f u) ++

Exception Handling Version 2.0

1998-06-05 Thread S. Alexander Jacobson
I want to thank Peter and Ralph for their explanation of how to use Monads and Either. I have created a new version of the exception module that is syntactically cleaner and supports mixing exception types. It might have been nicer to do this with Existential types (I just read about them toda