úÎCú>ïQ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP??? experimentalconal@conal.net experimentalconal@conal.net "Conversion to Haskell expressions   portable experimentalconal@conal.net%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 portable experimentalconal@conal.netBPromote 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. Given a way to extract a d input from an a input, leaving an a'  residual input,  yields a way to extract a d input from an  (a,b) input, leaving an (a',b) residual input.  Analogous to . Flip argument order Like Q but for ( arrows instead of lists. Compose wrapped functions Support needed for a R S  to be a ( (as T  serves  U ). (EArrows for deep application. Most of these methods could be defined using V , but V + is not definable for some types. If your ( instance has V , you might want to use these implementations    * = V  W   , = V  X   + = V  (\ x -> (x,x))  - = V  Y   . = V  (\ (f,b) -> \ c -> (f c, b))  / = V  (\ (a,f) -> \ c -> (a, f c))  0 = V  Z   1 = V  [   2 = V  \   3 = V  (\ (a,b) -> (b,a))  4 = V  (\ (a,(b,c)) -> ((a,b),c))  5 = V  (\ ((a,b),c) -> (a,(b,c))) If your ( instance does not have V , you'll have to come up @with other definitions. In any case, I recommend the following definitions, which mirror U  defaults while avoiding V  . Be sure also to define V  or ] ( to yield an error message (rather than -ping-ponging infinitely between them via the U  default definitions).    ^  f = 3 _  `  f _  3  f a  g = + _  f b  g @In a few cases, there are default methods, as noted below. The defaults do not use V . )Direct arrow into a function's result. Analogous to `  and  ^ . * Identity. + Duplicate. ,Extract first. -Extract second. .%Extract function from first element. /&Extract function from second element. 0Extract function from result. 1 Curry arrow. 2Uncurry arrow. 3Swap elements. Has default. 4Left-associate. Has default. 5Right-associate. Has default. % !"#$%&'()*+,-./012345%()*+,-./012345 !"#$%&'portable experimentalconal@conal.net6FA GADT alternative to terms. Allows generation of Haskell terms and,  from there, strings and eval. :This GADT mirrors the ( class and part of the  class. 6789:;<=>?@ABCDEFGHIJK:;<=>?@ABCDEFGHIJK6789portable experimentalconal@conal.netLGiven a value of type (a -> (f,b -> (c,g)),e), apply a function to  just the c! part and leave the rest intact. deep = `  . ) . ^  . ) . ` M)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 =  .  . N=To make an extractor, simply apply the extractor-transformer M  to the identity arrow. N = M *O Extract a b input from a  ((a,(b,e)),c) argument. extI = ( . ) PBTypically, we will have to combine function and input extractors.  For instance, combine M and O. extFI = M OLMNOPLMNOPc !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ` ` a b c d e f g h i j k l m n op DeepArrow-0.2Language.Haskell.ParensLanguage.Haskell.ToHs Data.FunArrControl.Arrow.DeepArrowData.DDeepArrow Control.Arrow.DeepArrow.ExamplesbaseGHC.ListTypeCompose-0.5Control.Compose Control.ArrowGHC.Base Data.TupleprettyunCifycifyExp hasOpInfoCifyvaridvarsymtoHsApp1toHsApp2infixApp toHsInfix prettyAsHsExpToHsExptoHsExpFunArrtoArr$$funFirst funSecond funResultinpFinpSinpFirst inpSecondflipAunzipA->|FunDble resultFundupAFunfstAFunsndAFunfunFFunfunSFunfunRFun curryAFun uncurryAFunswapAFun lAssocAFun rAssocAFun DeepArrowresultidAdupAfstAsndAfunFfunSfunRcurryAuncurryAswapAlAssocArAssocADValPairDVAppDAExpDVDArrowSwapASndAFstADupAIdARAssocALAssocAUncurryACurryAFunRFunSFunFResultSecondFirstComposeArrdeepextFextFFextIextFIunzipFunAFunAbleArrowarridfstsndflipcurryuncurrypuresecond>>>first&&&***