-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple extensible sum -- -- Simple extensible sum @package data-as @version 0.0.0.1 -- | This module provides the As class which is a multi parameter -- classy prism, much like how Has is a multi parameter classy -- lens. -- -- We have the following primary use case for As. -- --
--   -- some library code
--   throwE :: (As e err, MonadError err m) => e -> m ()
--   throwE = throwError . review asPrism
--   
module Data.As -- | A typeclass for extensible sums. -- -- The provided instances were inspired from the lens library. -- -- Making your own instances when you actually depend on lens should be -- as easy as instance As Foo Bar where asPrism = _Foo. class As a t previewer :: As a t => t -> Maybe a reviewer :: As a t => a -> t asPrism :: As a t => Prism t a modifier :: As a t => (a -> a) -> t -> t instance Data.As.As a a instance Data.As.As a (GHC.Maybe.Maybe a) instance Data.As.As () (GHC.Maybe.Maybe a) instance Data.As.As a (Data.Either.Either a b) instance Data.As.As b (Data.Either.Either a b) instance (GHC.Read.Read a, GHC.Show.Show a) => Data.As.As a GHC.Base.String instance Data.As.As Data.Void.Void a instance Data.Profunctor.Unsafe.Profunctor Data.As.Tagged instance Data.Profunctor.Choice.Choice Data.As.Tagged