Questions tagged [hoopl]

Hoopl is a high order optimization library in Haskell to support dataflow analysis and optimization.

Hackage page: http://hackage.haskell.org/package/hoopl

5 questions
7
votes
2 answers

How can I combine the CheckingFuelMonad with a State monad in Hoopl?

I am using the Hoopl library and would like to carry some state around while rewriting. The rewrite functions are polymorphic regarding the monad used, but I cannot figure out how to combine a State monad with one of the library's Fuel monads. Below…
Justin Bailey
  • 1,487
  • 11
  • 15
5
votes
1 answer

Data flow optimisation using HOOPL

I am Haskell programmer ( I generally implement algorithms in Haskell ) and trying to understand HOOPL library but I am not able to decode it. I don't have compiler background ( currently learning from Coursera and Compilers: Principles,…
keep_learning
  • 1,057
  • 5
  • 14
4
votes
1 answer

Examples of monadic effects inside a rewrite function in Hoopl?

The type of (forward) rewriting functions in Hoopl is given by the mkFRewrite function: mkFRewrite :: (FuelMonad m) => (forall e x. n e x -> f -> m (Maybe (hoopl-3.8.6.1:Compiler.Hoopl.Dataflow.Graph n e x))) -> FwdRewrite m…
Justin Bailey
  • 1,487
  • 11
  • 15
3
votes
2 answers

How to merge Hoopl graph blocks / how to pass through the blocks

I'm trying to introduce Hoopl into some compiler and faced some problem: creating a graph for Hoopl makes the nodes to appear in order of labels that were introduced. Eg: (define (test) (if (eq? (random) 1 ) 2 (if (eq? (random) 2 ) 3 0) )…
voidlizard
  • 805
  • 5
  • 10
0
votes
1 answer

Hoopl: graph construction and automatic deletion of unreachable blocks

I'm working on a project using the Hoopl library, and I've run into a snag that indicates to me that I don't fully understand what's going on under the hood. In a nutshell, Hoopl seems to consider some blocks in my graph unreachable that (IMO) it…
andrew-wja
  • 53
  • 5