Hello Justin,

If you grep Hoopl's source code for wrapFR and wrapBR, you can find
uses of the methods.  For example:

    thenFwdRw :: forall m n f. Monad m 
              => FwdRewrite m n f 
              -> FwdRewrite m n f 
              -> FwdRewrite m n f
    -- @ end comb1.tex
    thenFwdRw rw3 rw3' = wrapFR2 thenrw rw3 rw3'
     where
      thenrw :: forall m1 e x t t1.
                Monad m1 =>
                (t -> t1 -> m1 (Maybe (Graph n e x, FwdRewrite m n f)))
                -> (t -> t1 -> m1 (Maybe (Graph n e x, FwdRewrite m n f)))
                -> (t -> t1 -> m1 (Maybe (Graph n e x, FwdRewrite m n f)))
      thenrw rw rw' n f = rw n f >>= fwdRes
         where fwdRes Nothing   = rw' n f
               fwdRes (Just gr) = return $ Just $ fadd_rw rw3' gr

This usage of wrapFR2 doesn't take advantage of the extra polymorphism of
wrapFR2, but it takes two forward rewrites and composes them into a single 
rewrite.

Edward

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to