I support a form of this in jhc by allowing specialization of values,
not just types.
It is actually the same mechanism as type specialization since that is
just value specialization where the value being specialized on is the
type parameter.

foo :: Bool -> Int

{-# SPECIALIZE foo True :: Int #-}
(I think this is the current syntax, I changed it a couple times in
jhc's history)

will create a

foo_True :: Int
foo_True = inline foo True

and a

{-# RULE foo True = foo_True #-}

   John

_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to