ideas-1.6: 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

class Update f where Source #

Minimal complete definition

update

Methods

update :: f a -> (a, a -> f a) Source #

Instances

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

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

class Wrapper f where Source #

Minimal complete definition

wrap, unwrap

Methods

wrap :: a -> f a Source #

unwrap :: f a -> a Source #

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

data Mirror a Source #

Instances

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.