úΔxP      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO:Definitions used by family of strict function combinators.(c) 2013-2015, Peter TrakoBSD3peter.trsko@gmail.com experimentalNoImplicitPreludeSafe3Strict variant of function composition. Defined as: (f . g) x = f P g P x 0Internally used since version 0.10.0.0. Moved to %Data.Function.Between.Strict.Internal module and exposed in version  0.11.0.0.Strict variant of  . Defined as:  f b a = f P a P b Since version 0.11.0.0. (Precursors to Iso, Lens and Prism types.(c) 2015, Peter TrakoBSD3peter.trsko@gmail.com experimentalNoImplicitPreludeSafe A simple ˜, where we can not change the type of the information we are focusing on. As a consequence neither the type of the container data type can be changed. If we define  in terms of * then we have even better ilustration of Prism! concept in terms of isomorphism:  r s a =  r s (Q t a) Since version 0.11.0.0.We can also get  by specializing :  r s t a b =  r s t (Q t a) b #This fact is not surprising, since Prisms? are actually a special case of isomorphism between two types.Let's have a type s„, and we want to extract specific information out of it, but that information may not be there. Because of the fact that the type s* can be a sum type. Imagine e.g. standard Maybe data type: Maybe a =  |   a How do we create something that can extrat that information from a sum type, and if necessary, also reconstructs that sum type. The answer is Prism8, which is defined as an isomorphism between that type s and Q t a where a+ is the information we want to extract and t' is the rest that we don't care about.)You may have noticed, that definition of t contains some type variables that aren't mentioned in the above definition. The reason for this is that, as with Lenses& we may want to extract value of type a[, but when constructing new data type we may want to change the type of that value in to b and therefore type s4 may not fit, which is the reason why we have type t1 in there. Once again we can ilustrate this with Maybe$. Lets say that we have a value of s = Maybe a, but if we change the type of a in to b, and try to create Maybe again, then it would have type Maybe b = t.Since version 0.11.0.0. A simple ˜, where we can not change the type of the information we are focusing on. As a consequence neither the type of the container data type can be changed.Since version 0.11.0.0.We can also view  as a special kind of :  r s t a b =  r s (s -> t) a b Since version 0.11.0.0. A simple .Since version 0.11.0.0.=Family of types that can construct isomorphism between types.Since version 0.11.0.0.8Strict function combinator "between" and its variations.(c) 2013-2015, Peter TrakoBSD3peter.trsko@gmail.com experimentalNoImplicitPreludeSafe$YCore combinator of this module and we build others on top of. It also has an infix form   and flipped infix form  .This function Defined as:  f g -> (f .) . (. g) Since version 0.10.0.0. Infix variant of .gFixity is left associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0. Flipped variant of   , i.e. flipped infix variant of .hFixity is right associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0. As  /, but first function is also parametrised with a, hence the name   . Character ^D indicates which argument is parametrised with additional argument.This function is defined as: (f   g) h a -> ((f P a)   g)) h a gFixity is left associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0. Flipped variant of  .hFixity is right associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0. 9Pass additional argument to first two function arguments.This function is defined as: (f   g) h a b -> ((f P a)   (g P a)) h b  See also  / to note the difference, most importantly that  ó passes the same argument to all its functional arguments. Since this function uses strict function composition and strict application it is not so simple to define it in terms of other combinators in this package and vice versa. See lazy   for details.KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of  .KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Apply function g) to each argument of binary function and f™ to its result. In suffix "2l" the number is equal to arity of the function it accepts as a third argument and character "l" is for "left associative".  f g = (f   g)   g Interesting observation:  (\f g ->    g f) ===   Since version 0.10.0.0.Apply function g* to each argument of ternary function and f™ to its result. In suffix "3l" the number is equal to arity of the function it accepts as a third argument and character "l" is for "left associative".This function is defined as:  f g = ((f   g)   g)   g &Alternatively it can be defined using :  f g =  f g   g Since version 0.10.0.0.Convenience wrapper for: \f g -> R f   R g Name of  simply says that we apply  (R+) to both its arguments and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .Name of  simply says that we apply  (R+) to both its arguments and then we apply  .KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Apply R to first argument of   . Dual to  which applies R to second argument. Defined as: f  g = R f   g mThis function allows us to define lenses mostly for pair of functions that form an isomorphism. See section  #g:3Constructing Lenses for details.Name of  simply says that we apply  (R.) to first (left) argument and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .mThis function allows us to define lenses mostly for pair of functions that form an isomorphism. See section  #g:3Constructing Lenses for details.Name of  simply says that we apply  (R0) to second (right) argument and then we apply  .hFixity is right associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0.Apply R to second argument of   . Dual to  which applies R to first argument. Defined as: f  g -> f   R g Name of  simply says that we apply  (R0) to second (right) argument and then we apply  .aFixity is right associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .Name of  simply says that we apply  (R.) to first (left) argument and then we apply  .gFixity is left associative and set to value 8, which is one less then fixity of function composition (.).Since version 0.10.0.0.Convenience wrapper for: \f g -> R . f '^~' g@.4This function has the same functionality as function 2lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Which is defined in  'http://hackage.haskell.org/package/lens lens package(. Only difference is that arguments of  are flipped. See also section  #g:3Constructing Lenses.Name of  simply says that we apply  (R/) to first (left) arguments and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of ~@^>.4This function has the same functionality as function 2lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Which is defined in  'http://hackage.haskell.org/package/lens lens package. See also section  #g:3Constructing Lenses.Name of ~@^> simply says that we apply  (R1) to second (right) arguments and then we apply ~@^>.`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Convenience wrapper for: \f g -> R . f '^^' R . g@.Name of  simply says that we apply  (R+) to both its arguments and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .Name of  simply says that we apply  (R+) to both its arguments and then we apply .KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Convenience wrapper for: \f g -> R . f '^^' g@.WThis function allows us to define generic lenses from gettern and setter. See section  #g:3Constructing Lenses for details.Name of  simply says that we apply  (R/) to first (left) arguments and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .WThis function allows us to define generic lenses from gettern and setter. See section  #g:3Constructing Lenses for details.Name of  simply says that we apply  (R1) to second (right) arguments and then we apply .KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Convenience wrapper for:  \f g -> f '^^' R . g@.Name of  simply says that we apply  (R1) to second (right) arguments and then we apply  .`Fixity is left associative and set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.Flipped variant of .Name of  simply says that we apply  (R/) to first (left) arguments and then we apply .KFixity is set to value 8, which is one less then of function composition (.).Since version 0.10.0.0.!Prefix version of common pattern: \f -> a `f` b Where a and b: are fixed parameters. There is also infix version named  . This function is defined as:  a b f = (f $! a) $! b †Based on the above definition one can think of it as a variant function application that deals with two arguments, where in example  only deals with one.Since version 0.11.0.0.  Infix version of common pattern:  \f -> (f P a) P b Where a and b; are fixed parameters. There is also prefix version named .Since version 0.11.0.0.! Infix version of common pattern:  \f -> (f P a) P) b -- Notice the order of 'a' and 'b'. Since version 0.11.0.0."(Construct a function that encodes idiom: \f -> f P a P) b -- Notice the order of 'b' and 'a'.  Function  can be redefined in terms of " as: a `` b = "  \f -> a `f` b <On one hand you can think of this function as a specialized id6 function and on the other as a function application 7. All the following definitions work for lazy variant: " f g = f g " = id " = () For strict variant we use: " f g = f P g Usage examples: Qnewtype Foo a = Foo a inFoo :: ((a -> Foo a) -> (Foo t -> t) -> r) -> r inFoo = " $# \f -> Foo `f` \(Foo a) -> Foo  }data Coords2D = Coords2D {_x :: Int, _y :: Int} inX :: ((Int -> Coords2D -> Coords2D) -> (Coords2D -> Int) -> r) -> r inX = " $& \f -> (\b s -> s{_x = b}) `f` _x Since version 0.11.0.0.#(Construct a function that encodes idiom: 6\f -> b `f` a -- Notice the order of 'b' and 'a'.  Function ! can be redefined in terms of # as: b ! a = # $ \f -> b `f` a As "f, but the function is flipped before applied. All of the following definitions work for lazy variant: # f g = f ( g) # = ( ) For strict variant we can use: # f g = f P \b a ->  a b g # f g = f P \b a -> (a   b) g # f g = f P \b a -> (b ! a) g # f g = f P \b a -> g P a P b # f g = " f (\b a -> g P a P b) # f g = " f $!  $! g -- With strict . Usage examples: Qnewtype Foo a = Foo a inFoo :: ((a -> Foo a) -> (Foo t -> t) -> r) -> r inFoo = # $% \f -> (\(Foo a) -> Foo) `f` Foo  }data Coords2D = Coords2D {_x :: Int, _y :: Int} inX :: ((Int -> Coords2D -> Coords2D) -> (Coords2D -> Int) -> r) -> r inX = # $$ \f -> _x `f` \b s -> s{_x = b} Since version 0.11.0.0.$ Construct a ; this function similar to Iso constructor function from lens package: +iso :: (s -> a) -> (b -> t) -> Iso s t a b Usage example: data Foo a = Foo a preFoo :: % r (Foo a) (Foo b) a b preFoo = Foo `$` \(Foo a) -> a %Flipped variant of $.Usage example: +data Foo a = Foo {_getFoo :: a} preFoo :: ) r (Foo a) (Foo b) a b preFoo = _getFoo `%` Foo & Construct a ; this function is similar to Lens constructor function from lens package: 3lens :: (s -> b -> t) -> (s -> a) -> Lens' s t a b Usage example: mdata Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = (\s b -> s{_x = b}) `&` _x 'Flipped version of &+ that takes getter first and setter second. \data Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = _x `'` \s b -> s{_x = b} ( Construct a Lens out of a . \data Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = _x `'1` \s b -> s{_x = b} x :: Lens' Coords2D Int x = ( preX ) Constract a ; this function is similar to Prism constructor function from lens package: prism :: (b -> t) -> (s -> Q t a) -> Prism s t a b Usage example: >{-# LANGUAGE LambdaCase #-} data Sum a b = A a | B b preA :: " r (Sum a c) (Sum b c) a b preA = ) A $ \case A a -> S a B b -> T (B b) *Simplified construction of -, which can be used in following situations: Constructing Prism for types isomorphic to U or when using A operation, or similar, which either returns what you want or .4Alternative type signature of this function is also: * ::  r s s (U a) b ->  r s s a b +Convert  in to ) by injecting const to a setter function. + aPreIso f = aPreIso $ \fbt fsa -> V fbt `f` fsa $  !"#$%&'()*+*  !"#$%&'()*+*  !"#$%&'+()*$  !"#$%&'()*+      !6Lazy function combinator "between" and its variations.(c) 2013-2015, Peter TrakoBSD3peter.trsko@gmail.com experimentalNoImplicitPreludeSafe$,YCore combinator of this module and we build others on top of. It also has an infix form - and flipped infix form ..This function Defined as: , f g -> (f .) . (. g) -Infix variant of ,.gFixity is left associative and set to value 8, which is one less then fixity of function composition (W)..Flipped variant of - , i.e. flipped infix variant of ,.hFixity is right associative and set to value 8, which is one less then fixity of function composition (W)./As -/, but first function is also parametrised with a, hence the name / . Character ^D indicates which argument is parametrised with additional argument.This function is defined as: (f / g) h a -> (f a - g) h a gFixity is left associative and set to value 8, which is one less then fixity of function composition (W).0Flipped variant of /.hFixity is right associative and set to value 8, which is one less then fixity of function composition (W).19Pass additional argument to first two function arguments.This function is defined as: (f 1 g) h a b -> (f a - g a) h b  See also // to note the difference, most importantly that /E passes the same argument to all its functional arguments. Function /) can be defined in terms of this one as: (f / g) h a = (f 1 V g) h a a 2We can do it also the other way around and define 1 using /: f 1 g =  . (f .  /  g) KFixity is set to value 8, which is one less then of function composition (W).2Flipped variant of 1.KFixity is set to value 8, which is one less then of function composition (W).3Apply function g) to each argument of binary function and f™ to its result. In suffix "2l" the number is equal to arity of the function it accepts as a third argument and character "l" is for "left associative". 3 f g = (f - g) - g Interesting observation:  (\f g -> 3 X g f) ===   4Apply function g* to each argument of ternary function and f™ to its result. In suffix "3l" the number is equal to arity of the function it accepts as a third argument and character "l" is for "left associative".This function is defined as: 4 f g = ((f - g) - g) - g &Alternatively it can be defined using 3: 4 f g = 3 f g - g 5Convenience wrapper for: \f g -> R f - R g Name of 5 simply says that we apply  (R+) to both its arguments and then we apply -.`Fixity is left associative and set to value 8, which is one less then of function composition (W).6Flipped variant of 5.Name of 6 simply says that we apply  (R+) to both its arguments and then we apply ..KFixity is set to value 8, which is one less then of function composition (W).7Apply R to first argument of - . Dual to 9 which applies R to second argument. Defined as: f 7 g = R f - g mThis function allows us to define lenses mostly for pair of functions that form an isomorphism. See section  #g:3Constructing Lenses for details.Name of 7 simply says that we apply  (R.) to first (left) argument and then we apply -.`Fixity is left associative and set to value 8, which is one less then of function composition (W).8Flipped variant of 7.mThis function allows us to define lenses mostly for pair of functions that form an isomorphism. See section  #g:3Constructing Lenses for details.Name of 8 simply says that we apply  (R0) to second (right) argument and then we apply ..hFixity is right associative and set to value 8, which is one less then fixity of function composition (W).9Apply R to second argument of - . Dual to 7 which applies R to first argument. Defined as: f 9 g -> f - R g Name of 9 simply says that we apply  (R0) to second (right) argument and then we apply -.aFixity is right associative and set to value 8, which is one less then of function composition (W).:Flipped variant of 9.Name of : simply says that we apply  (R.) to first (left) argument and then we apply ..gFixity is left associative and set to value 8, which is one less then fixity of function composition (W).;Convenience wrapper for: \f g -> R . f '^~' g@.4This function has the same functionality as function 2lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Which is defined in  'http://hackage.haskell.org/package/lens lens package(. Only difference is that arguments of ; are flipped. See also section  #g:3Constructing Lenses.Name of ; simply says that we apply  (R/) to first (left) arguments and then we apply /.`Fixity is left associative and set to value 8, which is one less then of function composition (W).<Flipped variant of ~@^>.4This function has the same functionality as function 2lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Which is defined in  'http://hackage.haskell.org/package/lens lens package. See also section  #g:3Constructing Lenses.Name of ~@^> simply says that we apply  (R1) to second (right) arguments and then we apply ~@^>.`Fixity is left associative and set to value 8, which is one less then of function composition (W).=Convenience wrapper for: \f g -> R . f '^^' R . g@.Name of = simply says that we apply  (R+) to both its arguments and then we apply 1.`Fixity is left associative and set to value 8, which is one less then of function composition (W).>Flipped variant of =.Name of > simply says that we apply  (R+) to both its arguments and then we apply 2.KFixity is set to value 8, which is one less then of function composition (W).?Convenience wrapper for: \f g -> R . f '^^' g@.WThis function allows us to define generic lenses from gettern and setter. See section  #g:3Constructing Lenses for details.Name of ? simply says that we apply  (R/) to first (left) arguments and then we apply 1.`Fixity is left associative and set to value 8, which is one less then of function composition (W).@Flipped variant of ?.WThis function allows us to define generic lenses from gettern and setter. See section  #g:3Constructing Lenses for details.Name of @ simply says that we apply  (R1) to second (right) arguments and then we apply 2.KFixity is set to value 8, which is one less then of function composition (W).AConvenience wrapper for:  \f g -> f '^^' R . g@.Name of A simply says that we apply  (R1) to second (right) arguments and then we apply 1.`Fixity is left associative and set to value 8, which is one less then of function composition (W).BFlipped variant of A.Name of B simply says that we apply  (R/) to first (left) arguments and then we apply 2.KFixity is set to value 8, which is one less then of function composition (W).C!Prefix version of common pattern: \f -> a `f` b Where a and b: are fixed parameters. There is also infix version named D. This function is defined as: C a b f = f a b †Based on the above definition one can think of it as a variant function application that deals with two arguments, where in example Y only deals with one.Since version 0.11.0.0.D Infix version of common pattern: \f -> a `f` b Where a and b; are fixed parameters. There is also prefix version named C.Since version 0.11.0.0.E Infix version of common pattern: 6\f -> a `f` b -- Notice the order of 'a' and 'b'. Since version 0.11.0.0.F(Construct a function that encodes idiom: 6\f -> a `f` b -- Notice the order of 'b' and 'a'.  Function C can be redefined in terms of F as: a `C` b = F Y \f -> a `f` b <On one hand you can think of this function as a specialized X6 function and on the other as a function application Y&. All the following definitions work: F f g = f g F = X F = (Y) Usage examples: Qnewtype Foo a = Foo a inFoo :: ((a -> Foo a) -> (Foo t -> t) -> r) -> r inFoo = F Y# \f -> Foo `f` \(Foo a) -> Foo  }data Coords2D = Coords2D {_x :: Int, _y :: Int} inX :: ((Int -> Coords2D -> Coords2D) -> (Coords2D -> Int) -> r) -> r inX = F Y& \f -> (\b s -> s{_x = b}) `f` _x Since version 0.11.0.0.G(Construct a function that encodes idiom: 6\f -> b `f` a -- Notice the order of 'b' and 'a'.  Function E can be redefined in terms of G as: b E a = G Y \f -> b `f` a As FU, but the function is flipped before applied. All of the following definitions work: G f g = f (Z g) G = (W Z) Usage examples: Qnewtype Foo a = Foo a inFoo :: ((a -> Foo a) -> (Foo t -> t) -> r) -> r inFoo = G Y% \f -> (\(Foo a) -> Foo) `f` Foo  }data Coords2D = Coords2D {_x :: Int, _y :: Int} inX :: ((Int -> Coords2D -> Coords2D) -> (Coords2D -> Int) -> r) -> r inX = G Y$ \f -> _x `f` \b s -> s{_x = b} Since version 0.11.0.0.H Construct a ; this function similar to Iso constructor function from lens package: +iso :: (s -> a) -> (b -> t) -> Iso s t a b Usage example: data Foo a = Foo a preFoo :: % r (Foo a) (Foo b) a b preFoo = Foo `H` \(Foo a) -> a IFlipped variant of H.Usage example: +data Foo a = Foo {_getFoo :: a} preFoo :: ) r (Foo a) (Foo b) a b preFoo = _getFoo `I` Foo J Construct a ; this function is similar to Lens constructor function from lens package: 3lens :: (s -> b -> t) -> (s -> a) -> Lens' s t a b Usage example: mdata Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = (\s b -> s{_x = b}) `J` _x KFlipped version of J+ that takes getter first and setter second. \data Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = _x `K` \s b -> s{_x = b} L Construct a Lens out of a . \data Coords2D = Coords2D {_x :: Int, _y :: Int} preX :: PreLens' r Coords2D Int preX = _x `K1` \s b -> s{_x = b} x :: Lens' Coords2D Int x = L preX M Constract a ; this function is similar to Prism constructor function from lens package: prism :: (b -> t) -> (s -> Q t a) -> Prism s t a b Usage example: >{-# LANGUAGE LambdaCase #-} data Sum a b = A a | B b preA :: " r (Sum a c) (Sum b c) a b preA = M A Y \case A a -> S a B b -> T (B b) NSimplified construction of -, which can be used in following situations: Constructing Prism for types isomorphic to U or when using A operation, or similar, which either returns what you want or .4Alternative type signature of this function is also: N ::  r s s (U a) b ->  r s s a b OConvert  in to ) by injecting const to a setter function. O aPreIso f = aPreIso Y \fbt fsa -> V fbt `f` fsa $,-./0123456789:;<=>?@ABCDEFGHIJKLMNO*,-./0123456789:;<=>?@ABCDEFGHIJKLMNO*,-./0123456789:;<=>?@ABCDEFGHIJKOLMN$,-./0123456789:;<=>?@ABCDEFGHIJKLMNO-./01256789:;<=>?@ABCDE 1Function combinator "between" and its variations.(c) 2013-2016, Peter TrakoBSD3peter.trsko@gmail.com experimentalNoImplicitPreludeSafe*,-./0123456789:;<=>?@ABCDEFGHIJKLMNO[  !"#$%&'()*+,-./0123456789:;<=>?@  !"#$%&'()*+,-./0123456789:;<=>?@ABCADEABFADGADHABIABJABAB ABABKbetwe_4mjj2T1PCgNELXb6B6cIXy%Data.Function.Between.Strict.InternalData.Function.Between.TypesData.Function.Between.StrictData.Function.Between.Lazy Data.Functionflip Data.MaybeNothingJustData.Function.Between^@~idon Data.Functor<$>$. Data.Typeablecast Data.Tuplecurrysnduncurry PrePrism'PrePrismPreLens'PreLensPreIso'PreIsobetween~@~~@@~~@@^^@^^@@^ between2l between3l<~@~><~@@~><~@~~@@~>~@~><~@@~<^@~~@@^><^@^><^@@^><^@^^@@^>^@^><^@@^ inbetween~$~~$$~withInwithReInpreIsopreIso'preLenspreLens'leprePrism prePrism'preIsoToPreLensbaseGHC.Base$! Data.EitherEitherfmapRightLeftMaybeconst