packages feed

pointless-rewrite-0.0.1: src/Transform/Rules/SYB.hs

-----------------------------------------------------------------------------
-- |
-- Module      :  Transform.Rules.SYB
-- Copyright   :  (c) 2010 University of Minho
-- License     :  BSD3
--
-- Maintainer  :  hpacheco@di.uminho.pt
-- Stability   :  experimental
-- Portability :  non-portable
--
-- Pointless Rewrite:
-- automatic transformation system for point-free programs
-- 
-- Generic strategy for the rewriting of point-free strategic combinators.
--
-----------------------------------------------------------------------------

module Transform.Rules.SYB where

import Transform.Rewriting
import Transform.Rules.SYB.TP
import Transform.Rules.SYB.TU

optimise_syb :: Rule
optimise_syb = optimise_tp >>> optimise_tu

optimise_tp :: Rule
optimise_tp = innermost rules
    where rules = top nop_applyT ||| top seq_applyT
              ||| top gmapT_applyT ||| top everywhere_applyT
              ||| top mkT_applyT ||| top extT_applyT

optimise_tu :: Rule
optimise_tu = innermost rules
    where rules = top emptyQ_applyQ ||| top union_applyQ
              ||| top gmapQ_applyQ ||| top everything_applyQ
              ||| top mkQ_applyQ ||| top extQ_applyQ