(resending this to the list because this failed yesterday because of
the mailinglist downtime)

On Sat, Oct 30, 2010 at 1:57 AM, Bas van Dijk <v.dijk....@gmail.com> wrote:
> I could isolate it a bit more if you want.

And so I did. The following is another instance of the problem I'm
having but set in a more familiar setting:

{-# LANGUAGE RankNTypes #-}

import Control.Monad.ST

foo :: (forall s. ST s a) -> a
foo st = ($) runST st

Couldn't match expected type `forall s. ST s a'
               with actual type `ST s a'
   In the second argument of `($)', namely `st'

Note that: 'foo st = runST st' type checks as expected.

Surprisingly 'foo st = runST $ st' also type checks!

I find the latter surprising because according to the report[1]: e1 op
e2 = (op) e1 e2. So either both should type check or both should fail.

I guess that a RULE somewhere eliminates the ($) before the
type-checker kicks in. I do find that a little strange because I
thought RULES where applied after type checking.

Regards,

Bas

[1] http://www.haskell.org/onlinereport/exps.html#operators
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to