Hi,
Am Mittwoch, den 24.09.2014, 16:37 -0400 schrieb David Feuer: > On Sep 12, 2014 2:35 PM, "Joachim Breitner" <[email protected]> > wrote: > > I once experimented with a magic "oneShot :: (a -> b) -> (a -> b)" > > function, semantically the identity, but tell the compiler not to > share > > the result of the computation. Using that in the definition of > > foldl-as-foldr, one can get the same effect as Call Arity, but a bit > > more reliable. I need to investigate if that solves the > sumConcatInits > > problem. > > One nice thing about this idea (which sounds like it must be related > to the "state hack", but is more explicit) is that it presumably > applies also to similar situations in the State and ST monads, when a > state transformer is only used once. Could you explain, perhaps, what > compiler transformation this enables, and how you implemented it? I guess it is used in various places, and I woudn’t know all of them. The one that I was aiming for was is this one case x of True -> z False -> \s(one-shot). e to \s(one-shot) . case x of True -> z s False -> e explained in Note [Combining case branches] at https://github.com/ghc/ghc/blob/master/compiler/coreSyn/CoreArity.lhs#L671 The implementation is attached to my previous mail. > It would be nice if the compiler could figure this out for itself, Well, that’s what I thought, and CallArity is what I came up with :-) Greetings, Joachim -- Joachim “nomeata” Breitner [email protected] • http://www.joachim-breitner.de/ Jabber: [email protected] • GPG-Key: 0xF0FBF51F Debian Developer: [email protected]
signature.asc
Description: This is a digitally signed message part
_______________________________________________ ghc-devs mailing list [email protected] http://www.haskell.org/mailman/listinfo/ghc-devs
