F@Q      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP??? experimentalconal@conal.net Safe-Infered experimentalconal@conal.net Safe-Infered"Conversion to Haskell expressions  QRSTUV    QRSTUVportable experimentalconal@conal.net Safe-Infered%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 WXWXportable experimentalconal@conal.net Safe-InferedSupport needed for a Y to be a  (as Z serves  [). EArrows for deep application. Most of these methods could be defined using \, but \+ is not definable for some types. If your  instance has \, you might want to use these implementations      = \ ]  " = \ ^  ! = \ (\ x -> (x,x))  # = \ _  $ = \ (\ (f,b) -> \ c -> (f c, b))  % = \ (\ (a,f) -> \ c -> (a, f c))  & = \ `  ' = \ a  ( = \ b  ) = \ (\ (a,b) -> (b,a))  * = \ (\ (a,(b,c)) -> ((a,b),c))  + = \ (\ ((a,b),c) -> (a,(b,c))) If your  instance does not have \, you'll have to come up @with other definitions. In any case, I recommend the following definitions, which mirror [ defaults while avoiding \ . Be sure also to define \ or pure( to yield an error message (rather than -ping-ponging infinitely between them via the [ default definitions).    c f = ) d e f d )  f f g = ! d f g g @In a few cases, there are default methods, as noted below. The defaults do not use \. Direct arrow into a function's result. Analogous to e and  c.  Identity. ! 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. 0.Extract the second component of a pair input. 1Given a way to extract a d input from an a input, leaving an a'  residual input, 1 yields a way to extract a d input from an  (a,b) input, leaving an (a',b) residual input. 2 Analogous to 1. 3Flip argument order 4Like h but for  arrows instead of lists. 5Compose wrapped functions ( !"#$%&'()*+,-./012345ijk% !"#$%&'()*+,-./012345% !"#$%&'()*+,-./012345   !"#$%&'()*+,-./012345ijkportable experimentalconal@conal.net Safe-Infered6FA 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:;<=>?@ABCDEFGHIJKlmnopqrst6789:;<=>?@ABCDEFGHIJK:KJIHGFEDCBA@?>=<;6987 6987:KJIHGFEDCBA@?>=<;lmnopqrstportable experimentalconal@conal.net Safe-InferedLGiven a value of type (a -> (f,b -> (c,g)),e), apply a function to  just the c! part and leave the rest intact. deep = e .  . c .  . eM)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 = (1 . 2) /PBTypically, we will have to combine function and input extractors.  For instance, combine M and O. extFI = M OLMNOPLMNOPLMNOPLMNOPu      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab`acdefdegdhidjkdjldhmdjndjodepdqrdesdetdeudvwxyz{|}~DeepArrow-0.3.4Language.Haskell.ParensLanguage.Haskell.ToHs Data.FunArrControl.Arrow.DeepArrowData.DDeepArrow Control.Arrow.DeepArrow.ExamplesCifyprettyunCifycifyExp hasOpInfoToHsExptoHsExpvaridvarsymtoHsApp1toHsApp2infixApp toHsInfix prettyAsHsExpFunArrtoArr$$FunDble resultFundupAFunfstAFunsndAFunfunFFunfunSFunfunRFun curryAFun uncurryAFunswapAFun lAssocAFun rAssocAFun DeepArrowresultidAdupAfstAsndAfunFfunSfunRcurryAuncurryAswapAlAssocArAssocAfunFirst funSecond funResultinpFinpSinpFirst inpSecondflipAunzipA->|DValZipDVAppDAExpDVDArrowSwapASndAFstADupAIdARAssocALAssocAUncurryACurryAFunRFunSFunFResultSecondFirstComposeArrdeepextFextFFextIextFI $fToHsExpBool$fToHsExpDouble$fToHsExpFloat $fToHsExpInt $fToHsExp[] $fToHsExpChar$fFunArr::*:::*:$fFunArr(->)IdTypeCompose-0.9.1Control.ComposeFunAFunAblebase Control.ArrowArrowarrGHC.Baseid Data.TuplefstsndflipcurryuncurrysecondControl.Category>>>first&&&***GHC.Listunzip$fDeepArrowFunA$fDeepArrow::*::$fDeepArrow(->) $fShowDVal $fShowDArrow$fFunArrDArrowDVal $fToHsExpDVal$fToHsExpDArrow $fZipDVal$fDeepArrowDArrow $fArrowDArrow$fCategoryDArrow