Hoopl and Arrows

John Lato jwlato at gmail.com
Tue Mar 3 21:07:38 UTC 2015


Thomas,

I'd be very careful mixing effectful arrows with the CCA framework.
Effectful arrows are not necessarily commutative, so the CCA
transformations may be invalid.

I did something very similar a couple years ago, by creating an arrow
instance that generated TH expressions.  IME the ghc optimizer handled it
extremely well, and no extra optimizations were necessary.

John L.

On 14:43, Mon, Mar 2, 2015 Justin Bailey <jgbailey at gmail.com> wrote:

> Thomas,
>
> I did some stuff with Hoopl a few years ago as part of my Master's
> thesis ("Using Dataflow Optimization Techniques with a Monadic
> Intermediate Language"). In Chapter 3 ("The Hoopl Library"), I wrote
> up an overview of Hoopl and work through a new example (new at the
> time, at least).
>
> You can download my thesis from http://mil.codeslower.com. The example
> code from that chapter is available at
> https://github.com/m4dc4p/mil/blob/master/thesis/DeadCodeC.lhs. No
> guarantees that it still compiles, but I'm glad to try and help needed
> :)
>
>
> On Mon, Mar 2, 2015 at 1:34 PM, Simon Peyton Jones
> <simonpj at microsoft.com> wrote:
> > Thomas
> >
> >
> >
> > Hoopl works on control flow graphs, whereas Core is lambda calculus.  I
> > really don’t think Hoopl is going to be any good for optimising Core.
> >
> >
> >
> > Ask the ghc-devs mailing list too.  Someone there has been writing about
> > arrows recently (take a look at the archive).
> >
> >
> >
> > Simon
> >
> >
> >
> > From: Thomas Bereknyei [mailto:tomberek at gmail.com]
> > Sent: 02 March 2015 17:07
> > To: nr at cs.tufts.edu; Simon Peyton Jones
> > Subject: Hoopl and Arrows
> >
> >
> >
> > I've been interested in Arrows and their optimization recently. I've run
> > into problems during basic tooling so I built a quasiquoter for proc
> > notation (still working on rec and let statements, but the rest of it
> works)
> > that converts from haskell-src-exts into a desugarred TH format. My
> original
> > goal was to implement "Casual Commutative Arrows"  [1] but to make it
> more
> > user friendly and to include arrows with effects. I came across Hoopl
> and at
> > first glance I would think it can help with Arrow optimization,
> especially
> > with the tuple shuffling from desuggared proc-do notation. In spite of
> the
> > slogan of "Hoopl: Dataflow Optimization made Simple" and the git repo's
> > testing folder, I'm not 100% clear on Hoopl usage. I would be interested
> in
> > anything that can get me started or even a thought or two whether it
> would
> > be worth looking into for Arrows.
> >
> > Simon, regarding [2], my quasiquoter can be rewritten to take `bind`,
> > `bind_`, `fixA`, and `ifThenElseA` from scope rather than being built in.
> > Would that help with #7828?  I am not very familiar with GHC internals at
> > the moment, and I am confused about the complexity of dsArrows.hs in
> > contrast with my own parser. It seems I have a good start on it in the
> > Parser module at [3], WARNING: untested and rough draft code, though
> > suggestions and pointers are welcome. I was thinking of sending some of
> my
> > code to haskell-src-meta because they can't yet translate their version
> of
> > Exp into TH's ExpQ.
> >
> > -Tom
> >
> >
> > [1] (https://hackage.haskell.org/package/CCA)
> > [2] (https://ghc.haskell.org/trac/ghc/ticket/7828#comment:54)
> > [3] (https://www.fpcomplete.com/user/tomberek/rulestesting)
> >
> >
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150303/7fc27f1a/attachment.html>


More information about the ghc-devs mailing list