packages feed

kure 2.12.2 → 2.14.0

raw patch · 3 files changed

+8/−8 lines, 3 files

Files

Language/KURE/BiTranslate.hs view
@@ -15,7 +15,7 @@           BiTranslate         , BiRewrite         , bidirectional-        , forewardT+        , forwardT         , backwardT         , whicheverR         , invertBiT@@ -32,7 +32,7 @@ ------------------------------------------------------------------------------------------  -- | An undirected 'Translate'.-data BiTranslate c m a b = BiTranslate {forewardT :: Translate c m a b, -- ^ Extract the foreward 'Translate' from a 'BiTranslate'.+data BiTranslate c m a b = BiTranslate {forwardT :: Translate c m a b, -- ^ Extract the forward 'Translate' from a 'BiTranslate'.                                         backwardT :: Translate c m b a  -- ^ Extract the backward 'Translate' from a 'BiTranslate'.                                        } @@ -44,13 +44,13 @@ bidirectional = BiTranslate {-# INLINE bidirectional #-} --- | Try the 'BiRewrite' forewards, then backwards if that fails.+-- | Try the 'BiRewrite' forwards, then backwards if that fails. --   Useful when you know which rule you want to apply, but not which direction to apply it in. whicheverR :: MonadCatch m => BiRewrite c m a -> Rewrite c m a-whicheverR r = forewardT r <+ backwardT r+whicheverR r = forwardT r <+ backwardT r {-# INLINE whicheverR #-} --- | Invert the forewards and backwards directions of a 'BiTranslate'.+-- | Invert the forwards and backwards directions of a 'BiTranslate'. invertBiT :: BiTranslate c m a b -> BiTranslate c m b a invertBiT (BiTranslate t1 t2) = BiTranslate t2 t1 {-# INLINE invertBiT #-}@@ -67,7 +67,7 @@  -- | Perform the argument translation before /either/ direction of the bidirectional rewrite. beforeBiR :: Monad m => Translate c m a b -> (b -> BiRewrite c m a) -> BiRewrite c m a-beforeBiR t f = bidirectional (t >>= (forewardT . f)) (t >>= (backwardT . f))+beforeBiR t f = bidirectional (t >>= (forwardT . f)) (t >>= (backwardT . f)) {-# INLINE beforeBiR #-}  ------------------------------------------------------------------------------------------
Language/KURE/Lens.hs view
@@ -96,7 +96,7 @@ -- | Construct a 'Lens' from a 'BiTranslate'. bidirectionalL :: Monad m => BiTranslate c m a b -> Lens c m a b bidirectionalL bt = lens $ do c <- contextT-                              b <- forewardT bt+                              b <- forwardT bt                               return ((c,b), apply (backwardT bt) c) {-# INLINE bidirectionalL #-} 
kure.cabal view
@@ -1,5 +1,5 @@ Name:                kure-Version:             2.12.2+Version:             2.14.0 Synopsis:            Combinators for Strategic Programming Description:	     The Kansas University Rewrite Engine (KURE) is a domain-specific language for strategic rewriting. 	 	     KURE was inspired by Stratego and StrategyLib, and has similarities with Scrap Your Boilerplate and Uniplate.