Fergus Henderson wrote:
> > What would happen if `write' was called with an MVar variable and an
> > Error variable? Would the `exitWith' function get called, or would the
> > `putMVar' function get called?
> 
> Haskell doesn't normally let you define clauses for the same function
> in different modules.  So this case should just be disallowed.

The point that I was trying to make in this message was that pattern
matching on types could potentially provide most of the functionality
that type classes now provide, but in a conceptually clearer fashion
(IMHO). (Though, not necessarily in as mathematically rigorous a
fashion.) The weakness that I pointed out above was in regard to using
pattern matching types vs. type classes. With type classes, you can
declare an instance in any module and the instance declarations
typically don't step on each others' toes.

- Michael Hobbs



Reply via email to