-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A list-like type for lazy streams, which might terminate with an error. -- -- A list-like type for lazy streams, which might terminate with an -- error. @package failable-list @version 0.1 -- | A list-like type for lazy streams, which might terminate with an -- error. -- -- This module uses common names and so is designed to be imported -- qualified: -- --
--   import qualified Data.FailableList as FL
--   
module Data.FailableList -- | A list-like type for lazy sequences which might terminate with an -- error. -- -- Standard lists can be converted to failable lists using -- Prelude.foldr Next Done. data FailableList e a Next :: a -> (FailableList e a) -> FailableList e a Done :: FailableList e a Fail :: e -> FailableList e a -- | Like the standard map function, but the mapping function may -- return an error. map :: (a -> Either e b) -> FailableList e a -> FailableList e b -- | Like the standard foldr function, but accepting an extra -- parameter to handle Fail items. foldr :: (a -> b -> b) -> b -> (e -> b) -> FailableList e a -> b -- | Like the standard Data.List.unfoldr function, but the step -- function may return an error. unfoldr :: (b -> Either e (Maybe (a, b))) -> b -> FailableList e a instance (Eq e, Eq a) => Eq (FailableList e a) instance (Show e, Show a) => Show (FailableList e a) instance MonadFix (FailableList e) instance Traversable (FailableList e) instance Foldable (FailableList e) instance Applicative (FailableList e) instance Alternative (FailableList e) instance MonadPlus (FailableList e) instance Monad (FailableList e) instance Monoid (FailableList e a) instance Functor (FailableList e)