GT@=P      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO??? experimentalconal@conal.netNonePQRSTUVWXYZ[\]^_`abcdefPQRSVUTWXYZ[\]^_`abcdef experimentalconal@conal.netNone"Conversion to Haskell expressions  ghijkl    ghijklportable experimentalconal@conal.netNone%Convert between an arrow value and a "wrapped function". The "arrow"  doesn' t really have to be an arrow. I'd appreciate ideas for names &  uses.  Convert a w$-wrapped function to an arrow value Apply an arrow to a w-wrapped value mnmnportable experimentalconal@conal.netNoneSupport needed for a o to be a  (as p serves  q). EArrows for deep application. Most of these methods could be defined using r, but r+ is not definable for some types. If your  instance has r, you might want to use these implementations    ! = r s    = r (\ x -> (x,x))  " = r t  # = r (\ (f,b) -> \ c -> (f c, b))  $ = r (\ (a,f) -> \ c -> (a, f c))  % = r u  & = r v  ' = r w  ( = r (\ (a,b) -> (b,a))  ) = r (\ (a,(b,c)) -> ((a,b),c))  * = r (\ ((a,b),c) -> (a,(b,c))) If your  instance does not have r, you'll have to come up @with other definitions. In any case, I recommend the following definitions, which mirror q defaults while avoiding r . Be sure also to define r or pure( to yield an error message (rather than -ping-ponging infinitely between them via the q default definitions).    x f = ( y z f y (  f { g =   | f } g @In a few cases, there are default methods, as noted below. The defaults do not use r. Direct arrow into a function's result. Analogous to z and  x.  Duplicate. !Extract first. "Extract second. #%Extract function from first element. $&Extract function from second element. %Extract function from result. & Curry arrow. 'Uncurry arrow. (Swap elements. Has default. )Left-associate. Has default. *Right-associate. Has default. +BPromote a function extractor into one that reaches into the first  element of a pair. ,CPromote a function extractor into one that reaches into the second  element of a pair. -CPromote a function extractor into one that reaches into the result  element of a function. .-Extract the first component of a pair input. /.Extract the second component of a pair input. 0Given a way to extract a d input from an a input, leaving an a'  residual input, 0 yields a way to extract a d input from an  (a,b) input, leaving an (a',b) residual input. 1 Analogous to 0. 2Flip argument order 3Like ~ but for  arrows instead of lists. 4Compose wrapped functions ' !"#$%&'()*+,-./01234$ !"#$%&'()*+,-./01234$ !"#$%&'()*+,-./01234   !"#$%&'()*+,-./01234portable experimentalconal@conal.netNone5FA GADT alternative to terms. Allows generation of Haskell terms and,  from there, strings and eval. 9This GADT mirrors the  class and part of the  class. 56789:;<=>?@ABCDEFGHIJ56789:;<=>?@ABCDEFGHIJ9JIHGFEDCBA@?>=<;:5876 58769JIHGFEDCBA@?>=<;:portable experimentalconal@conal.netNoneKGiven a value of type (a -> (f,b -> (c,g)),e), apply a function to  just the c! part and leave the rest intact. deep = z .  . x .  . zL)Given a way to extract a function from a d value, create a way to  extract a function from a (e -> (a,d), f) value. extF = + . - . ,M=To make an extractor, simply apply the extractor-transformer L  to the identity arrow. M = L idAN Extract a b input from a  ((a,(b,e)),c) argument. extI = (0 . 1) .OBTypically, we will have to combine function and input extractors.  For instance, combine L and N. extFI = L NKLMNOKLMNOKLMNOKLMNO      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxvwyz{|z{}z~z~zz~z~z{zz{z{zz{zDeepArrow-0.4.0Language.Haskell.ParensLanguage.Haskell.ToHs Data.FunArrControl.Arrow.DeepArrowData.DDeepArrow Control.Arrow.DeepArrow.ExamplesCifyprettyunCifycifyExp hasOpInfoToHsExptoHsExpvaridvarsymtoHsApp1toHsApp2infixApp toHsInfix prettyAsHsExpFunArrtoArr$$FunDble resultFundupAFunfstAFunsndAFunfunFFunfunSFunfunRFun curryAFun uncurryAFunswapAFun lAssocAFun rAssocAFun DeepArrowresultdupAfstAsndAfunFfunSfunRcurryAuncurryAswapAlAssocArAssocAfunFirst funSecond funResultinpFinpSinpFirst inpSecondflipAunzipA->|DValZipDVAppDAExpDVDArrowSwapASndAFstADupAIdARAssocALAssocAUncurryACurryAFunRFunSFunFResultSecondFirstComposeArrdeepextFextFFextIextFICExpContextOpInfoAssocRAssocNAssocLAssocoperresetonRightlift1lift2lift3cifyExps cifyDeclscifyDeclcifyRhsopQNameopNamegetName specialNameapPrecopInfo $fToHsExpBool$fToHsExpDouble$fToHsExpFloat $fToHsExpInt $fToHsExp[] $fToHsExpChar$fFunArr::*:::*:$fFunArr(->)IdTypeCompose-0.9.9Control.ComposeFunAFunAblebase Control.ArrowArrowarr Data.TuplefstsndGHC.BaseflipcurryuncurrysecondControl.Category.first&&&>>>***GHC.Listunzip$fDeepArrowFunA$fDeepArrow::*::$fDeepArrow(->) $fShowDVal $fShowDArrow$fFunArrDArrowDVal $fToHsExpDVal$fToHsExpDArrow $fZipDVal$fDeepArrowDArrow $fArrowDArrow$fCategoryDArrow