Re: Types in RULES

2008-09-15 Thread Roman Leshchinskiy
On 15/09/2008, at 21:16, Simon Peyton-Jones wrote: | > What would we like to write? Perhaps something like | > | > "myrule" forall (type t :: *->*) (f :: a->a) x. | > from (tmap f (to x :: t a)) = map f (from (to x :: t a)) | | Regardless of the syntax, I suspect x will have to be given a t

RE: Types in RULES

2008-09-15 Thread Simon Peyton-Jones
| > What would we like to write? Perhaps something like | > | > "myrule" forall (type t :: *->*) (f :: a->a) x. | > from (tmap f (to x :: t a)) = map f (from (to x :: t a)) | | Regardless of the syntax, I suspect x will have to be given a type as | well here, as in (x :: a)? No, that's easily

Re: Types in RULES

2008-09-15 Thread Roman Leshchinskiy
On 15/09/2008, at 20:05, Simon Peyton-Jones wrote: What would we like to write? Perhaps something like "myrule" forall (type t :: *->*) (f :: a->a) x. from (tmap f (to x :: t a)) = map f (from (to x :: t a)) Regardless of the syntax, I suspect x will have to be given a type as well her

RE: Types in RULES

2008-09-15 Thread Simon Peyton-Jones
[Widening to cvs-ghc; read Roman's message below first.] Roman How annoying. You're right, it's impossible, because the 't' isn't mentioned in the type of 'f', or 'x'. What would we like to write? Perhaps something like "myrule" forall (type t :: *->*) (f :: a->a) x. from (tmap f (to x :