Re: type aliases in instances

2002-03-11 Thread Bernhard Reus

Richard Uhtenwoldt wrote:
> 
> I do not have experience commposing monads (maybe John Hughes can
> chime in?), but I'll address where Bernhard Reus writes:
> 
> >This can be avoided by using type
> >aliases but then the monads in use cannot be instances of the Monad
> >class.
> >But not declaring the monads to be in class Monad can hardly
> >be good style, can it?
> 
> GHC's source code defines many monads not in class Monad.
> I'll write some untested code to give an idea of
> the naming conventions used:
> 
> type FooMd out = (a,b,c)->((a,b,c),out)
> returnFooMd out = \s0->out
> thenFooMd p k = \s0->let (s,out) = p s0
>

Thanks Richard. So this means it is common practice in the Haskell
community to use type aliases and not to declare the monads as
instances.

But that makes me even more curious. Why are type aliases not allowed in
instance declarations? I haven't found an explanation in the language
doc. Does anybody know the exact reason?   Any pointer appreciated.

Cheers,

  Bernhard
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



type aliases in instances

2002-03-07 Thread Bernhard Reus

In Haskell type aliases are not allowed in instance definitions.  Is
there a particular reason for this? For example, is there a problem with
type inference? 

I noticed that when composing monads (in the Moggi/Wadler style) one
easily ends up with a cascade of coercions enforced by datatype
declarations. Looks a bit tedious. This can be avoided by using type
aliases but then the monads in use cannot be instances of the Monad
class. Phil uses aliases in his "Essence of functional programming"
paper too. But not declaring the monads to be in class Monad can hardly
be good style, can it?

Many thanks for your help in advance.

  Bernhard

--- 
Bernhard Reus,  COGS
University of Sussex
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



installation problems with graphics-2.0.4

2001-12-20 Thread Bernhard Reus

The graphics lib of the new December release does not
compile with the shipped makefile.
The makefile does not do anything at all???
Maybe there is a problem with wildcard extensions?

To be honest, I have no clue. I am using a Sparc5/Solaris
machine.
Any help appreciated.

Thanks in advance,

  Bernhard

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell