: 8    "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/viewg^This 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.6How do individual items have a set of possible values?AHow do those possible values collapse to form one optional value?etc.etc1There 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 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.&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.2-BA77PPZC8kxIgD3a6zI7p0Control.Applicative.SubZeroData.Functor.IdentityIdentitySubZerorevealpointsflattencollapse$fAlternativeSubZero $fShowSubZero $fReadSubZero $fEqSubZero $fOrdSubZero$fFunctorSubZero$fApplicativeSubZerobaseControl.ApplicativeZipListGHC.Base AlternativeData.Functor.ComposeComposefoldlA1letStandJustNothingFunctorMaybe Data.EitherEitherString Applicative getSubZero