-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Combinators for Strategic Programming -- -- The Kansas University Rewrite Engine (KURE) is a DSL for strategic -- rewriting. KURE shares concepts with Stratego, but unlike Stratego, -- KURE is strongly typed. KURE is similar to StrategyLib, but has a -- lightweight generic traversal mechanism using type families rather -- than SYB. The basic transformation functionality can be found in -- Language.KURE.Translate, and the traversal functionality can be -- found in Language.KURE.Walker. Several basic examples of using -- KURE are provided in the source-code bundle. For a larger example, see -- the HERMIT package. @package kure @version 2.4.2 -- | This module provides various monadic and arrow combinators that are -- particularly useful when working with translations. module Language.KURE.Combinators -- | Monads with a catch for fail. The following law is -- expected to hold: -- --
--   fail msg `catchM` f == f msg
--   
class Monad m => MonadCatch m catchM :: MonadCatch m => m a -> (String -> m a) -> m a -- | A monadic catch that ignores the error message. (<<+) :: MonadCatch m => m a -> m a -> m a -- | Select the first monadic computation that succeeds, discarding any -- thereafter. catchesM :: MonadCatch m => [m a] -> m a -- | Catch a failing monadic computation, making it succeed with a constant -- value. tryM :: MonadCatch m => a -> m a -> m a -- | Catch a failing monadic computation, making it succeed with -- mempty. mtryM :: (MonadCatch m, Monoid a) => m a -> m a -- | Catch a failing monadic computation, making it succeed with an error -- message. attemptM :: MonadCatch m => m a -> m (Either String a) -- | Determine if a monadic computation succeeds. testM :: MonadCatch m => m a -> m Bool -- | Fail if the Monad succeeds; succeed with () if it -- fails. notM :: MonadCatch m => m a -> m () -- | Modify the error message of a failing monadic computation. Successful -- computations are unaffected. modFailMsg :: MonadCatch m => (String -> String) -> m a -> m a -- | Set the error message of a failing monadic computation. Successful -- computations are unaffected. setFailMsg :: MonadCatch m => String -> m a -> m a -- | Add a prefix to the error message of a failing monadic computation. -- Successful computations are unaffected. prefixFailMsg :: MonadCatch m => String -> m a -> m a -- | Use the given error message whenever a monadic pattern match failure -- occurs. withPatFailMsg :: MonadCatch m => String -> m a -> m a -- | Similar to guard, but invokes fail rather than -- mzero. guardMsg :: Monad m => Bool -> String -> m () -- | As guardMsg, but with a default error message. guardM :: Monad m => Bool -> m () -- | if-then-else lifted over a monadic predicate. ifM :: Monad m => m Bool -> m a -> m a -> m a -- | If the monadic predicate holds then perform the monadic action, else -- fail. whenM :: Monad m => m Bool -> m a -> m a -- | If the monadic predicate holds then fail, else perform the monadic -- action. unlessM :: Monad m => m Bool -> m a -> m a -- | Categorys with failure and catching. The following law is -- expected to hold: -- --
--   failT msg `catchT` f == f msg
--   
class Category arr => CategoryCatch arr failT :: CategoryCatch arr => String -> arr a b catchT :: CategoryCatch arr => arr a b -> (String -> arr a b) -> arr a b -- | Left-biased choice. (<+) :: CategoryCatch arr => arr a b -> arr a b -> arr a b -- | Look at the argument to the Arrow before choosing which -- Arrow to use. readerT :: ArrowApply arr => (a -> arr a b) -> arr a b -- | Look at the argument to an Arrow, and choose to be either the -- identity arrow or a failure. acceptR :: (CategoryCatch arr, ArrowApply arr) => (a -> Bool) -> String -> arr a a -- | Look at the argument to an Arrow, and choose to be either the -- identity arrow or a failure. This is a generalisation of -- acceptR to any Arrow. accepterR :: (CategoryCatch arr, ArrowApply arr) => arr a Bool -> String -> arr a a -- | Catch a failing CategoryCatch, making it into an identity. tryR :: CategoryCatch arr => arr a a -> arr a a -- | Catch a failing Arrow, making it succeed with a Boolean flag. -- Useful when defining anyR instances. attemptR :: (CategoryCatch arr, Arrow arr) => arr a a -> arr a (Bool, a) -- | Makes an Arrow fail if the result value equals the argument -- value. changedR :: (CategoryCatch arr, ArrowApply arr, Eq a) => arr a a -> arr a a -- | Repeat a CategoryCatch until it fails, then return the result -- before the failure. Requires at least the first attempt to succeed. repeatR :: CategoryCatch arr => arr a a -> arr a a -- | Attempt two Arrows in sequence, succeeding if one or both -- succeed. (>+>) :: (CategoryCatch arr, ArrowApply arr) => arr a a -> arr a a -> arr a a -- | Sequence a list of Arrows, succeeding if any succeed. orR :: (CategoryCatch arr, ArrowApply arr) => [arr a a] -> arr a a -- | Sequence a list of Categorys, succeeding if all succeed. andR :: Category arr => [arr a a] -> arr a a -- | Select the first CategoryCatch that succeeds, discarding any -- thereafter. catchesT :: CategoryCatch arr => [arr a b] -> arr a b -- | Apply a pure function to the result of an Arrow. result :: Arrow arr => (b -> c) -> arr a b -> arr a c -- | Apply a pure function to the argument to an Arrow. argument :: Arrow arr => (a -> b) -> arr b c -> arr a c -- | Apply an Arrow to the first element of a pair, discarding the -- second element. toFst :: Arrow arr => arr a b -> arr (a, x) b -- | Apply an Arrow to the second element of a pair, discarding the -- first element. toSnd :: Arrow arr => arr a b -> arr (x, a) b -- | A pure Arrow that swaps the elements of a pair. swap :: Arrow arr => arr (a, b) (b, a) -- | A pure Arrow that duplicates its argument. fork :: Arrow arr => arr a (a, a) -- | Tag the result of an Arrow with its argument. forkFirst :: Arrow arr => arr a b -> arr a (b, a) -- | Tag the result of an Arrow with its argument. forkSecond :: Arrow arr => arr a b -> arr a (a, b) -- | An arrow with a constant result. constant :: Arrow arr => b -> arr a b -- | This module defines the main KURE types: Translate, -- Rewrite and Lens. Rewrite is just a special case -- of Translate, and so any function that operates on -- Translate is also applicable to Rewrite. -- -- This module also contains Translate instance declarations for -- the Monad and Arrow type-class families. Given these -- instances, many of the desirable combinators over Translate and -- Rewrite are special cases of existing monadic or arrow -- combinators. Language.KURE.Combinators provides some additional -- combinators that aren't in the standard libraries. module Language.KURE.Translate -- | An abstract representation of a transformation from a value of type -- a in a context c to a monadic value of type m -- b. The Translate type is the basis of the entire KURE -- library. data Translate c m a b -- | A Translate that shares the same source and target type. type Rewrite c m a = Translate c m a a -- | Apply a Translate to a value and its context. apply :: Translate c m a b -> c -> a -> m b -- | The primitive way of building a Translate. translate :: (c -> a -> m b) -> Translate c m a b -- | The primitive way of building a Rewrite. rewrite :: (c -> a -> m a) -> Rewrite c m a -- | Build a Translate that doesn't depend on the context. contextfreeT :: (a -> m b) -> Translate c m a b -- | Build a constant Translate from a monadic computation. constT :: m b -> Translate c m a b -- | Extract the current context. contextT :: Monad m => Translate c m a c -- | Expose the current context and value. exposeT :: Monad m => Translate c m a (c, a) -- | Map a Translate over a list. mapT :: Monad m => Translate c m a b -> Translate c m [a] [b] -- | An identity Rewrite with side-effects. sideEffectR :: Monad m => (c -> a -> m ()) -> Rewrite c m a -- | An undirected Translate. data BiTranslate c m a b -- | A BiTranslate that shares the same source and target type. type BiRewrite c m a = BiTranslate c m a a -- | Construct a BiTranslate from two opposite Translates. bidirectional :: Translate c m a b -> Translate c m b a -> BiTranslate c m a b -- | Extract the foreward Translate from a BiTranslate. forewardT :: BiTranslate c m a b -> Translate c m a b -- | Extract the backward Translate from a BiTranslate. backwardT :: BiTranslate c m a b -> Translate c m b a -- | Try the BiRewrite forewards, 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 -- | Invert the forewards and backwards directions of a BiTranslate. invert :: BiTranslate c m a b -> BiTranslate c m b a -- | A Lens is a way to focus on a sub-structure of type b -- from a structure of type a. data Lens c m a b -- | The primitive way of building a Lens. If the unfocussing -- function is applied to the value focussed on then it should succeed, -- and produce the same value as the original argument (of type -- a). lens :: Translate c m a ((c, b), b -> m a) -> Lens c m a b -- | Convert a Lens into a Translate that produces a -- sub-structure (and its context) and an unfocussing function. lensT :: Lens c m a b -> Translate c m a ((c, b), b -> m a) -- | Apply a Rewrite at a point specified by a Lens. focusR :: Monad m => Lens c m a b -> Rewrite c m b -> Rewrite c m a -- | Apply a Translate at a point specified by a Lens. focusT :: Monad m => Lens c m a b -> Translate c m b d -> Translate c m a d -- | Check if the focusing succeeds, and additionally whether unfocussing -- from an unchanged value would succeed. testLensT :: MonadCatch m => Lens c m a b -> Translate c m a Bool -- | Construct a Lens from a BiTranslate. bidirectionalL :: Monad m => BiTranslate c m a b -> Lens c m a b -- | Construct a Lens from two pure functions. pureL :: Monad m => (a -> b) -> (b -> a) -> Lens c m a b instance MonadCatch m => CategoryCatch (Lens c m) instance Monad m => Category (Lens c m) instance Monad m => Category (BiTranslate c m) instance (Monad m, Monoid b) => Monoid (Translate c m a b) instance Monad m => ArrowApply (Translate c m) instance MonadPlus m => ArrowPlus (Translate c m) instance MonadPlus m => ArrowZero (Translate c m) instance Monad m => Arrow (Translate c m) instance MonadCatch m => CategoryCatch (Translate c m) instance Monad m => Category (Translate c m) instance MonadPlus m => MonadPlus (Translate c m a) instance MonadCatch m => MonadCatch (Translate c m a) instance Monad m => Monad (Translate c m a) instance Alternative m => Alternative (Translate c m a) instance Applicative m => Applicative (Translate c m a) instance Functor m => Functor (Translate c m a) -- | This module provides a type class for injective functions (and their -- retractions), and some useful interactions with Translate. -- -- A particularly useful instance of Injection is from a -- to Generic a, and that case is the primary purpose -- of most of these combinators. module Language.KURE.Injection -- | A class of injective functions from a to b, and -- their retractions. The following law is expected to hold: -- --
--   retract (inject a) == Just a
--   
class Injection a b inject :: Injection a b => a -> b retract :: Injection a b => b -> Maybe a -- | Injects a value and lifts it into a Monad. injectM :: (Monad m, Injection a a') => a -> m a' -- | Retracts a value and lifts it into a MonadCatch, with the -- possibility of failure. retractM :: (MonadCatch m, Injection a a') => a' -> m a -- | Lifted inject. injectT :: (Monad m, Injection a a') => Translate c m a a' -- | Lifted retract, the Translate fails if the retraction -- fails. retractT :: (MonadCatch m, Injection a a') => Translate c m a' a -- | Convert a Translate over an injected value into a -- Translate over a non-injected value. extractT :: (Monad m, Injection a a') => Translate c m a' b -> Translate c m a b -- | Promote a Translate over a value into a Translate over -- an injection of that value, (failing if that injected value cannot be -- retracted). promoteT :: (MonadCatch m, Injection a a') => Translate c m a b -> Translate c m a' b -- | As promoteT, but takes a custom error message to use if -- promotion fails. promoteWithFailMsgT :: (MonadCatch m, Injection a a') => String -> Translate c m a b -> Translate c m a' b -- | Convert a Rewrite over an injected value into a Rewrite -- over a retraction of that value, (failing if that injected value -- cannot be retracted). extractR :: (MonadCatch m, Injection a a') => Rewrite c m a' -> Rewrite c m a -- | Promote a Rewrite into over a value into a Rewrite over -- an injection of that value, (failing if that injected value cannot be -- retracted). promoteR :: (MonadCatch m, Injection a a') => Rewrite c m a -> Rewrite c m a' -- | As extractR, but takes a custom error message to use if -- extraction fails. extractWithFailMsgR :: (MonadCatch m, Injection a a') => String -> Rewrite c m a' -> Rewrite c m a -- | As promoteR, but takes a custom error message to use if -- promotion fails. promoteWithFailMsgR :: (MonadCatch m, Injection a a') => String -> Rewrite c m a -> Rewrite c m a' -- | A Lens to the injection of a value. injectL :: (MonadCatch m, Injection a a') => Lens c m a a' -- | A Lens to the retraction of a value. retractL :: (MonadCatch m, Injection a a') => Lens c m a' a instance Injection a (Maybe a) instance Injection a a -- | This module provides combinators that traverse a tree. -- -- Note that all traversals take place on the node, its children, or its -- descendents. Deliberately, there is no mechanism for "ascending" the -- tree. module Language.KURE.Walker -- | A Node is any node in the tree that you wish to be able to -- traverse. class (Injection a (Generic a), Generic a ~ Generic (Generic a)) => Node a where type family Generic a :: * numChildren :: Node a => a -> Int -- | Lifted version of numChildren. numChildrenT :: (Monad m, Node a) => Translate c m a Int -- | Check if a Node has a child of the specified index. hasChild :: Node a => Int -> a -> Bool -- | Lifted version of hasChild. hasChildT :: (Monad m, Node a) => Int -> Translate c m a Bool -- | Walker captures the ability to walk over a tree of -- Nodes, using a specific context c and a -- MonadCatch m. -- -- Minimal complete definition: childL. -- -- Default definitions are provided for allT, oneT, -- allR, anyR and oneR, but they may be overridden -- for efficiency. For small numbers of interesting children this will -- not be an issue, but for a large number, say for a list of children, -- it may be. class (MonadCatch m, Node a) => Walker c m a where allT t = modFailMsg ("allT failed: " ++) $ do { n <- numChildrenT; mconcat (childrenT n (const t)) } oneT t = setFailMsg "oneT failed" $ do { n <- numChildrenT; catchesT (childrenT n (const t)) } allR r = modFailMsg ("allR failed: " ++) $ do { n <- numChildrenT; andR (childrenR n (const r)) } anyR r = setFailMsg "anyR failed" $ do { n <- numChildrenT; orR (childrenR n (const r)) } oneR r = setFailMsg "oneR failed" $ do { n <- numChildrenT; catchesT (childrenR n (const r)) } childL :: Walker c m a => Int -> Lens c m a (Generic a) allT :: (Walker c m a, Monoid b) => Translate c m (Generic a) b -> Translate c m a b oneT :: Walker c m a => Translate c m (Generic a) b -> Translate c m a b allR :: Walker c m a => Rewrite c m (Generic a) -> Rewrite c m a anyR :: Walker c m a => Rewrite c m (Generic a) -> Rewrite c m a oneR :: Walker c m a => Rewrite c m (Generic a) -> Rewrite c m a -- | Apply a Rewrite to a specified child. childR :: Walker c m a => Int -> Rewrite c m (Generic a) -> Rewrite c m a -- | Apply a Rewrite in a top-down manner, succeeding if they all -- succeed. alltdR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite in a bottom-up manner, succeeding if they all -- succeed. allbuR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite twice, in a top-down and bottom-up way, using -- one single tree traversal, succeeding if they all succeed. allduR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite in a top-down manner, succeeding if any -- succeed. anytdR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite in a bottom-up manner, succeeding if any -- succeed. anybuR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite twice, in a top-down and bottom-up way, using -- one single tree traversal, succeeding if any succeed. anyduR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite to the first Node for which it can -- succeed, in a top-down traversal. onetdR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Rewrite to the first Node for which it can -- succeed, in a bottom-up traversal. onebuR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Attempt to apply a Rewrite in a top-down manner, pruning at -- successful rewrites. prunetdR :: (Walker c m a, a ~ Generic a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | A fixed-point traveral, starting with the innermost term. innermostR :: (Walker c m a, Generic a ~ a) => Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Translate to a specified child. childT :: Walker c m a => Int -> Translate c m (Generic a) b -> Translate c m a b -- | Fold a tree in a top-down manner, using a single Translate for -- each Node. foldtdT :: (Walker c m a, Monoid b, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | Fold a tree in a bottom-up manner, using a single Translate for -- each Node. foldbuT :: (Walker c m a, Monoid b, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | Apply a Translate to the first Node for which it can -- succeed, in a top-down traversal. onetdT :: (Walker c m a, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | Apply a Translate to the first Node for which it can -- succeed, in a bottom-up traversal. onebuT :: (Walker c m a, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | Attempt to apply a Translate in a top-down manner, pruning at -- successes. prunetdT :: (Walker c m a, Monoid b, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | An always successful top-down fold, replacing failures with -- mempty. crushtdT :: (Walker c m a, Monoid b, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | An always successful bottom-up fold, replacing failures with -- mempty. crushbuT :: (Walker c m a, Monoid b, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) b -- | An always successful traversal that collects the results of all -- successful applications of a Translate in a list. collectT :: (Walker c m a, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) [b] -- | Like collectT, but does not traverse below successes. collectPruneT :: (Walker c m a, a ~ Generic a) => Translate c m (Generic a) b -> Translate c m (Generic a) [b] -- | A path from the root. data AbsolutePath -- | The (empty) AbsolutePath to the root. rootAbsPath :: AbsolutePath -- | Extend an AbsolutePath by one descent. extendAbsPath :: Int -> AbsolutePath -> AbsolutePath -- | Contexts that are instances of PathContext contain the current -- AbsolutePath. Any user-defined combinators (typically -- childL and congruence combinators) should update the -- AbsolutePath using extendAbsPath. class PathContext c contextPath :: PathContext c => c -> AbsolutePath -- | Find the AbsolutePath to the current Node. absPathT :: (PathContext c, Monad m) => Translate c m a AbsolutePath -- | A path is a route to descend the tree from an arbitrary Node. type Path = [Int] -- | Convert an AbsolutePath into a Path starting at the -- root. rootPath :: AbsolutePath -> Path -- | Find the Paths to every Node that satisfies the -- predicate. pathsToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) [Path] -- | Find the Path to the first Node that satisfies the -- predicate (in a pre-order traversal). onePathToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) Path -- | Find the Path to the first descendent Node that -- satisfies the predicate (in a pre-order traversal). oneNonEmptyPathToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) Path -- | Find the Paths to every Node that satisfies the -- predicate, ignoring Nodes below successes. prunePathsToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) [Path] -- | Find the Path to the Node that satisfies the predicate, -- failing if that does not uniquely identify a Node. uniquePathToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) Path -- | Build a Path to the Node that satisfies the predicate, -- failing if that does not uniquely identify a Node (ignoring -- Nodes below successes). uniquePrunePathToT :: (PathContext c, Walker c m a, a ~ Generic a) => (Generic a -> Bool) -> Translate c m (Generic a) Path -- | Construct a Lens by following a Path. pathL :: (Walker c m a, a ~ Generic a) => Path -> Lens c m (Generic a) (Generic a) -- | Construct a Lens that points to the last Node at which -- the Path can be followed. exhaustPathL :: (Walker c m a, a ~ Generic a) => Path -> Lens c m (Generic a) (Generic a) -- | Repeat as many iterations of the Path as possible. repeatPathL :: (Walker c m a, a ~ Generic a) => Path -> Lens c m (Generic a) (Generic a) -- | Build a Lens from the root to a point specified by an -- AbsolutePath. rootL :: (Walker c m a, a ~ Generic a) => AbsolutePath -> Lens c m (Generic a) (Generic a) -- | Apply a Rewrite at a point specified by a Path. pathR :: (Walker c m a, a ~ Generic a) => Path -> Rewrite c m (Generic a) -> Rewrite c m (Generic a) -- | Apply a Translate at a point specified by a Path. pathT :: (Walker c m a, a ~ Generic a) => Path -> Translate c m (Generic a) b -> Translate c m (Generic a) b -- | Check if it is possible to construct a Lens along this path -- from the current Node. testPathT :: (Walker c m a, a ~ Generic a) => Path -> Translate c m a Bool instance PathContext AbsolutePath instance Show AbsolutePath -- | This module contains various utilities that can be useful to users of -- KURE, but are not essential. module Language.KURE.Utilities -- | A basic error Monad. KURE users may use either KureMonad -- or their own Monad(s). data KureMonad a -- | Eliminator for KureMonad. runKureMonad :: (a -> b) -> (String -> b) -> KureMonad a -> b -- | Get the value from a KureMonad, providing a function to handle -- the error case. fromKureMonad :: (String -> a) -> KureMonad a -> a -- | A standard error message for when the child index is out of bounds. missingChild :: Int -> String allTgeneric :: (Walker c m a, Monoid b) => Translate c m (Generic a) b -> c -> a -> m b oneTgeneric :: Walker c m a => Translate c m (Generic a) b -> c -> a -> m b allRgeneric :: Walker c m a => Rewrite c m (Generic a) -> c -> a -> m (Generic a) anyRgeneric :: Walker c m a => Rewrite c m (Generic a) -> c -> a -> m (Generic a) oneRgeneric :: Walker c m a => Rewrite c m (Generic a) -> c -> a -> m (Generic a) childLgeneric :: Walker c m a => Int -> c -> a -> m ((c, Generic a), Generic a -> m (Generic a)) attemptAny2 :: Monad m => (a1 -> a2 -> r) -> m (Bool, a1) -> m (Bool, a2) -> m r attemptAny3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m (Bool, a1) -> m (Bool, a2) -> m (Bool, a3) -> m r attemptAny4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m (Bool, a1) -> m (Bool, a2) -> m (Bool, a3) -> m (Bool, a4) -> m r attemptAnyN :: Monad m => ([a] -> b) -> [m (Bool, a)] -> m b attemptAny1N :: Monad m => (a1 -> [a2] -> r) -> m (Bool, a1) -> [m (Bool, a2)] -> m r -- | Return the monadic result of a Translate and pair it with the -- argument. withArgumentT :: Monad m => Translate c m a b -> Translate c m a (m b, a) attemptOne2 :: MonadCatch m => (a -> b -> r) -> m (m a, a) -> m (m b, b) -> m r attemptOne3 :: MonadCatch m => (a -> b -> c -> r) -> m (m a, a) -> m (m b, b) -> m (m c, c) -> m r attemptOne4 :: MonadCatch m => (a -> b -> c -> d -> r) -> m (m a, a) -> m (m b, b) -> m (m c, c) -> m (m d, d) -> m r attemptOneN :: MonadCatch m => ([a] -> r) -> [m (m a, a)] -> m r attemptOne1N :: MonadCatch m => (a -> [b] -> r) -> m (m a, a) -> [m (m b, b)] -> m r childLaux :: (MonadCatch m, Node b) => (c, b) -> (b -> a) -> ((c, Generic b), Generic b -> m a) childL0of1 :: (MonadCatch m, Node b) => (b -> a) -> (c, b) -> ((c, Generic b), Generic b -> m a) childL0of2 :: (MonadCatch m, Node b0) => (b0 -> b1 -> a) -> (c, b0) -> b1 -> ((c, Generic b0), Generic b0 -> m a) childL1of2 :: (MonadCatch m, Node b1) => (b0 -> b1 -> a) -> b0 -> (c, b1) -> ((c, Generic b1), Generic b1 -> m a) childL0of3 :: (MonadCatch m, Node b0) => (b0 -> b1 -> b2 -> a) -> (c, b0) -> b1 -> b2 -> ((c, Generic b0), Generic b0 -> m a) childL1of3 :: (MonadCatch m, Node b1) => (b0 -> b1 -> b2 -> a) -> b0 -> (c, b1) -> b2 -> ((c, Generic b1), Generic b1 -> m a) childL2of3 :: (MonadCatch m, Node b2) => (b0 -> b1 -> b2 -> a) -> b0 -> b1 -> (c, b2) -> ((c, Generic b2), Generic b2 -> m a) childL0of4 :: (MonadCatch m, Node b0) => (b0 -> b1 -> b2 -> b3 -> a) -> (c, b0) -> b1 -> b2 -> b3 -> ((c, Generic b0), Generic b0 -> m a) childL1of4 :: (MonadCatch m, Node b1) => (b0 -> b1 -> b2 -> b3 -> a) -> b0 -> (c, b1) -> b2 -> b3 -> ((c, Generic b1), Generic b1 -> m a) childL2of4 :: (MonadCatch m, Node b2) => (b0 -> b1 -> b2 -> b3 -> a) -> b0 -> b1 -> (c, b2) -> b3 -> ((c, Generic b2), Generic b2 -> m a) childL3of4 :: (MonadCatch m, Node b3) => (b0 -> b1 -> b2 -> b3 -> a) -> b0 -> b1 -> b2 -> (c, b3) -> ((c, Generic b3), Generic b3 -> m a) childLMofN :: (MonadCatch m, Node b) => Int -> ([b] -> a) -> [(c, b)] -> ((c, Generic b), Generic b -> m a) instance Eq a => Eq (KureMonad a) instance Show a => Show (KureMonad a) instance Applicative KureMonad instance Functor KureMonad instance MonadCatch KureMonad instance Monad KureMonad -- | This is the main import module for KURE, which exports all the major -- components. The basic transformation functionality can be found in -- Language.KURE.Translate, and the traversal functionality can be -- found in Language.KURE.Walker. -- -- Note that Language.KURE.Injection and -- Language.KURE.Utilities are not exported here, but can be -- imported seperately. module Language.KURE