[Haskell-cafe] Are newtypes optimised and how much?

wren ng thornton wren at freegeek.org
Wed Oct 20 19:07:25 EDT 2010


On 10/20/10 7:09 AM, Simon Peyton-Jones wrote:
> Yes, you can freely use Foo/unFoo.  There's no runtime penalty.  (In the jargon of GHC's intermediate language, Foo and unFoo translate to *type-safe casts*, which generate no executable code.

When does the conversion to type-safe casts occur relative to other 
optimizations (namely, rewrite rules)?

-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list