úÎ=r;o     6Types, instances, and functions for an applicative Map)(c) Tristan Wibberley, Eric Mertens, 2017GPL-2tristan.wibberley@gmail.com experimentalSafeDRLAn applicative map that discards mismatched keys (ie, uses intersection) - "SubZero type and related functions(c) Tristan Wibberley, 2017GPL-2tristan.wibberley@gmail.com experimentalNone9;<=I !collapse f empty = simplify empty'collapse f (pure x) = simplify (pure x)#collapse f (x <|> y) = pure (f x y)g must form a monoid under f when  is the monoid's identity. 0Tries to convert from one alternative to another FCombines many alternatives into one using a function parameter.  stays è. This is quite free in the type of the result so the user can choose whether to keep the same type to re-expand the structure or to transform to a smaller type to avoid relying on instances for certain behaviours. 4Provides structure for values at the other end of a iTurns a container of values to a container of either retained or destroyed values based on a predicate¯The type constraint allows us to model possible outcomes so destroyed values are just "no possible outcomes" while retained values represent "the only possible outcome".4To represent that "no value" is a possible outcome, a should be some type like ( a) or (  a). fThis 3 defines the broad scale behaviours but its  i instance is overridden. This in particular might change during upcoming design validation.gThis  supplies the supercedent  / instance and thus the finer behaviours.8If the type constructor of the possibilities concept is  then you can use 5 to provide default values for impossible points.NOTE@: This uses the applicative instance of the broad scale G which means exact behaviour can vary depending on the type of ! f[ because each has a different technique to ensure a value is found for every point:  list of aDCross-product; Providing all default values once for all points." a{zipWith; Providing one default value for each point until there are either no defaults remaining or no more points.# aPOne default must surely be provided and it is used if a default is required. a%Not sure exactly what this does, TBC. a%Not sure exactly what this does, TBC.fmap below the zeropoint.fmap below the zeropoint, function variant of  operatorAlternative below the zeropointTurns a value "a" to $ a or %E based on a predicate assuming you use it in a context that wants  a) instead of some other representation of  sDoes the same as  for values at the other end of #."keep = (keepIdentity . Identity) fSuperposition within & * gXSuperposition within a nondeterminism list (ie, []) This is roughly the same as   (& # []) h¨ but of course they have different instances of other typeclasses and if that were really true then it would be Superpositions of Identity all the way down. Initial flat structure*enhanced structure, albeit with no changesYA predicate that indicates whether a point is occupied by its original value or vacant."The seed points with their values.The constructed SubZero value.Default valuesStructured containerDestructured container      Examples using SubZero(c) Tristan Wibberley, 2017GPL-2tristan.wibberley@gmail.com experimentalNonecTakes values in an ! and returns the  'https://en.wikipedia.org/wiki/Fizz_buzz fizzbuzz game's answer for that value. Caution. regular lists will not do what you want, use:'      ! "#$"#%"#&"'("#)"#*"#+"""#,"#-"./0&subzero-0.1.0.7-3seRfjzfZMTJzdTS1TfXHk Data.Map.IMapControl.Applicative.SubZero$Control.Applicative.SubZero.ExamplesData.Functor.IdentityIdentityControl.ApplicativeZipListfromListintersectionWithIMap $fIsMapIMap$fApplicativeIMap $fFunctorIMap $fIsMapIntMap $fIsMapMap $fShowIMap$fEqIMap Superpositionsimplifycollapserevealpointsflatten<-$> universal<-|>keep keepIdentity$fSuperpositionComposeCompose$fSuperposition[]hfizzbuzzIsMapKeybaseGHC.BaseemptyFunctorMaybe Data.EitherEitherString Alternative ApplicativeJustNothingData.Functor.ComposeCompose