< :    "SubZero type and related functions(c) Tristan Wibberley, 2017GPL-2tristan.wibberley@gmail.com experimentalNoneIEConverts a functor so that each point at the source has alternatives.It's just like Compose but the applicative instance appends new alternative values in the rightmost (inner/minor) functor instead of in the leftmost (outer/major) functor.The result is that two  Hs of alternatives zip together, providing alternatives to each point.8Given the immediate utility of this, I do wonder if the   instance of  is the wrong one. f'The major functor, overall mapping/viewgaThis has a a few key useful interpretations depending on its instances, examples below.a!Transformed/contained value type.;Some example instances that you might want to rely on from g:  Superposition functor.MHow do individual items have a set of possible values?XHow do those possible values collapse to form one optional value?etc. etcFThere are a lot of other utilities for this type.A foldl for foldable alternatives, empty stays empty, nonempty becomes one alternative The applicative you get back can be a different type than the inputTurns a value to  value or s based on a predicate assuming you use it in a context that wants Maybe instead of some other representation of  s4Provides 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 predicateThe 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 6 defines the broad scale behaviours but its  o instance is overridden. This in particular might change during upcoming design validation.gThis  supplies the supercedent  2 instance and thus the finer behaviours.,If the type of the possibilities concept is  then you can use 1 to provide default values for impossible points.NOTE=: This uses the applicative instance of the broad scale D which means exact behaviour can vary depending on the type of  fX because each has a different technique to ensure a value is found for every point:  list of aWCross-product; Providing all default values once for all points.  azipWith; Providing one default value for each point until there are either no defaults remaining or no more points. acOne 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.&Take the alternatives embedded in the < and collapse them with a combining function to a single   value or empty which means no possible outcomes. This is quite free in the type of the possibilities concept of the result. It's compatible with  for further uses with , but you can retain behaviours of more sophisticated types. A consequence of this is that you will probably need to state a type. Initial flat structure*enhanced structure, albeit with no changesXA predicate that indicates whether a point is occupied by its original value or vacant."The seed points with their values.The constructed  value.Default valuesStructured containerDestructured containercombining functionfull structurecollapsed structure      !"&subzero-0.1.0.1-Lqi4pcTifGa3rHTgnIqv2cControl.Applicative.SubZero Data.FunctorIdentitySubZerorevealpointsflattencollapse$fAlternativeSubZero $fShowSubZero $fReadSubZero $fEqSubZero $fOrdSubZero$fFunctorSubZero$fApplicativeSubZerobaseControl.ApplicativeZipListGHC.Base AlternativeData.Functor.ComposeComposefoldlA1letStandJustNothingFunctorMaybe Data.EitherEitherString Applicative getSubZero