Arrow Development
Thomas Bereknyei
tomberek at gmail.com
Fri Feb 20 07:58:14 UTC 2015
I am looking at the proc notation de-sugar and I see results like this when
using a Free Arrow (mostly copied from [1]):
line2 = proc n -> do
Effect getURLSum *** Effect getURLSum -< n
Seq [Pure ] (Seq [Pure ] (Seq [Pure ] (Seq [Pure ](Par <Effect >
{Effect } ) ) ) )
while this is so much simpler:
line2 = Effect getURLSum *** Effect getURLSum
Par <Effect > {Effect }
Those `Seq [Pure ]` sequences come from application of (.) and I have
noticed many similar inefficiencies in the Arrow preprocessor. Eventually
the goal would be to optimize when possible, for example I started looking
into this in order to use `concurrently` for (***) when in IO.
There was a rewrite mentioned here [2]. The deSugar/DsArrows.hs [3] looks
convoluted. Any progress or work needed? Or are Arrows not used much and
not worth the effort?
[1]
http://stackoverflow.com/questions/12001350/useful-operations-on-free-arrows
[2]https://mail.haskell.org/pipermail/haskell-cafe/2013-August/109795.html
[3]https://github.com/ghc/ghc/blob/master/compiler/deSugar/DsArrows.hs
-Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150220/36789e87/attachment.html>
More information about the ghc-devs
mailing list