úÎPšM1      !"#$%&'()*+,-./0Safe 123456789:;<=289:;<= 123456789:;<=Safe[ A wrapper for > where the   operator is defined only over ? values. ExamplesTwo ? s make a @.5AppendRight (Right "ab") <>? AppendRight (Right "cd")1Just (AppendRight {unAppendRight = Right "abcd"})Anything else produces A3AppendRight (Left "ab") <>? AppendRight (Left "cd")Nothing combines consecutive ? values, leaving the B values unmodified.Cxs = [Left "a", Left "b", Right "c", Right "d", Left "e", Left "f"];fmap unAppendRight . groupAndConcat . fmap AppendRight $ xs0[Left "a",Left "b",Right "cd",Left "e",Left "f"]A wrapper for > where the   operator is defined only over B values. ExamplesTwo B s make a @.1AppendLeft (Left "ab") <>? AppendLeft (Left "cd").Just (AppendLeft {unAppendLeft = Left "abcd"})Anything else produces A3AppendLeft (Right "ab") <>? AppendLeft (Right "cd")Nothing combines consecutive B values, leaving the ? values unmodified.Cxs = [Left "a", Left "b", Right "c", Right "d", Left "e", Left "f"]9fmap unAppendLeft . groupAndConcat . fmap AppendLeft $ xs)[Left "ab",Right "c",Right "d",Left "ef"]#A wrapper to turn any value with a C instance into a value with a   instance whose   operator always returns @. ExamplesTotal "ab" <>? Total "cd"Just (Total {unTotal = "abcd"})f = getProduct . unTotalg = Total . Product(fmap f . partialConcat . fmap g $ [1..4]Just 24 A wrapper for D with an error-propagating C. A   is like a C!, but with an operator returning D a rather than a.For comparison: (E) :: C a => a -> a -> a ( ) ::   a => a -> a -> D a .The associativity axiom for partial semigroupsFor all x, y, z:If x   y = @ xy and y   z = @ yz, thenx   yz = xy   z.1Relationship to the semigroup associativity axiomfThe partial semigroup associativity axiom is a natural adaptation of the semigroup associativity axiom x E (y E z) = (x E y) E z;with a slight modification to accommodate situations where ED is undefined. We may gain some insight into the connection between C and  I by rephrasing the partial semigroup associativity in terms of a partial E operator thusly:For all x, y, z:If x E y and y E z are both defined, thenx E (y E z) is defined if and only if (x E y) E z is defined, andif these things are4 all defined, then the axiom for total semigroups x E (y E z) = (x E y) E z must hold.zApply a semigroup operation to any pairs of consecutive list elements where the semigroup operation is defined over them. ExamplesFor >, ! combines contiguous sublists of B and contiguous sublists of ?.Cxs = [Left "a", Right "b", Right "c", Left "d", Left "e", Left "f"]groupAndConcat xs [Left "a",Right "bc",Left "def"]If xsV is nonempty and the partial semigroup operator is defined for all pairs of values in xs, then  xs produces a @C result with the combination of all the values. Otherwise, returns A. Examples&When all values can combine, we get a @ of their combination.,partialConcat [Left "a", Left "b", Left "c"]Just (Left "abc"),When some values cannot be combined, we get A.-partialConcat [Left "a", Left "b", Right "c"]NothingWhen the list is empty, we get A.partialConcat []NothingLike , but for non-empty lists. Examples&When all values can combine, we get a @ of their combination.1partialConcat1 (Left "a" :| [Left "b", Left "c"])Just (Left "abc"),When some values cannot be combined, we get A.2partialConcat1 (Left "a" :| [Left "b", Right "c"])NothingExamplesTIf lists are the same length and each pair of elements successfully, then we get a @ result.$xs = [Left "a", Left "b", Right "c"]$ys = [Left "1", Left "2", Right "3"]partialZip xs ys%Just [Left "a1",Left "b2",Right "c3"]-If the pairs do not all combine, then we get A.$xs = [Left "a", Left "b", Right "c"]%ys = [Left "1", Right "2", Right "3"]partialZip xs ysNothing1If the lists have different lengths, then we get A.$xs = [Left "a", Left "b", Right "c"]ys = [Left "1", Left "2"]partialZip xs ysNothingLike , but for non-empty lists. ExamplesTIf lists are the same length and each pair of elements successfully, then we get a @ result.&xs = Left "a" :| [Left "b", Right "c"]&ys = Left "1" :| [Left "2", Right "3"]partialZip1 xs ys*Just (Left "a1" :| [Left "b2",Right "c3"])-If the pairs do not all combine, then we get A.&xs = Left "a" :| [Left "b", Right "c"]'ys = Left "1" :| [Right "2", Right "3"]partialZip1 xs ysNothing1If the lists have different lengths, then we get A.&xs = Left "a" :| [Left "b", Right "c"]ys = Left "1" :| [Left "2"]partialZip1 xs ysNothing!          6F       !"#$%&'()*+,-./0123456789:;<=>?=>@=AB=AC=>D=EF=AG=EHI0partial-semigroup-0.1.0.2-Gqnx52pQVlDGhmtUgBeJqMData.PartialSemigroupPaths_partial_semigroup AppendRight unAppendRight AppendLeft unAppendLeftTotalunTotalPartial unPartialPartialSemigroup<>?groupAndConcat partialConcatpartialConcat1 partialZip partialZip1$fPartialSemigroupAppendRight$fPartialSemigroupAppendLeft$fPartialSemigroupTotal$fMonoidPartial$fSemigroupPartial$fPartialSemigroupZipList$fPartialSemigroup(,,)$fPartialSemigroup(,)$fPartialSemigroupEither$fPartialSemigroupProduct$fPartialSemigroupSum$fPartialSemigroup[]$fPartialSemigroupIdentity$fPartialSemigroup() $fEqPartial $fOrdPartial $fReadPartial $fShowPartial $fEqTotal $fOrdTotal $fReadTotal $fShowTotal$fEqAppendLeft$fOrdAppendLeft$fReadAppendLeft$fShowAppendLeft$fEqAppendRight$fOrdAppendRight$fReadAppendRight$fShowAppendRightcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamebase Data.EitherEitherRightGHC.BaseJustNothingLeftData.Semigroup SemigroupMaybe<>