2/.4      !"#$%&'()*+,-./0123 foldr for ListT 45    A class for list types. % Every list has an underlying monad. :Transform an action returning a list to the returned list  > joinL $ Identity "hello"  "hello"  foldr for  s.  the result and ' right side' values are monadic actions.  Convert to a . ECan be done with a foldrL but included in type-class for efficiency. Convert from a . ECan be done with a foldrL but included in type-class for efficiency. Prepend an item to a 6 Convert a list to a 6  > fromList [] :: Maybe Int  Nothing  > fromList [5] :: Maybe Int  Just 5 5Convert between lists with the same underlying monad filter for any MonadPlus  > filter (> 5) (Just 3)  Nothing 7An action to do foldl for  s !Execute the monadic actions in a   An action to transform a   to a list ! > runIdentity $ toList "hello!"  "hello!" ;Consume a list (execute its actions) and return its length ! > runIdentity $ lengthL [1,2,3]  3 LTransform the underlying monad of a list given a way to transform the monad  > import Data.List.Tree (bfs) M > bfs (transformListMonad (\(Identity x) -> [x, x]) "hey" :: ListT [] Char)  "hheeeeyyyyyyyy" ALift the underlying monad of a list and transform it to a ListT.  Doing plain 'transformListMonad lift' instead doesn't give the compiler % the same knowledge about the types. *Consume all items and return the last one  > runIdentity $ lastL "hello"  'o' !  !  !   !"A monadic difference-list #$"#$"#$"#$#$%A monad transformer to create Lists.  & transforms a GeneratorT v m a to a  DListT m a. 89&O(1), Transform a GeneratorT to a " 'O(1), Output a result value (O(1), Output all the values of a ". %&'(%&'(%&'()!A monad tranformer for consuming  s. :;* Consume a  <+Consume/get the next value ,CReturn an instance of the underlying monad that will use the given )" to consume the remaining values. _ After this action there are no more items to consume (they belong to the given ConsumerT now) )*+,)*+,)*+, -A 'type-class synonym' for Trees. =.6Iterate a tree in DFS pre-order. (Depth First Search) >/ATransform a tree into lists of the items in its different layers 04Iterate a tree in BFS order. (Breadth First Search) ?1,Best First Search given a scoring function. @2#Best-First-Search given that a node'Js children are in sorted order (best first) and given a scoring function. T Especially useful for trees where nodes have an infinite amount of children, where 1 will get stuck. 3(Prune a tree or list given a predicate.  Unlike A/ which stops a branch where the condition doesn't hold,  prune cuts+ the whole branch (the underlying MonadPlus' s mzero). -./0123-.0/132-./0123B      !"#$%&'(()*+,-./0123456789:;<=*>.?@ABCD:EF generator-0.5Control.Monad.ListTData.List.ClassControl.Monad.DListControl.Monad.GeneratorControl.Monad.ConsumerData.List.TreeListTrunListTListItemConsheadLtailLNil foldrListTListjoinLfoldrLtoListT fromListTconsfromListconvListfilterfoldlLscanl genericTakeexecutesequence sequence_ takeWhiletoListlengthLtransformListMonad liftListMonadzipzipWithlastLrepeat transposeDListT runDListT GeneratorTgenerateyieldyields ConsumerT evalConsumerTnext consumeRestMTreedfs bfsLayersbfsbestFirstSearchOnbestFirstSearchSortedChildrenOnprune foldrListT'base Control.Monad MonadPlusfoldlL' runGeneratorT runConsumerT putNoProducersearch toListTreemergeOnmergeOnSortedHeadsGHC.List