[Haskell-cafe] forall & ST monad
g9ks157k at acme.softbase.org
Mon Feb 16 09:08:30 EST 2009
Am Montag, 16. Februar 2009 14:21 schrieben Sie:
> Aha! Wolfgang is a man who knows his own code :)
> Yes, I've seen this a couple of times but when I saw it again in
> Grapefruit, I wanted to know how this usage of existentials worked, since
> I'm sooo curious to find out how you managed to use the type system for
> solving some of the typical FRP problems.
Note that in Grapefruit I not only use rank-2 polymorphism (corresponding to
existentials) but also impredicative polymorphism, namely in
FRP.Grapefruit.Signal.switch. However, the idea behind using impredicativity
here is the same as the reason for using rank-2 in Control.Monad.ST.runST,
FRP.Grapefruit.Circuit.create and Graphics.UI.Grapefruit.Circuit.run.
More information about the Haskell-Cafe