úÎvo’F      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEBSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None&',-;=FKQSTVd"Concatenation of lists. Instances: Ttype instance Nil :++: xs = xs type instance (h:*:t) :++: xs = h :*: (t :++: xs) BSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None&',-;<=FKQSTV)FThe API presented by !Data.Pattern.Base.Difference.GADT and #Data.Pattern.Base.Difference.Coerce. An instance of Fb is a type which converts an inductively-defined type to one with an efficient append operation.Gconstructs the empty d t.H appends two d ts.I3given a "cons" operation, constructs the singleton d t.J given a "nil" value, "runs" the d t.KFGHIJLMNOPQRSTUVWKXFGHIJBSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None&',-;=FKQSTVHTuples with types given by xs.Curried functions. We have /Fun '[x1, ..., xn] r = x1 -> ... -> xn -> rThe empty tupleThe singleton tuple Concatenation of tuples. 2Runs a tuple by applying it to a curried function.YORuns a tuple by applying it to an uncurried function expecting nested pairs.   Z[\]^_`abcdeBSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None&',-;=FKQSTV,¡6Pattern-match clauses. Typically something of the form pattern  functionPwhere the function takes one argument for each variable bound by the pattern. Clauses can be constructed with () , run with tryMatch, and manipulated by the f and g" instances. In particular, the () operator from the h9 class is the way to list multiple cases in a pattern.3Extract the underlying computation constituting a D. This function is not intended to be used directly; instead, see match, tryMatch, mmatch, and elim from Data.Pattern.Common."The pattern type. A value of type Pattern vars a. is a pattern which matches values of type a: and binds variables with types given by the type-list vars!. For example, something of type !Pattern (a :*: c :*: Nil) (a,b,c)Iis a pattern which matches against a triple and binds values of types a and c3. (A pattern of this type can be constructed as tup3 var __ var.)9Many "normal" patterns can be conveniently defined using mk0, mk1, mk2 , and so on. Construct a o from a pattern and a function which takes one argument for each variable bound by the pattern. For example, gpair __ nothing ->> 3 pair var nothing ->> \x -> x + 3 pair var (just var) ->> \x y -> x + y + 3 i4BSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None&',-;=FKQSTVkR$EVariable pattern: always succeeds, and binds the value to a variable.give bH always succeeds, ignoring the matched value and providing the value b) instead. Useful in conjunction with (")S for providing default values in cases that would otherwise not bind any values.aWildcard pattern: always succeeds, binding no variables. (This is written as two underscores.) Failure pattern: never succeeds. :Predicate pattern. Succeeds if the given predicate yields j, fails otherwise.Can be used with (")) for some uses similar to pattern guards: ymatch a $ left (var /\ is even) ->> id <|> left __ ->> const 0 <|> right __ ->> const 1 Note that   is like @ but with k instead of l ().!:Constant pattern: test for equality to the given constant.cst x = is (==x)."ƒConjunctive (and) pattern: matches a value against two patterns, and succeeds only if both succeed, binding variables from both. (/\) = B (\a -> Just (a,a))#}Disjunctive (or) pattern: matches a value against the first pattern, or against the second pattern if the first one fails.$GView pattern: do some computation, then pattern match on the result.%Convenient infix synonym for $.&ƒPartial view pattern: do some (possibly failing) computation, then pattern match on the result if the computation is successful.'Convenient infix synonym for &.( pfilter p matches every element of a m' data structure against the pattern p‰, discarding elements that do not match. From the matching elements, binds a list of values corresponding to each pattern variable.)pmap p matches every element of a n' data structure against the pattern pB. The entire match fails if any of the elements fail to match p). If all the elements match, binds a tK-structure full of bound values corresponding to each variable bound in p.* pfoldr p f b matches every element of a m' data structure against the pattern p…, discarding elements that do not match. Folds over the bindings produced by the matching elements to produce a summary value.=The same functionality could be achieved by matching with  pfilter pi and then appropriately combining and folding the resulting lists of bound values. In particular, if p binds only one value we have Cmatch t (pfoldr p f b ->> id) === match t (pfilter p ->> foldr f b)However, when pÌ binds more than one value, it can be convenient to be able to process the bindings from each match together, rather than having to deal with them once they are separated out into separate lists.+ "Runs" a M, by matching it against a value and returning a result if it matches, or Nothing if the match fails.,, satisfies the identity #match a c = fromJust (tryMatch a c).- mmatch m p = m >>= . p>Useful for applicative-looking monadic pattern matching, as in kex7 :: IO () ex7 = mmatch getLine $ cst "" ->> return () <|> var ->> putStrLn . ("You said " ++).  elim = flip ,DUseful for anonymous matching (or for building "eliminators", like o and p). For example: keither withLeft withRight = elim $ left var ->> withLeft <|> right var ->> withRight/Match True.0Match False.1!A strict match on the unit value ().2A synonym for 1.3AConstruct a pattern match against a pair from a pair of patterns.4A synonym for 3.5Match a 3-tuple.6Match a 4-tuple.7Match a 5-tuple.8 Match the q constructor of l.9 Match the r constructor of l.: Match the s constructor of t.; Match the u constructor of t.<Match the empty list.= Match a cons.> Match zero.?…Match a natural number which is the successor of another natural (and match the predecessor with a nested pattern). Together, > and ? allow viewing Integral types as Peano numbers. Note that ? never matches negative numbers.* !"#$%&'()*+,-./0123456789:;<=>?@ABCDE*!"#$%&' ()*,+-./0123456789:;<=>?@ABCDE%5'5BSD3$Brent Yorgey <byorgey@cis.upenn.edu> experimentalnon-portable (see .cabal)None &';=FKQSTVn ;  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEv      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTTUUVWXYZ[\\S]^_``abcdefghijklmklnopqrstuvwxyvzv{v|}3first-class-patterns-0.3.2.4-32KVFuIaTUd9qawbSFGEmrData.Pattern.BaseData.Pattern.Base.TypeListData.Pattern.Base.TupleData.Pattern.CommonData.Pattern.Base.Difference Data.PatternbaseGHC.Base<|>:++: Distribute distributeMapTupleFunzeroToneT<+>runTuple$fUncurriable:$fUncurriable[] $fTupable: $fTupable[] $fDistribute:$fDistribute[]Clause runClausePattern runPattern->>$fFunctorClause$fApplicativeClause $fMonadClause$fAlternativeClause$fMonadPlusClausevargive__pfailiscst/\\/view-->tryView-?>pfilterpmappfoldrtryMatchmatchmmatchelimtruefalseunittup0pairtup2tup3tup4tup5nothingjustleftrightnilconszerosucmk0mk1mk2mk3mk4mk5 DifferencezeroDplusDmkOneDevalDDCoerceDListD:==:EqualListclosureassoc rightIdentGadtD runTupleTTupablemkTupleTuple' runTuple' UncurriableuncurryT D:R:Tup:0Pair D:R:Tup[]0UnitMonad MonadPlus Alternativeghc-prim GHC.TypesTrueBoolMaybe Data.FoldableFoldableData.Traversable Traversable Data.Maybemaybe Data.EithereitherNothingJustLeftEitherRight