HOOG53a *,.1134:;>?DEJJMNQRc ,,56FFKLd#$+.3488:;MNe!!#$'*3478:;>ADEHIMNQTf++g00GGhIIKRi "")+--89@AFFKTkl ""//99HHm0GGn  ,.005AJLo  !+.0057IIKLp*12r  !!#&)*..3CFGIJMPSTs ""%(..0199<?BGJJORt "$$&*,,./2249;;=ACTu225Av w %&)*<=@CIIKTxy++88z|UUy!k)-m()=->AllAnyArithExceptionArrayExceptionAsyncExceptionBool| BufferModej BufferStatefCCharCClockCDevCDoubleaCFloatCInoCIntxCIntMax0CIntPtrCLDoubleCLLongGCLongCModeCOffoCPid'CPtrdiffCSCharCShortO CSigAtomicCSizeCSsizewCTimeECUCharCUIntCUIntMaxmCUIntPtr%CULLongCULongCUShortMCWcharChanCharComplex ConsoleEventConstr ConstrRep|DataRepsDataType_DoubleDynamicE12E6Errno ExceptionExitCodeFDTypeFdhFixity_FloatGeneralCategoryHandle HandlePosn HandleTypeHashDataIOwIOErrore IOErrorType\ IOExceptionSIOMode9Id$Identity InsertsIntInt16fInt32Int64Int8sIntPtr+Integer Lexeme ListT Maybe OrderingT PC QSem9 QSemN/ ReadP ReadPrec STM SeekMode StableName String TVar ThreadId Timeout TyCon TypeRepy Uniqueq VersionV WeakK Word Word16 Word32X Word64 Word8 WordPtrn ZipListY [::]J []  TraversableFoldableMonadFix Applicative Alternative MonadPlusFunctorMonadFunctorMonadFunctor Applicative ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataEqOrdNumEnumIntegralBitsShowRealBoundedIxRead PrintfArgStorableDataNumEnumIntegralBitsShowRealBoundedIxReadOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq Typeable1EqOrdShowReadTypeableOrdEqDataDataEqTypeableDataShowEqOrdTypeable Typeable1Error Typeable1ShowReadEnumIxOrdEq Typeable1FunctorMonadFunctorMonad MonadPlusFunctorMonad MonadPlusTypeableTypeableMonad MonadPlus MonoidDataReadShowBoundedEnumIxOrdEq TraversableFoldableMonadFix Applicative AlternativeFunctorMonad MonadPlus MonadTransShowEqRead PrintfArgBitsDataReadEqOrdNumEnumShowIxRealIntegral ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataEqOrdShowNumEnumIntegralReadBitsRealBoundedIx PrintfArgStorableDataShowNumEnumIntegralReadBitsRealBoundedIxOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgBitsStorableDataReadShowNumBoundedEnumIxRealIntegralEqOrdEqFunctorMonadMonadFixFunctor ApplicativeShowReadEnumIxOrdEqEqShowEqShowError MonadError MonadPlus MonadErrorMonadIOMonadFix ApplicativeFunctorMonadShowEqShowEqShowDataEqShowIxBoundedShowReadEnumOrdEq PrintfArgStorableDataEqOrdNumReal FractionalRealFracFloating RealFloatShowEnumReadShowEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqEqShowReadOrdEqShowEqEq HasResolution HasResolutionTypeableShow PrintfArgStorableDataEqOrdNumReal FractionalFloatingRealFrac RealFloatShowEnumReadTypeableDataShowShowEqShowEqShowEqReadShowEnumOrdEqTypeable Typeable1 PrintfArgIsCharStorableDataReadShowBoundedEnumIxEqOrd Typeable1 ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqEqShowReadOrdEq StorableDataReadShowBoundedEnumIxOrdEqShowOrdEqShowOrdEqShowOrdEqMonoidBoundedShowReadOrdEqMonoidBoundedShowReadOrdEqArrow ArrowChoice ArrowApply ArrowLoop MonoidDataReadShowBoundedEnumIxEqOrdo4 ByteCount!CDir!CDirent!CFLock!CGroup!CLconv!CPasswd! CSigaction!CSigset!CStat!CStringw! CStringLen\!CTermiosW!CTmR!CTmsM!CUtimbufH!CUtsnameC!CWString3! CWStringLen! ClockTick!ConIndex!DeviceID! EpochTime FD FileID FileMode FileOffset FilePath FinalizerEnvPtr FinalizerPtry Generici GenericBe GenericMU GenericQJ GenericR? GenericT6 HandlePosition, IOError IPr Limit MicroPicoPrecProcessGroupID ProcessIDRational RawBufferReadSrSTRepE SampleVar#ShowSString[]Char[]Char[]CharaMVar(,)IntMVarasaState#s(#,#)State#saa[]Char[](,)a[]CharMutableByteArray# RealWorldRatioIntegerCPidCPidIntFixedE12FixedE6CLong(,)IntInt IOExceptionIntegeraammararmamaacacaaFunPtrPtraIO()envaFunPtrPtrenvPtraIO()[]CharCOffCModeCInoCIntCTimeCDevIntCClock(,)PtrCWcharIntPtrCWchar()()()()()(,)PtrCCharIntPtrCChar()()()()()()()()()CSize(y:y[Oya5sboccdV_e\fVgtThQiJjJkJlGmCn@o<p8q8r1s,t(u0&v%w"zT"|I"|i["pb"li"ip"sw"t~"ZipList#%1%3%6%8%e[%o$r"a#i"t"e"bc#h0#m#r"Writert"WriterTo#d#e$#IOModea7#n>#dE#lL#eS# HandleTypeuj#fq#fx#e#r# BufferStatep#a[$m-$p#e#d#a#m#o#n#a#d# WrappedMonadr$r $o$w$ WrappedArrowo4$n;$aB$dI$ WrappedMonadrb$ri$op$ww$ WrappedArrowr$d$Word#L%15%3%6$8$p$t$r$WordPtrWord84$Word64# %Word64#2%%Word326<%Word16Word#ab%ki%Weak#|%Weak##%Word84%#%Word642%#%Word326%#%Word16Worde%r&s &i&o&n&Versionn&p&sA&eH&rO&eV&r]&rd&ok&rr& IOErrorTypep&e&r&c&a&s&e&l&e&t&t&e&r&GeneralCategorydX(i (s'a'u'p'p'o%'r,'t3'e:'dA'oH'pO'eV'r]'ad'tk'ir'oy'n' IOErrorTypet'i's'f'i'e'd'c'o'n's't'r'a'i'n(t(s( IOErrorTypeq:(t,(UnituA(eH(Uniquee_(f(rk(fr(ly(o(w(ArithExceptioni(n(e(d(e(l(e(m(e(n(t(ArrayExceptionh+i*r]*vA*y)c$*p#)e*)aU)r6)e=)pD)TypeRepb\)lc)ej)Typeable1*2)3)4)5)6)7) Typeable7 Typeable6 Typeable5 Typeable4 Typeable3 Typeable2 Typeable1o+*n2*TyConaH*rO*TVaraz*ui*ep*Boolv*e*r*s*a*b*l*e* Traversablem<+t*l*e*c*a*s*e*l+e +t+t+e +r'+GeneralCategoryeC+eJ+xQ+pX+i_+rf+em+dt+ IOErrorTyper+e+a+d+i+k+i+l+l+e+d+AsyncExceptiond+ThreadId#, ThreadId##1a1e0h?0p/t -u,y?,m,sK,tR,eY,m`,eg,rn,ru,o|,r, IOErrorTypeb,o,l,Lexemem-r,r,o,g,a,t,e,GeneralCategorySumSTaF.m9.o.r--e-i9-n@-gG-Stringc|-ra-eh-po-DataRepo-n-s-t-r- ConstrRepa-f-p-t-STretSTRepSTRefm-FDTyper .a.b.l .e'.StorableSTMb/c.r.t\.ec.State#.t|.StateTState#r.a.y.STArrayk.o.v.e.r.f.l.o.w/AsyncExceptionl/e#/ni/p//t6/r=/ StablePtr#U/ StablePtr#ap/mw/e~/ StableNamea/c/e*0i/n/g/c/o/m/b/i/n/i/n/g/m0a0r0k0GeneralCategoryGeneralCategoryo0uK0tR0dY0o`0wg0nn0 ConsoleEventw0Shows0ShowSe 1m0i0c0l0o0s0e0d0h0a0n0d1l 1e1 HandleTypek'1fZ1m31o:1dA1eH1SeekModera1oh1mo1ev1n}1d1SeekModem1p1l1e1v1a1r1 SampleVarIntegera7eA2i 2w1s2RWSt2RWSTg'2h.2t52Eitherao5c4gZ4l 4q3s2tf2um2rt2n{2i2n2o2r2d2e2r2ArgOrdero2u2r2c2e2by3e03v2a2n2i3s 3h3e3d3 IOErrorTypex73h>3aE3uL3sS3tZ3ea3dh3 IOErrorTypeu3s3y3 IOErrorTypea3u3i3r3e3o3r3d3e3r3ArgOrderr3g3ArgDescra4t4i"4v)4e04s74e>4eE4kL4SeekModeua4lh4ao4rv4f}4i4l4e4FDTypec/5s4u4p4d4e4r4r4o4r4 Exceptione4l4e5r 5r5o5r 5 Exceptiono65n=5eD5rK5rR5oY5r`5 Exceptiond6l{5Realf5w5o5r5l5d5 RealWorldl5r5a5c5RealFraco5a5t6 RealFloatReadb7eZ7h'7m7p6s6wG6rN6iU6t\6ec6h6mo6ov6d}6e6IOModea6n6d6l6e6 HandleTypeReadSReadPr6e6c6ReadPreco 7d7e7IOModea.7n57d<7lC7eJ7 HandleTypera7Readertv7ReaderTu7f7f7e7r7 BufferStatet88w7b8d7e7v7i7c7e7FDTypeu 8f8f8e8r%8 RawBufferLexemeiI8oP8Rationd8ak8lr8Rationals8e8m8QSemn8QSemNa;e>;i";o;r9t8u8n8c8Lexemer9Ptre:i#:o9c9d9t09o79c>9oE9lL9eS9rZ9ra9oh9ro9 IOErrorTypeu9c9t9Producte9s9s9g9i9d9 ProcessIDr9o9u9p9i:d :ProcessGroupIDnn:v/:a6:t=:eD:uK:sR:eY:GeneralCategorytu:f|:a:t:y:p:e: PrintfTyper:g: PrintfArgc:f:i:x:FixityPreco ;l;Poolc);o0;PicorE;mL;it;uX;t_;ef;ArgOrders{;s;i;o;n;d;e;n;i;e;d; IOErrorTyperH<t;t;e;r;n;m<a<t<c<h<f$<a+<i2<l9< ExceptionaO<gV<r]<ad<pk<hr<sy<e<p<a<r<a<t<o<r<GeneralCategoryOpaqueb?p>r>t)=v<e<r<f=l=o=w=ArithExceptionh0=e7=r>=e\>l$>n=p=sY=y`=mg=bn=ou=l|=GeneralCategoryu=n=c=t=u=a=t=i=o=n=GeneralCategoryu=m=b>e>r>GeneralCategorye+>t2>t9>e@>rG>GeneralCategoryrc>rj>oq>rx> IOErrorTyped>Orde>r>i>n>g>Orderinga?eX?t>ao>n?OptDescre?s?c#?r*?OptDescrrC?gJ?ArgDescrn_?pf?um?nt?c{?t?u?a?t?i?o?n?GeneralCategoryq?u?e?Opaquej?e?c?t@ObjecteBo7@u#@m*@NumaBbCBmAn2ArAs@t\@a@hh@io@nv@g}@Maybes@s@i@g@n@e@d@GeneralCategoryu@c@h@t@h@i@n@gA IOErrorTypeeAp%ADataRepsAt>AeEArLAmSAiZAnaAahAtoAivAo}AnA ExceptionpAaAcAiAnAgAmAaArAkAGeneralCategoryeAtAhBo BdBeBrBr&Bo-Br4B ExceptionuJBfQBfXBe_BrfBimBntBg{B BufferModerBgBArgDescrsBtBeBdBaBtBoBmBiBcBaBlBlCy C Exceptiona3GiGoQDucCv3Ca:CrACMVar#TCMVar#tjCaCvvCa}CrC#CMutVar#bClCeCaDbCyCtCeCaCrCrCaCyC#CMutableByteArray#rDr%Da,Dy3D#:D MutableArray#dpFn]DaDoiDipDdwDMonoiddDMonad cHFeFfEiEpErbEs2EtEwDrDiDtDeDrD MonadWriterr EaEnEsE MonadTranst9Ea@EtGEeNE MonadStateeEwnEsuEMonadRWSaEdEeErE MonadReaderlEuEsE MonadPlusoEMonadIOiExFMonadFixrFr&Fo-Fr4F MonadErroroOFnVFt]F MonadContiwFf~FiFeFrFlFsFyFmFbFoFlFGeneralCategoryeFtFtFeFrFGeneralCategorycGrGo$GMicrot\Gy?GbFGeMGMaybehcGsjGyqGmxGbGoGlGGeneralCategoryadJeIiHoGtGOrderinggHsEHwGeGrGcGaGsGeHl HeHtHt"He)Hr0HGeneralCategorysLHoSHfZHpaHrhHeoHcvHi}HsHiHoHnHArithExceptionoHfHfH ConsoleEventmInIsHtHtHListTe IbbIsIeIp#Ia*Ir1Ia8It?IoFIrMIGeneralCategoryuiIfpIfwIe~IrIiInIgI BufferModeiItILimitfQJtIxIeImIeILexemetJe JrJnJu Jm'Jb.Je5JrOaEOlLOqSOuZOoaOthOeoOGeneralCategoryiOxOFixityeOxOoOuOtOoOfObOoOuOnOdOsOArrayExceptionpPpPr"Po)Pp0Pr7Pi>PaEPtLPeSPtZPyaPphPeoP IOErrorTypelPePgPaPlPoPpPePrPaPtPiPoPnP IOErrorTypenPoQrQeQHandlere#Qn*Qt1QLexemeiBQtIQyPQIdentity#iQInt84zQ#QInt642Q#QInt326Q#QInt16IntaRe,RpQrQiQnQtQfQtRy RpReR HPrintfTypea3Rp:RoARvHReORrVRf]RldRokRwrRAsyncExceptionnSr/SsRhRrReRsRoRlRuRtRiRoRnR HasResolutiontSaSbSlSeS HashTabled6Sw=SaDSrKSeRSfYSa`SugSlnStuS IOErrorTypedSlSeSHandle_[TpSrStSySpSeS HandleTypeHandleroTsTi'TnT HandlePosnt.Ti5ToXr#Xe*Xp1XDataRepnEXgLXFloatingoeXnlXssXtzXrX ConstrRepFloat#lYnYrXxXeXiXtXyXFixitydXFixedsXtYFirstaYl!Yi^Yq-Yu4Yo;YtBYeIYGeneralCategoryzeYelYrsYeYpYtYrY FinalizerPtrnYvYpYtYrYFinalizerEnvPtreYhZiZm_Zo(ZpZaZtZhZFilePathf/Zf6Zs=ZeDZtKZ FileOffsetofZdmZetZFileModedZFileIDaZnZdZlZeZHandleer[f[gZeZnZeZrZi[c[FFFormatiO[o![r([m/[a6[t=[FFFormatxV[e][dd[FFFormatxy[p[o[n[e[n[t[FFFormatFDFdt[y[p[e[FDTypel[s[e\BoolFloat 1B_66_i _nt^oa^p^q^r]xG\cN]iS\tZ\c']e\f\sp\uw\c~\c\e\s\s\ExitCodea\i\l\u\r\e\ExitCodex\c\e\p\t]i ]o]n] Exceptiono.]d5]e<]ExitCodeeU]p\]tc]ij]oq]nx] Exceptionr]n]o]r]Errorc]t]ErrorTa]l]l] Exceptiono]ErrnoOrderingEqo$^c+^h2^t9^i@^mG^eN^ EpochTimefh^Lexemec^d^u^m^Enumo^Endol^o^s^i^n^g^m^a^r^k^GeneralCategoryt_h_e_r&_EitherE62I_E12#cabe~ai`o`u;`y{_n_a`e_i_o_e_r_r_o_r_ IOErrorTypex_c_e_p_t_i_o_n` Exceptionm`i#`c*`Dynamica`pG`lN`eU`x\`hc`aj`nq`dx`l`e`Handlel`Dualu`b`l`e`Double#`Double#rHav`i`dae abayazae&ar-ao4aArithExceptioneOacVat]aodarkayraFDTypeabc.bfbnavaiacaeaiadaDeviceIDoaramaaalaArithExceptiona bublbt!bHandleri5bmllEleLl HandleTypegclCLongkyltlilclkl ClockTickolnlglCLLongolulblllelCLDoubleo mnmvmCLconvm.mp5mbasStateC*awWriterbnListT5brContJbrReader9bsState.bw'Writer/sa(,)wa(,) ws(,) ()mE-,aIdentity$am HGB=;%#rmsmwmwsa(,,)maeEithermba(,)mFsa(,)mwa(,)m! ws(,)ma[]m ̈cGÆy9uEւ}ÁgPrarbJrmarmbIambmaHsr(,)sr'A@ ar;asBba9bwFra:rr=<rr'?>ssEDCwwGame#rma8w'sb(,,)wsa(,,)0sb(,)sa(,).w'b(,)wa(,)/bnam6rmrm7 w'sb(,,)nwsa(,,)m3be'EithernaeEitherm4sb(,)nsa(,)m1w'b(,)nwa(,)m2b[]na[]m5a'$e%r :)('&    s,+*)(    w-amswrRWSTA3 aswrRWS@0 ameErrorT4amrContTI7amrReaderT?amsStateTD1amwReaderT6amwWriterT2wsa(,,)(amListT5 arContJ<arReader>9asStateC.awWriter/sa(,)*wa(,)Char[]aIOaIdentityamGF=&#"!rm8wwa(,)mwsa(,,)m)aeEithermsa(,)m+wa(,)ma[]m JdQB7,! ؎ɎvgXI:# ߍȍxmb;ƌtO( ݋΋ËZO(ϊe>'56; MonadContm= MonadWriterm MonadWriterwV MonadWriterm MonadWriterwd MonadStatem MonadStatesT MonadStatem MonadStates87W MonadReaderm MonadReaderr": MonadReaderm MonadReaderr&#'%$Z[bc^_XY`a\] MonadWriterm MonadWriterwh MonadStatem MonadStates~z|vx+- MonadErrore MonadErrorm< MonadErrore MonadErrormMonadm MonadTranstU MonadWriterm MonadWriterw!g MonadWriterm MonadWriterwErroraStringQRMonadmstOPqrMNMonadmEFMonadmopKLCDmn43klIJMonadmABMonadmijGH?@21MonadIOm0/.fErroraS MonadStatem MonadStates9 MonadReaderm MonadReaderrUؚĚtJ.ޙ~Z<֘zfB&ΗjN0֖|Z8ޕĕ|hV6ĔhH,̓dDڒ’x\>ޑxP* ||writert6WriterTwriter[Writer withstatet withStateT withstate withStatewithrwstˑwithRWSTwithrwswithRWS withreadert  withReaderT8 withreader- withReader7 withconttL withContT6withcontiwithCont5transTrans throwerror throwErrortelltellstrmsg͒strMsgstrictStrictstatetStateTstate(State}~rwstMRWSTyz{|rwslRWSuvwx runwritert runWriterTst runwriter runWriterqr runstatetړ runStateToprunstaterunStatemnrunrwstrunRWSTklrunrws7runRWSij runreadertW runReaderT4 runreaderv runReader3runlisttrunListT2 runidentity runIdentity1 runerrortҔ runErrorT0runconttrunContT/runcont runCont.readert$ReaderT,-readerAReader*+put^puthpassqpassgnomsgnoMsgfmtlmtl monadtrans MonadTrans)monadioЕMonadIO( monadcont MonadContemodifymodifyd mapwritert# mapWriterTbc mapwriterF mapWriter`a mapstateth mapStateT^_mapstatemapState\]maprwstmapRWSTZ[maprwsŖmapRWSXY mapreadert mapReaderT' mapreader mapReader&maplistt!mapListT% maperrort> mapErrorT$mapcontt[mapContT#mapcontvmapCont"locallocalWlisttListT !listenslistensVlistenٗlistenUlistList liftioliftIOliftliftlazy/Lazy identityOIdentitygetsogetsTgetgetS execwritert execWriterTQR execwriter execWriterOP execstatet execStateTMN execstate execStateKLexecrwst)execRWSTIJexecrwsHexecRWSGH evalstateti evalStateTEF evalstate evalStateCDevalrwstevalRWSTABevalrws̙evalRWS?@errortErrorTerrorError>conttContTcont7ContclassTClasscensorcensor= catcherror catchError<callcccallCC;asks͚asks:askask9,)(y$T#!"`n_1^ A &WR42qo:GyJ= /eAE8~yt w*ptxB(u2j|";T8U3*BýD&@:s>sѷ=ĵ )t5aϦڥm6ɤ֣Ytvb |class (Monoid w, Monad m) => | (MonadWriter w m) (m -> w)|class  Monad m => | (MonadState s m) (m -> s)oget returns the state from the internals of the monad. put replaces the state inside the monad. |class  Monad m => | (MonadReader r m) (m -> r)See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.  |class @(Monoid w, MonadReader r m, MonadWriter w m, MonadState s m) => | (MonadRWS r w s m) (m -> r)|class  Monad m => | (MonadError e m) (m -> e)?The strategy of combining computations that can throw exceptions by bypassing bound functions from the point an exception is thrown to the point that it is handled. Is parameterized over the type of error information and the monad type constructor. It is common to use Data.Either String as the monad type constructor for an error monad in which error descriptions take the form of strings. In that case and many other common cases the resulting monad is already defined as an instance of the MonadError class. You can also define your own error type and/or use a monad type constructor other than Data.Either String or Data.Either IOError. In these cases you will have to explicitly define instances of the Error and/or MonadError classes. WriterTWriterT :: m (a, w) ->  WriterT w m aңm(,)awWriterTwmaWriterTnewtype WriterT w m a WriterTWriterT :: m (a, w) ->  WriterT w m aam(,)awWriterTwmaWriterTnewtype WriterT w m aŤWriterWriter :: (a, w) ->  Writer w a2(,)awWriterwaWriternewtype Writer w aiWriterWriter :: (a, w) ->  Writer w a֥(,)awWriterwaWriternewtype Writer w a  withStateT withStateT :: (s -> s) ->  StateT s m a ->  StateT s m a~ssStateTsmaStateTsmaSimilar to withState  withStateT withStateT :: (s -> s) ->  StateT s m a ->  StateT s m am<ssStateTsmaStateTsmaSimilar to withState  withState withState :: (s -> s) ->  State s a ->  State s assStatesaStatesaBApply this function to this state and return the resulting state.  withState withState :: (s -> s) ->  State s a ->  State s aƨssStatesaStatesaBApply this function to this state and return the resulting state. withRWSTwithRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m ar's(,)rsRWSTrwsmaRWSTr'wsmawithRWSTwithRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m asr's(,)rsRWSTrwsmaRWSTr'wsmawithRWSwithRWS :: (r' -> s -> (r, s)) ->  RWS r w s a ->  RWS r' w s ap0r's(,)rsRWSrwsaRWSr'wsawithRWSwithRWS :: (r' -> s -> (r, s)) ->  RWS r w s a ->  RWS r' w s a%r's(,)rsRWSrwsaRWSr'wsa throwError throwError :: MonadError e m => e -> m a MonadErroremema telltell :: MonadWriter w m => w -> m () MonadWriterwmwm()strMsgstrMsg ::  Error a => String -> afErroraStringaStateTStateT :: s -> m (a, s) ->  StateT s m a ޭsm(,)asStateTsmaStateTnewtype StateT s m aBA parameterizable state monad for encapsulating an inner monad. The StateT Monad structure is parameterized over two things:
  • s - The state.
  • m - The inner monad.
Here are some examples of use: (Parser from ParseLib with Hugs)
type Parser a = StateT String [] a
   ==> StateT (String -> [(a,String)])
For example, item can be written as:
item = do (x:xs) <- get
       put xs
       return x

type BoringState s a = StateT s Indentity a
     ==> StateT (s -> Identity (a,s))

type StateWithIO s a = StateT s IO a
     ==> StateT (s -> IO (a,s))

type StateWithErr s a = StateT s Maybe a
     ==> StateT (s -> Maybe (a,s))
StateTStateT :: s -> m (a, s) ->  StateT s m aesm(,)asStateTsmaStateTnewtype StateT s m aɱA parameterizable state monad for encapsulating an inner monad. The StateT Monad structure is parameterized over two things:
  • s - The state.
  • m - The inner monad.
Here are some examples of use: (Parser from ParseLib with Hugs)
type Parser a = StateT String [] a
   ==> StateT (String -> [(a,String)])
For example, item can be written as:
item = do (x:xs) <- get
       put xs
       return x

type BoringState s a = StateT s Indentity a
     ==> StateT (s -> Identity (a,s))

type StateWithIO s a = StateT s IO a
     ==> StateT (s -> IO (a,s))

type StateWithErr s a = StateT s Maybe a
     ==> StateT (s -> Maybe (a,s))
StateState :: s -> (a, s) ->  State s as(,)asStatesaStatenewtype State s a<A parameterizable state monad where s is the type of the state to carry and a is the type of the return value. StateState :: s -> (a, s) ->  State s a9s(,)asStatesaStatenewtype State s anA parameterizable state monad where s is the type of the state to carry and a is the type of the return value. RWST RWST :: r -> s ->  m (a, s, w) -> RWST r w s m a^rsm(,,)aswRWSTrwsmaRWSTnewtype RWST r w s m aͷRWST RWST :: r -> s ->  m (a, s, w) -> RWST r w s m ao9rsm(,,)aswRWSTrwsmaRWSTnewtype RWST r w s m aRWS RWS :: r -> s ->  (a, s, w) ->  RWS r w s a: rs(,,)aswRWSrwsaRWSnewtype RWS r w s aoRWS RWS :: r -> s ->  (a, s, w) ->  RWS r w s aԹrs(,,)aswRWSrwsaRWSnewtype RWS r w s a6 runWriterT runWriterT ::  WriterT w m a -> m (a, w)WriterTwmam(,)aw runWriterT runWriterT ::  WriterT w m a -> m (a, w)<WriterTwmam(,)aw runWriter runWriter ::  Writer w a -> (a, w)Writerwa(,)aw runWriter runWriter ::  Writer w a -> (a, w)"Writerwa(,)aw runStateT runStateT ::  StateT s m a -> s -> m (a, s)StateTsmasm(,)as runStateT runStateT ::  StateT s m a -> s -> m (a, s)@StateTsmasm(,)asrunStaterunState ::  State s a -> s -> (a, s)Statesas(,)asrunStaterunState ::  State s a -> s -> (a, s)>Statesas(,)asrunRWST runRWST :: RWST r w s m a -> r -> s ->  m (a, s, w)RWSTrwsmarsm(,,)aswrunRWST runRWST :: RWST r w s m a -> r -> s ->  m (a, s, w)XRWSTrwsmarsm(,,)aswrunRWS runRWS ::  RWS r w s a -> r -> s ->  (a, s, w)&RWSrwsars(,,)aswrunRWS runRWS ::  RWS r w s a -> r -> s ->  (a, s, w)RWSrwsars(,,)aswputput :: MonadState s m => s -> m ()/  MonadStatesmsm() passpass :: MonadWriter w m =>  m (a, w -> w) -> m a MonadWriterwmm(,)awwmanoMsgnoMsg ::  Error a => a Erroraa MonadContclass  Monad m =>  MonadCont mQmodifymodify :: MonadState s m => (s -> s) -> m () MonadStatesmssm()`Monadic state transformer. Maps an old state to a new state inside a state monad. The old state is thrown away.
Main> :t modify ((+1) :: Int -> Int)
modify (...) :: (MonadState Int a) => a ()
This says that modify (+1) acts over any Monad that is a member of the MonadState class, with an Int state.  mapWriterT mapWriterT :: (m (a, w) -> n (b, w')) ->  WriterT w m a -> WriterT w' n b m(,)awn(,)bw'WriterTwmaWriterTw'nb mapWriterT mapWriterT :: (m (a, w) -> n (b, w')) ->  WriterT w m a -> WriterT w' n bm(,)awn(,)bw'WriterTwmaWriterTw'nb mapWriter mapWriter :: ((a, w) -> (b, w')) ->  Writer w a ->  Writer w' bW(,)aw(,)bw'WriterwaWriterw'b mapWriter mapWriter :: ((a, w) -> (b, w')) ->  Writer w a ->  Writer w' bP(,)aw(,)bw'WriterwaWriterw'b mapStateT mapStateT :: (m (a, s) -> n (b, s)) ->  StateT s m a ->  StateT s n bm(,)asn(,)bsStateTsmaStateTsnbSimilar to mapState  mapStateT mapStateT :: (m (a, s) -> n (b, s)) ->  StateT s m a ->  StateT s n bm(,)asn(,)bsStateTsmaStateTsnbSimilar to mapState mapStatemapState :: ((a, s) -> (b, s)) ->  State s a ->  State s b(,)as(,)bsStatesaStatesbMap a stateful computation from one (return value, state) pair to another. For instance, to convert numberTree from a function that returns a tree to a function that returns the sum of the numbered tree (see the Examples section for numberTree and sumTree) you may write:
sumNumberedTree :: (Eq a) => Tree a -> State (Table a) Int
sumNumberedTree = mapState (\ (t, tab) -> (sumTree t, tab))  . numberTree
mapStatemapState :: ((a, s) -> (b, s)) ->  State s a ->  State s b&(,)as(,)bsStatesaStatesbMap a stateful computation from one (return value, state) pair to another. For instance, to convert numberTree from a function that returns a tree to a function that returns the sum of the numbered tree (see the Examples section for numberTree and sumTree) you may write:
sumNumberedTree :: (Eq a) => Tree a -> State (Table a) Int
sumNumberedTree = mapState (\ (t, tab) -> (sumTree t, tab))  . numberTree
mapRWSTmapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n bWm(,,)aswn(,,)bsw'RWSTrwsmaRWSTrw'snbmapRWSTmapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b=m(,,)aswn(,,)bsw'RWSTrwsmaRWSTrw'snbmapRWSmapRWS :: ((a, s, w) -> (b, s, w')) ->  RWS r w s a ->  RWS r w' s bf(,,)asw(,,)bsw'RWSrwsaRWSrw'sbmapRWSmapRWS :: ((a, s, w) -> (b, s, w')) ->  RWS r w s a ->  RWS r w' s b.(,,)asw(,,)bsw'RWSrwsaRWSrw'sblocallocal :: MonadReader r m => (r -> r) -> m a -> m a MonadReaderrmrrmama listenslistens :: MonadWriter w m => (w -> b) -> m a -> m (a, b)q7 MonadWriterwmwbmam(,)ab listenlisten :: MonadWriter w m => m a -> m (a, w) MonadWriterwmmam(,)awgetsgets :: MonadState s m => (s -> a) -> m a{T MonadStatesmsamaLGets specific component of the state, using a projection function supplied. getget :: MonadState s m => m s$ MonadStatesmms execWriterT execWriterT ::  Monad m =>  WriterT w m a -> m wMonadmWriterTwmamw execWriterT execWriterT ::  Monad m =>  WriterT w m a -> m w>MonadmWriterTwmamw execWriter execWriter ::  Writer w a -> wWriterwaw execWriter execWriter ::  Writer w a -> w Writerwaw execStateT execStateT ::  Monad m =>  StateT s m a -> s -> m svMonadmStateTsmasmsSimilar to execState  execStateT execStateT ::  Monad m =>  StateT s m a -> s -> m sX+MonadmStateTsmasmsSimilar to execState  execState execState ::  State s a -> s -> sStatesassExecute this state and return the new state, throwing away the return value. Very much like snd composed with runstate.  execState execState ::  State s a -> s -> sStatesassExecute this state and return the new state, throwing away the return value. Very much like snd composed with runstate. execRWST execRWST ::  Monad m => RWST r w s m a -> r -> s -> m (s, w)&MonadmRWSTrwsmarsm(,)swexecRWST execRWST ::  Monad m => RWST r w s m a -> r -> s -> m (s, w)MonadmRWSTrwsmarsm(,)swexecRWS execRWS ::  RWS r w s a -> r -> s -> (s, w)sJRWSrwsars(,)swexecRWS execRWS ::  RWS r w s a -> r -> s -> (s, w)RWSrwsars(,)sw evalStateT evalStateT ::  Monad m =>  StateT s m a -> s -> m arMonadmStateTsmasmaSimilar to evalState  evalStateT evalStateT ::  Monad m =>  StateT s m a -> s -> m aT'MonadmStateTsmasmaSimilar to evalState  evalState evalState ::  State s a -> s -> aStatesasaEvaluate this state monad with the given initial state,throwing away the final state. Very much like fst composed with runstate.  evalState evalState ::  State s a -> s -> aStatesasaEvaluate this state monad with the given initial state,throwing away the final state. Very much like fst composed with runstate. evalRWST evalRWST ::  Monad m => RWST r w s m a -> r -> s -> m (a, w)4MonadmRWSTrwsmarsm(,)awevalRWST evalRWST ::  Monad m => RWST r w s m a -> r -> s -> m (a, w)MonadmRWSTrwsmarsm(,)awevalRWS evalRWS ::  RWS r w s a -> r -> s -> (a, w)XRWSrwsars(,)awevalRWS evalRWS ::  RWS r w s a -> r -> s -> (a, w)RWSrwsars(,)awErrorclass Error aEbAn exception to be thrown. An instance must redefine at least one of noMsg, strMsg.  censorcensor :: MonadWriter w m => (w -> w) -> m a -> m aA MonadWriterwmwwmama catchError catchError :: MonadError e m => m a ->  (e -> m a) -> m a MonadErroremmaemamacallCCcallCC :: MonadCont m => ((a -> m b) -> m a) -> m a|J MonadContmambmamaasksasks :: MonadReader r m => (r -> a) -> m a MonadReaderrmramaRetrieves a function of the current environment. Parameters:
  • The selector function to apply to the environment.
See an example in Control.Monad.Reader. askask :: MonadReader r m => m r MonadReaderrmmr withReaderT withReaderT ::  (r' -> r) ->  ReaderT r m a -> ReaderT r' m ar'rReaderTrmaReaderTr'ma withReader withReader ::  (r' -> r) ->  Reader r a ->  Reader r' aW*r'rReaderraReaderr'a(A more general version of local.  withContT withContT :: ((b -> m r) -> a -> m r) ->  ContT r m a ->  ContT r m b=bmramrContTrmaContTrmbwithContwithCont :: ((b -> r) -> a -> r) -> Cont r a -> Cont r bbrarContraContrb runReaderT runReaderT ::  ReaderT r m a -> r -> m aa?ReaderTrmarma runReader runReader ::  Reader r a -> r -> aReaderraraRuns Reader and extracts the final value from it. To extract the value apply (runReader reader) to an environment value. Parameters:
  • A Reader to run.
  • An initial environment.
runListTrunListT ::  ListT m a -> m [a]+ ListTmam[]a runIdentity runIdentity ::  Identity a -> a}Identityaa runErrorT runErrorT ::  ErrorT e m a -> m (Either e a)ErrorTemamEitherearunContTrunContT ::  ContT r m a ->  (a -> m r) -> m rContTrmaamrmrrunContrunCont :: Cont r a -> (a -> r) -> r!ContraarrRuns a CPS computation, returns its result after applying the final continuation to it. Parameters:
  • a continuation computation (Cont).
  • the final continuation, which produces the final result (often id).
ReaderTReaderT :: r -> m a ->  ReaderT r m axrmaReaderTrmaReaderTnewtype ReaderT r m adThe reader monad transformer. Can be used to add environment reading functionality to other monads. ReaderReader :: r -> a ->  Reader r araReaderraReadernewtype Reader r ahThe parameterizable reader monad. The return function creates a Reader that ignores the environment, and produces the given value. The binding operator >>= produces a Reader that uses the environment to extract the value its left-hand side, and then applies the bound function to that value in the same environment.  MonadTransclass  MonadTrans tMonadIOclass  Monad m => MonadIO m mapReaderT mapReaderT ::  (m a -> n b) ->  ReaderT w m a ->  ReaderT w n bu8manbReaderTwmaReaderTwnb mapReader mapReader :: (a -> b) ->  Reader r a ->  Reader r b abReaderraReaderrbmapListTmapListT :: (m [a] -> n [b]) ->  ListT m a ->  ListT n bzm[]an[]bListTmaListTnb mapErrorT mapErrorT :: #(m (Either e a) -> n (Either e' b)) ->  ErrorT e m a ->  ErrorT e' n bDmEithereanEithere'bErrorTemaErrorTe'nbmapContTmapContT ::  (m r -> m r) ->  ContT r m a ->  ContT r m aC mrmrContTrmaContTrmamapContmapCont :: (r -> r) -> Cont r a -> Cont r arrContraContraListTListT :: m [a] ->  ListT m a6m[]aListTmaListTnewtype ListT m akliftIOliftIO ::  MonadIO m => IO a -> m aMonadIOmIOamaliftlift :: (MonadTrans t, Monad m) => m a -> t m am: MonadTranstMonadmmatma IdentityIdentity :: a ->  Identity aaIdentitya Identitynewtype Identity a'Identity wrapper. Abstraction for wrapping up a object. If you have an monadic function, say:
example :: Int -> Identity Int
example x = return (x*x)
you can "run" it, using
Main> runIdentity (example 42)
1764 :: Int
A typical use of the Identity monad is to derive a monad from a monad transformer.
-- derive the Control.Monad.State.State monad using the Control.Monad.State.StateT monad transformer
type Control.Monad.State.State s a = Control.Monad.State.StateT s Identity a
The runIdentity label is used in the type definition because it follows a style of monad definition that explicitly represents monad values as computations. In this style, a monadic computation is built up using the monadic operators and then the value of the computation is extracted using the run****** function. Because the Identity monad does not do any computation, its definition is trivial. For a better example of this style of monad, see the Control.Monad.State.State monad. ErrorTErrorT :: m (Either e a) ->  ErrorT e m amEithereaErrorTemaErrorTnewtype ErrorT e m aGThe error monad transformer. It can be used to add error handling to other monads. The ErrorT Monad structure is parameterized over two things:
  • e - The error type.
  • m - The inner monad.
Here are some examples of use:
-- wraps IO action that can throw an error e
type ErrorWithIO e a = ErrorT e IO a
==> ErrorT (IO (Either e a))

-- IO monad wrapped in StateT inside of ErrorT
type ErrorAndStateWithIO e s a = ErrorT e (StateT s IO) a
==> ErrorT (StateT s IO (Either e a))
==> ErrorT (StateT (s -> IO (Either e a,s)))
ContTContT ::  (a -> m r) -> m r ->  ContT r m aamrmrContTrmaContTnewtype ContT r m a^The continuation monad transformer. Can be used to add continuation handling to other monads. ContCont :: (a -> r) -> r -> Cont r aarrContraContnewtype Cont r a`Continuation monad. Cont r a is a CPS computation that produces an intermediate result of type a within a CPS computation whose final result type is r. The return function simply creates a continuation which passes the value on. The >>= operator adds the bound function into the continuation chain.  Writermodule Control.Monad.WriterThe MonadWriter class. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995. Transmodule Control.Monad.TransThe MonadTrans class. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Strictmodule Control.Monad.Writer.StrictStrict writer monads. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995. Strictmodule Control.Monad.State.Strict Strict state monads. This module is inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. See below for examples. Strictmodule Control.Monad.RWS.StrictLStrict RWS Monad. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Statemodule Control.Monad.State\State monads. This module is inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995.  RWSmodule Control.Monad.RWSs Declaration of the MonadRWS class. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Readermodule Control.Monad.Reader 
  • Computation type: Computations which read values from a shared environment.
  • Binding strategy: Monad values are functions from the environment to a value. The bound function is applied to the bound value, and both have access to the shared environment.
  • Useful for: Maintaining variable bindings, or other shared environment.
  • Zero and plus: None.
  • Example type: Reader [(String,Value)] a
The Reader monad (also called the Environment monad). Represents a computation, which can read values from a shared environment, pass values from function to function, and execute sub-computations in a modified environment. Using Reader monad for such computations is often clearer and easier than using the Control.Monad.State.State monad. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. mtlpackage mtlMonad transformer library A monad transformer library, inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, by Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html), Advanced School of Functional Programming, 1995. Listmodule Control.Monad.ListThe List monad. Lazymodule Control.Monad.Writer.LazylLazy writer monads. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995. Lazymodule Control.Monad.State.LazyLazy state monads. This module is inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. See below for examples. Lazymodule Control.Monad.RWS.LazyLazy RWS monad. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995.  Identitymodule Control.Monad.Identity
  • Computation type: Simple function application.
  • Binding strategy: The bound function is applied to the input value. Identity x >>= f == Identity (f x)
  • Useful for: Monads can be derived from monad transformers applied to the Identity monad.
  • Zero and plus: None.
  • Example type: Identity a
The Identity monad is a monad that does not embody any computational strategy. It simply applies the bound function to its input without any modification. Computationally, there is no reason to use the Identity monad instead of the much simpler act of simply applying functions to their arguments. The purpose of the Identity monad is its fundamental role in the theory of monad transformers. Any monad transformer applied to the Identity monad yields a non-transformer version of that monad. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Errormodule Control.Monad.Error
  • Computation type: Computations which may fail or throw exceptions.
  • Binding strategy: Failure records information about the cause/location of the failure. Failure values bypass the bound function, other values are used as inputs to the bound function.
  • Useful for: Building computations from sequences of functions that may fail or using exception handling to structure error handling.
  • Zero and plus: Zero is represented by an empty error and the plus operation executes its second argument if the first fails.
  • Example type: Data.Either String a
The Error monad (also called the Exception monad). Contmodule Control.Monad.Cont
  • Computation type: Computations which can be interrupted and resumed.
  • Binding strategy: Binding a function to a monadic value creates a new continuation which uses the function as the continuation of the monadic computation.
  • Useful for: Complex control structures, error handling, and creating co-routines.
  • Zero and plus: None.
  • Example type: Cont r a
The Continuation monad represents computations in continuation-passing style (CPS). In continuation-passing style function result is not returned, but instead is passed to another function, received as a parameter (continuation). Computations are built up from sequences of nested continuations, terminated by a final continuation (often id) which produces the final result. Since continuations are functions which represent the future of a computation, manipulation of the continuation functions can achieve complex manipulations of the future of the computation, such as interrupting a computation in the middle, aborting a portion of a computation, restarting a computation, and interleaving execution of computations. The Continuation monad adapts CPS to the structure of a monad. Before using the Continuation monad, be sure that you have a firm understanding of continuation-passing style and that continuations represent the best solution to your particular design problem. Many algorithms which require continuations in other languages do not require them in Haskell, due to Haskell's lazy semantics. Abuse of the Continuation monad can produce code that is impossible to understand and maintain.  Classmodule Control.Monad.Writer.Class^"The MonadWriter class. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995. Classmodule Control.Monad.State.Class#MonadState class. This module is inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Classmodule Control.Monad.Reader.Class$
  • Computation type: Computations which read values from a shared environment.
  • Binding strategy: Monad values are functions from the environment to a value. The bound function is applied to the bound value, and both have access to the shared environment.
  • Useful for: Maintaining variable bindings, or other shared environment.
  • Zero and plus: None.
  • Example type: Reader [(String,Value)] a
The Reader monad (also called the Environment monad). Represents a computation, which can read values from a shared environment, pass values from function to function, and execute sub-computations in a modified environment. Using Reader monad for such computations is often clearer and easier than using the Control.Monad.State.State monad. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995.  Classmodule Control.Monad.RWS.Class(Declaration of the MonadRWS class. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995. Classmodule Control.Monad.Error.Class*
  • Computation type: Computations which may fail or throw exceptions.
  • Binding strategy: Failure records information about the cause/location of the failure. Failure values bypass the bound function, other values are used as inputs to the bound function.
  • Useful for: Building computations from sequences of functions that may fail or using exception handling to structure error handling.
  • Zero and plus: Zero is represented by an empty error and the plus operation executes its second argument if the first fails.
  • Example type: Data.Either String a
The Error monad (also called the Exception monad). Classmodule Control.Monad.Cont.Class-
  • Computation type: Computations which can be interrupted and resumed.
  • Binding strategy: Binding a function to a monadic value creates a new continuation which uses the function as the continuation of the monadic computation.
  • Useful for: Complex control structures, error handling, and creating co-routines.
  • Zero and plus: None.
  • Example type: Cont r a
The Continuation monad represents computations in continuation-passing style (CPS). In continuation-passing style function result is not returned, but instead is passed to another function, received as a parameter (continuation). Computations are built up from sequences of nested continuations, terminated by a final continuation (often id) which produces the final result. Since continuations are functions which represent the future of a computation, manipulation of the continuation functions can achieve complex manipulations of the future of the computation, such as interrupting a computation in the middle, aborting a portion of a computation, restarting a computation, and interleaving execution of computations. The Continuation monad adapts CPS to the structure of a monad. Before using the Continuation monad, be sure that you have a firm understanding of continuation-passing style and that continuations represent the best solution to your particular design problem. Many algorithms which require continuations in other languages do not require them in Haskell, due to Haskell's lazy semantics. Abuse of the Continuation monad can produce code that is impossible to understand and maintain. 5555y5d5I5455544444w4]4C4'4 43ControlMonadWriterStrictControlMonadWriterLazyControlMonadStateStrictControlMonadStateLazyControlMonadRWSStrictControlMonadRWSLazyControlMonadListControlMonadIdentityControlMonadWriterClassControlMonadWriterControlMonadRWSClassControlMonadRWSControlMonadErrorClassControlMonadErrorControlMonadStateClassControlMonadStateControlMonadReaderClassControlMonadReaderControlMonadTransControlMonadContClassControlMonadCont5mtl1.1.0.1Ahttp://hackage.haskell.org/packages/archive/mtl/1.1.0.1/doc/html/>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mtl