ideas-1.5: Feedback services for intelligent tutoring systems

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellSafe
LanguageHaskell98

Ideas.Common.Traversal.Utils

Contents

Description

 

Synopsis

Update type class

current :: Update f => f a -> a Source

change :: Update f => (a -> a) -> f a -> f a Source

replace :: Update f => a -> f a -> f a Source

changeM :: Update f => (a -> Maybe a) -> f a -> Maybe (f a) Source

changeG :: (Update f, Monad g) => (a -> g a) -> f a -> g (f a) Source

Focus type class

class Focus a where Source

Minimal complete definition

unfocus

Associated Types

type Unfocus a Source

Methods

focus :: Unfocus a -> a Source

focusM :: Unfocus a -> Maybe a Source

unfocus :: a -> Unfocus a Source

liftFocus :: Focus a => (Unfocus a -> Maybe (Unfocus a)) -> a -> Maybe a Source

unliftFocus :: Focus a => (a -> Maybe a) -> Unfocus a -> Maybe (Unfocus a) Source

Wrapper type class

liftWrapper :: (Monad m, Wrapper f) => (a -> m a) -> f a -> m (f a) Source

unliftWrapper :: (Monad m, Wrapper f) => (f a -> m (f a)) -> a -> m a Source

mapWrapper :: Wrapper f => (a -> a) -> f a -> f a Source

Mirror

Utility functions

(>|<) :: (a -> Maybe a) -> (a -> Maybe a) -> a -> Maybe a infixr 0 Source

safe :: (a -> Maybe a) -> a -> a Source

fixp :: (a -> Maybe a) -> a -> a Source

fixpl :: (a -> Maybe a) -> a -> [a] Source

mplus :: MonadPlus m => forall a. m a -> m a -> m a

an associative operation

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1

Left-to-right Kleisli composition of monads.