{-| This module contains a collection of monads that
are defined in terms of the monad transformers from
"MonadLib". The definitions in this module are
completely mechanical and so this module may become
obsolete if support for automated derivations for instances
becomes well supported across implementations.
-}moduleMonadLib.Monads(Reader,Writer,State,Exception,Cont,runReader,runWriter,runState,runException,runCont,moduleMonadLib)whereimportMonadLibimportMonadLib.DeriveimportControl.MonadimportControl.Monad.FiximportData.MonoidnewtypeReaderia=R'{unR::ReaderTiIda}newtypeWriteria=W'{unW::WriterTiIda}newtypeStateia=S'{unS::StateTiIda}newtypeExceptionia=X'{unX::ExceptionTiIda}newtypeContia=C'{unC::ContTiIda}iso_R::Iso(ReaderTiId)(Readeri)iso_W::Iso(WriterTiId)(Writeri)iso_S::Iso(StateTiId)(Statei)iso_X::Iso(ExceptionTiId)(Exceptioni)iso_C::Iso(ContTiId)(Conti)iso_R=IsoR'unRiso_W=IsoW'unWiso_S=IsoS'unSiso_X=IsoX'unXiso_C=IsoC'unCinstanceBaseM(Readeri)(Readeri)whereinBase=idinstance(Monoidi)=>BaseM(Writeri)(Writeri)whereinBase=idinstanceBaseM(Statei)(Statei)whereinBase=idinstanceBaseM(Exceptioni)(Exceptioni)whereinBase=idinstanceBaseM(Conti)(Conti)whereinBase=idinstanceMonad(Readeri)wherereturn=derive_returniso_Rfail=derive_failiso_R(>>=)=derive_bindiso_Rinstance(Monoidi)=>Monad(Writeri)wherereturn=derive_returniso_Wfail=derive_failiso_W(>>=)=derive_bindiso_WinstanceMonad(Statei)wherereturn=derive_returniso_Sfail=derive_failiso_S(>>=)=derive_bindiso_SinstanceMonad(Exceptioni)wherereturn=derive_returniso_Xfail=derive_failiso_X(>>=)=derive_bindiso_XinstanceMonad(Conti)wherereturn=derive_returniso_Cfail=derive_failiso_C(>>=)=derive_bindiso_CinstanceFunctor(Readeri)wherefmap=derive_fmapiso_Rinstance(Monoidi)=>Functor(Writeri)wherefmap=derive_fmapiso_WinstanceFunctor(Statei)wherefmap=derive_fmapiso_SinstanceFunctor(Exceptioni)wherefmap=derive_fmapiso_XinstanceFunctor(Conti)wherefmap=derive_fmapiso_CinstanceMonadFix(Readeri)wheremfix=derive_mfixiso_Rinstance(Monoidi)=>MonadFix(Writeri)wheremfix=derive_mfixiso_WinstanceMonadFix(Statei)wheremfix=derive_mfixiso_SinstanceMonadFix(Exceptioni)wheremfix=derive_mfixiso_XinstanceReaderM(Readeri)iwhereask=derive_askiso_Rinstance(Monoidi)=>WriterM(Writeri)iwhereput=derive_putiso_WinstanceStateM(Statei)iwhereget=derive_getiso_S;set=derive_setiso_SinstanceExceptionM(Exceptioni)iwhereraise=derive_raiseiso_XinstanceContM(Conti)wherecallCC=derive_callCCiso_CrunReader::i->Readeria->arunWriter::Writeria->(a,i)runState::i->Stateia->(a,i)runException::Exceptionia->EitheriarunCont::(a->i)->Contia->irunReaderi=runId.runReaderTi.unRrunWriter=runId.runWriterT.unWrunStatei=runId.runStateTi.unSrunException=runId.runExceptionT.unXrunConti=runId.runContT(return.i).unCinstanceRunReaderM(Readeri)iwherelocal=derive_localiso_Rinstance(Monoidi)=>RunWriterM(Writeri)iwherecollect=derive_collectiso_WinstanceRunExceptionM(Exceptioni)iwheretry=derive_tryiso_X