úÎL¬GÞP      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO(c) Varun Gandhi 2018 BSD-style (see the file LICENSE)theindigamer15@gmail.com experimentalportableSafe023457[The  type encapsulates rewriting.Since ÿ' is also a monad, it allows you to easily "bubble up" information on whether changes were made when working with nested data structures. This is helpful when you want to save the fact that you've reaching a fixed point while rewriting, instead of, say re-computing it after the fact using an P' instance on the underlying data-type. For example,HhalveEvens x = if x `mod` 2 == 0 then (Dirty $ x `div` 2) else (Clean x)traverse halveEvens [1, 2, 3] Dirty [1,1,3]traverse halveEvens [1, 3, 5] Clean [1,3,5]To support this behaviour, the Q and R' instances have "polluting" semantics: S =  = T.The result of U is + if and only if both the arguments are .If you bind a \ value, you may get anything depending on the function involved. However, if you bind a & value, you will definitely get a  value back.*If you're familiar with the Writer monad, ( is equivalent to a Writer monad where w is isomorphic to V with  (<>) = (||).&If you like comonads, you can use the comonad_instance% package flag to, erm, get a legit  Uhttps://hackage.haskell.org/package/comonad-5.0.3/docs/Control-Comonad.html#t:ComonadComonad' instance, instead of just having the ,  and  functions.A value that has been modified.#A value that has not been modified.Forcibly make the value e. You probably do not want to use this function unless you're implementing some class instance for .Forcibly make the value e. You probably do not want to use this function unless you're implementing some class instance for .5Extract the final value after having done some edits.Unlike s i, this function doesn't require a default value for totality as both constructors have a value in them.Was an edit made (is the value )? If yes, returns W otherwise X.toMaybe (Clean "Good morning.")NothingtoMaybe (Dirty "Wink, wink.")Just "Wink, wink." <Takes a clean value and a possibly dirty value and makes an .fromMaybe "Hi" Nothing Clean "Hi"defaultValue = 1000correctedValue = Just 1024%fromMaybe defaultValue correctedValue Dirty 1024 wTakes a function that may dirty a value, and returns another which saves the default value if no modification is done.  f `edits` x == fromMaybe x (f x) A  value becomes a Y and a  value becomes a Z.FMnemonic: having things clean is usually the right situation to be in. A Y value becomes a  and a Z value becomes a .FMnemonic: having things clean is usually the right situation to be in. Return [ iff the argument has the form Clean _.Returns [ iff the argument has the form Dirty _.extract = fromEdit(. Provided purely for aesthetic reasons.GWraps the value according to its current status. Like father, like son.8Keep track of changes while utilizing an extraction map. extend f = fmap f . duplicate values are put on the left and  values are put on the right. 0partitionEdits = partitionEithers . map toEither Keep editing till the result is  (find the fixed point).0g x = if x >= 10 then Clean x else Dirty (x + 2) polish g 311 Conceptually, "polish f x = last $ iterations f x Keep editing till the result is , recording iterations. Similar to ß but gets the entire list of arguments tested instead of just the final result. The result is guaranteed to be non-empty because the first element will always be included. If the list is finite, the last element gives a  result.0g x = if x >= 10 then Clean x else Dirty (x + 2)iterations g 3 [3,5,7,9,11]KThis can be helpful in debugging your transformation function. For example, ‰[ (before, after) | let xs = iterations f start , (before, after) <- zip xs (tail xs) , sanityCheck before && not (sanityCheck after)) ]  \    \(c) Varun Gandhi 2018 BSD-style (see the file LICENSE)theindigamer15@gmail.com experimentalportableNone0L&]'()*+,-./012345&'*()+,-./012345+,'()*-.&/012345 &]'()*+,-./012345]9 (c) Varun Gandhi 2018 BSD-style (see the file LICENSE)theindigamer15@gmail.com experimentalportableSafe>?@ABCDEFGHIJKLMNO>?@A>?@ONMLKJAIHGFEDCB>?@ABCDEFGHIJKLMNO^      !"#$%&'()*+,-./01233456789:;<=>?@ABCDEEFGHIJKLMNOPQRSTUVWXYZY[Y\Y]Y^V_`YaYbcdceV_fghi#edit-0.0.1.1-KNlg84v0apJ7vepQWbpgRR Data.EditData.Edit.TutorialControl.Monad.Trans.Edit Data.MaybeMaybe' fromMaybebase Control.Monad<=<>=>EditDirtyCleancleandirtyfromEdittoMaybeeditstoEither fromEitherisCleanisDirtyextract duplicateextendpartitionEditspolish iterations $fRead1Edit $fShow1Edit $fEq1Edit$fMonadZipEdit $fMonoidEdit$fSemigroupEdit $fMonadEdit$fApplicativeEdit$fEqEdit $fShowEdit $fReadEdit $fFunctorEdit$fFoldableEdit$fTraversableEdit $fGenericEdit $fNFDataEdit $fDataEditStmtExprValAddVarIdent constFold substitute constProp constFold' constFoldPass substitute' constProp' constPropPassconstFoldAndPropPass $fEqIdent $fOrdIdent $fShowIdent $fDataIdent $fShowExpr$fEqExpr $fDataExpr $fShowStmtEditTrunEditTmapEditT$fTraversableEditT$fFoldableEditT$fMonadZipEditT$fMonadIOEditT$fMonadTransEditT $fMonadEditT$fApplicativeEditT$fFunctorEditT $fShowEditT $fReadEditT $fEqEditT $fRead1EditT $fShow1EditT $fEq1EditTghc-prim GHC.ClassesEqGHC.Base ApplicativeMonadpurereturn<*> GHC.TypesBoolJustNothing Data.EitherLeftRightTruedup:=