[Haskell-cafe] The Worker/Wrapper Transformation
Isaac Dupree
isaacdupree at charter.net
Thu Jan 3 07:46:32 EST 2008
Achim Schneider wrote:
> ...is a paper about automatic specialisation of functions by unboxing
> arguments, one could say. I'm only on page 6, but already survived the
> first formalisms, which is bound to mean that the rest of the paper is
> likewise accessible, as hinted on at ltu.
>
> http://www.cs.nott.ac.uk/~gmh/wrapper.pdf
>
> The transformation itself is mindbogglingly easy, which makes this a
> good start: You only have to understand the formalisms, not so much what
> the formalisms are representing. To quote spj: It usually turns out to
> be more interesting and challenging than it seemed at first.
>
> I'm tempted to write that this is a paper for everyone trying to figure
> out what the heck Jonathan is talking about.
>
I like it! Of course the technique itself doesn't provide guidance on
what type you want to transform a function to.
on page 6, stronger vs weaker seemed backwards to me... isn't (wrap ◦
unwrap = idA) a stronger condition than (wrap ◦ unwrap ◦ body = body),
because it tells you more, and is true in fewer cases? (which is also
why you want to assume (wrap ◦ unwrap = idA) when you can, because it's
the most useful one for subsequent program transformation)
and then the inevitable minor copy-editing :-)
p. 22. intentional properties --> intensional (right?)
p. 27. typo 'unwarp' for 'unwrap'
BTW. GHC currently does allow e.g. (I# (1# +# 2#)), not just (case (1#
+# 2#) of n# -> I# n#) -- the strictness implications seem pretty
straightforwards (it's trivial to transform away).
p. 29. "in both these system" -> systems
~Isaac
More information about the Haskell-Cafe
mailing list