| Maintainer | Ralf Laemmel, Joost Visser |
|---|---|
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell98 |
Data.Generics.Strafunski.StrategyLib.StrategyLib
Description
This module is part of StrategyLib, a library of functional strategy
combinators, including combinators for generic traversal. This is the
top-level module of the library. One only needs to import this module to
use the entire library. Some base modules are exported as well because
they are commonly used.
Synopsis
- module Control.Monad
- module Control.Monad.Fix
- module Control.Monad.Trans
- newtype Identity a = Identity {
- runIdentity :: a
- type State s = StateT s Identity
- newtype StateT s (m :: Type -> Type) a = StateT {
- runStateT :: s -> m (a, s)
- module Data.Monoid
- module Data.Generics.Strafunski.StrategyLib.MoreMonoids
- module Data.Generics.Strafunski.StrategyLib.StrategyPrelude
- module Data.Generics.Strafunski.StrategyLib.StrategyInfix
- module Data.Generics.Strafunski.StrategyLib.OverloadingTheme
- module Data.Generics.Strafunski.StrategyLib.TraversalTheme
- module Data.Generics.Strafunski.StrategyLib.FlowTheme
- module Data.Generics.Strafunski.StrategyLib.FixpointTheme
- module Data.Generics.Strafunski.StrategyLib.KeyholeTheme
- module Data.Generics.Strafunski.StrategyLib.NameTheme
- module Data.Generics.Strafunski.StrategyLib.PathTheme
- module Data.Generics.Strafunski.StrategyLib.EffectTheme
- type Coder = (Int, TU Int Maybe)
- type GList = (Integer -> TP Maybe, Integer)
- type GMap value = TU value Maybe
- type GSet = TU () Maybe
- modifyTP :: (MonadPlus m, Eq t, Term t) => TP m -> t -> m t -> TP m
- modifyTU :: (MonadPlus m, Eq t, Term t) => TU a m -> t -> m a -> TU a m
- emptyGSet :: GSet
- fullGSet :: GSet
- addGSet :: (Eq t, Term t) => t -> GSet -> GSet
- removeGSet :: (Eq t, Term t) => t -> GSet -> GSet
- containsGSet :: (Eq t, Term t) => t -> GSet -> Bool
- emptyGMap :: GMap v
- removeGMap :: (Eq t, Term t) => t -> GMap v -> GMap v
- containsGMap :: (Eq t, Term t) => t -> GMap v -> Bool
- putGMap :: (Eq t, Term t) => t -> v -> GMap v -> GMap v
- getGMap :: (Eq t, Term t) => t -> GMap v -> Maybe v
- sizeGList :: (a, b) -> b
- indxGList :: (a, b) -> a
- emptyGList :: GList
- addGList :: Term t => t -> GList -> GList
- putGList :: Term t => Integer -> t -> GList -> GList
- getGList :: Term t => Integer -> GList -> Maybe t
- mapGListTP :: TP Maybe -> GList -> GList
- mapGListTU :: Term t => (t -> ()) -> TU a Maybe -> GList -> [Maybe a]
- elemsGList :: Term t => (t -> ()) -> GList -> [t]
- nth :: [a] -> Integer -> a
- noCode :: Coder
- getCode :: Term x => Coder -> x -> Maybe Int
- setCode :: (Term x, Eq x) => Coder -> x -> Int -> Coder
- nextCode :: Coder -> (Int, Coder)
- enCode :: (Term x, Eq x) => Coder -> x -> Coder
- module Data.Generics.Strafunski.StrategyLib.RefactoringTheme
- module Data.Generics.Strafunski.StrategyLib.MetricsTheme
- module Data.Generics.Strafunski.StrategyLib.ChaseImports
Documentation
module Control.Monad
module Control.Monad.Fix
module Control.Monad.Trans
Identity functor and monad. (a non-strict monad)
Since: base-4.8.0.0
Constructors
| Identity | |
Fields
| |
Instances
| Monad Identity | Since: base-4.8.0.0 |
| Functor Identity | Since: base-4.8.0.0 |
| MonadFix Identity | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity | |
| Applicative Identity | Since: base-4.8.0.0 |
| Foldable Identity | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity Methods fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # | |
| Traversable Identity | Since: base-4.9.0.0 |
| Eq1 Identity | Since: base-4.9.0.0 |
| Ord1 Identity | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read1 Identity | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Show1 Identity | Since: base-4.9.0.0 |
| Bounded a => Bounded (Identity a) | Since: base-4.9.0.0 |
| Enum a => Enum (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods succ :: Identity a -> Identity a # pred :: Identity a -> Identity a # fromEnum :: Identity a -> Int # enumFrom :: Identity a -> [Identity a] # enumFromThen :: Identity a -> Identity a -> [Identity a] # enumFromTo :: Identity a -> Identity a -> [Identity a] # enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] # | |
| Eq a => Eq (Identity a) | Since: base-4.8.0.0 |
| Floating a => Floating (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods exp :: Identity a -> Identity a # log :: Identity a -> Identity a # sqrt :: Identity a -> Identity a # (**) :: Identity a -> Identity a -> Identity a # logBase :: Identity a -> Identity a -> Identity a # sin :: Identity a -> Identity a # cos :: Identity a -> Identity a # tan :: Identity a -> Identity a # asin :: Identity a -> Identity a # acos :: Identity a -> Identity a # atan :: Identity a -> Identity a # sinh :: Identity a -> Identity a # cosh :: Identity a -> Identity a # tanh :: Identity a -> Identity a # asinh :: Identity a -> Identity a # acosh :: Identity a -> Identity a # atanh :: Identity a -> Identity a # log1p :: Identity a -> Identity a # expm1 :: Identity a -> Identity a # | |
| Fractional a => Fractional (Identity a) | Since: base-4.9.0.0 |
| Integral a => Integral (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods quot :: Identity a -> Identity a -> Identity a # rem :: Identity a -> Identity a -> Identity a # div :: Identity a -> Identity a -> Identity a # mod :: Identity a -> Identity a -> Identity a # quotRem :: Identity a -> Identity a -> (Identity a, Identity a) # divMod :: Identity a -> Identity a -> (Identity a, Identity a) # | |
| Data a => Data (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) # toConstr :: Identity a -> Constr # dataTypeOf :: Identity a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) # gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # | |
| Num a => Num (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity | |
| Ord a => Ord (Identity a) | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity | |
| Read a => Read (Identity a) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Real a => Real (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational # | |
| RealFloat a => RealFloat (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods floatRadix :: Identity a -> Integer # floatDigits :: Identity a -> Int # floatRange :: Identity a -> (Int, Int) # decodeFloat :: Identity a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Identity a # exponent :: Identity a -> Int # significand :: Identity a -> Identity a # scaleFloat :: Int -> Identity a -> Identity a # isInfinite :: Identity a -> Bool # isDenormalized :: Identity a -> Bool # isNegativeZero :: Identity a -> Bool # | |
| RealFrac a => RealFrac (Identity a) | Since: base-4.9.0.0 |
| Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
| Ix a => Ix (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods range :: (Identity a, Identity a) -> [Identity a] # index :: (Identity a, Identity a) -> Identity a -> Int # unsafeIndex :: (Identity a, Identity a) -> Identity a -> Int inRange :: (Identity a, Identity a) -> Identity a -> Bool # rangeSize :: (Identity a, Identity a) -> Int # unsafeRangeSize :: (Identity a, Identity a) -> Int | |
| Generic (Identity a) | |
| Semigroup a => Semigroup (Identity a) | Since: base-4.9.0.0 |
| Monoid a => Monoid (Identity a) | Since: base-4.9.0.0 |
| Storable a => Storable (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods alignment :: Identity a -> Int # peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) # pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Identity a) # pokeByteOff :: Ptr b -> Int -> Identity a -> IO () # | |
| Bits a => Bits (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods (.&.) :: Identity a -> Identity a -> Identity a # (.|.) :: Identity a -> Identity a -> Identity a # xor :: Identity a -> Identity a -> Identity a # complement :: Identity a -> Identity a # shift :: Identity a -> Int -> Identity a # rotate :: Identity a -> Int -> Identity a # setBit :: Identity a -> Int -> Identity a # clearBit :: Identity a -> Int -> Identity a # complementBit :: Identity a -> Int -> Identity a # testBit :: Identity a -> Int -> Bool # bitSizeMaybe :: Identity a -> Maybe Int # bitSize :: Identity a -> Int # isSigned :: Identity a -> Bool # shiftL :: Identity a -> Int -> Identity a # unsafeShiftL :: Identity a -> Int -> Identity a # shiftR :: Identity a -> Int -> Identity a # unsafeShiftR :: Identity a -> Int -> Identity a # rotateL :: Identity a -> Int -> Identity a # | |
| FiniteBits a => FiniteBits (Identity a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int # countLeadingZeros :: Identity a -> Int # countTrailingZeros :: Identity a -> Int # | |
| Generic1 Identity | |
| MonadRun (StateAlg s) (State s) # | Running the |
Defined in Control.Monad.Run | |
| MonadRun ((->) :: Type -> Type -> Type) Identity # | Running the |
Defined in Control.Monad.Run | |
| type Rep (Identity a) | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity | |
| type Rep1 Identity | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity | |
type State s = StateT s Identity #
A state monad parameterized by the type s of the state to carry.
The return function leaves the state unchanged, while >>= uses
the final state of the first computation as the initial state of
the second.
newtype StateT s (m :: Type -> Type) a #
A state transformer monad parameterized by:
s- The state.m- The inner monad.
The return function leaves the state unchanged, while >>= uses
the final state of the first computation as the initial state of
the second.
Instances
| Monad m => MonadState s (StateT s m) | |
| MonadError e m => MonadError e (StateT s m) | |
Defined in Control.Monad.Error.Class Methods throwError :: e -> StateT s m a # catchError :: StateT s m a -> (e -> StateT s m a) -> StateT s m a # | |
| MonadTrans (StateT s) | |
Defined in Control.Monad.Trans.State.Lazy | |
| MonadUnTrans (StateAlg s) (StateT s) # | Unlifting the state monad transformer |
| MonadRun (StateAlg s) (State s) # | Running the |
Defined in Control.Monad.Run | |
| Monad m => Monad (StateT s m) | |
| Functor m => Functor (StateT s m) | |
| MonadFix m => MonadFix (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| MonadFail m => MonadFail (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| (Functor m, Monad m) => Applicative (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| Contravariant m => Contravariant (StateT s m) | |
| MonadIO m => MonadIO (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| (Functor m, MonadPlus m) => Alternative (StateT s m) | |
| MonadPlus m => MonadPlus (StateT s m) | |
module Data.Monoid
modifyTP :: (MonadPlus m, Eq t, Term t) => TP m -> t -> m t -> TP m #
Pointwise modification of type-preserving strategies
modifyTU :: (MonadPlus m, Eq t, Term t) => TU a m -> t -> m a -> TU a m #
Pointwise modification of type-unifying strategies
containsGSet :: (Eq t, Term t) => t -> GSet -> Bool #
Test whether a given element is contained in a generic set
removeGMap :: (Eq t, Term t) => t -> GMap v -> GMap v #
Remove an element from a generic map (my key)
containsGMap :: (Eq t, Term t) => t -> GMap v -> Bool #
Test whether an element with given key is contained in a generic map
putGMap :: (Eq t, Term t) => t -> v -> GMap v -> GMap v #
Add an entry with given key and value to a generic map
getGMap :: (Eq t, Term t) => t -> GMap v -> Maybe v #
Obtain the value for a given key from a generic map
emptyGList :: GList #
elemsGList :: Term t => (t -> ()) -> GList -> [t] #