úÎ!Z€UÒH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGSafeQ& partial-semigroupA wrapper for H2 whose partial semigroup operation fails when two Is are combined. partial-semigroup2A partial semigroup operation which always fails. partial-semigroupA wrapper for J where the  operator is defined only over K values.ExamplesTwo K s make a I.5AppendRight (Right "ab") <>? AppendRight (Right "cd")1Just (AppendRight {unAppendRight = Right "abcd"})Anything else produces L3AppendRight (Left "ab") <>? AppendRight (Left "cd")Nothing combines consecutive K values, leaving the M 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"] partial-semigroupA wrapper for J where the  operator is defined only over M values.ExamplesTwo M s make a I.1AppendLeft (Left "ab") <>? AppendLeft (Left "cd").Just (AppendLeft {unAppendLeft = Left "abcd"})Anything else produces L3AppendLeft (Right "ab") <>? AppendLeft (Right "cd")Nothing combines consecutive M values, leaving the K 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"] partial-semigroup#A wrapper to turn any value with a N instance into a value with a  instance whose  operator always returns I.ExamplesTotal "ab" <>? Total "cd"Just (Total {unTotal = "abcd"})f = getProduct . unTotalg = Total . Product(fmap f . partialConcat . fmap g $ [1..4]Just 24partial-semigroupA wrapper for H with an error-propagating N. partial-semigroupA  is like a N!, but with an operator returning H a rather than a.For comparison: (O) :: N a => a -> a -> a () ::  a => a -> a -> H a .The associativity axiom for partial semigroupsFor all x, y, z:If x  y = I xy and y  z = I 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 O (y O z) = (x O y) O z;with a slight modification to accommodate situations where OD is undefined. We may gain some insight into the connection between N and I by rephrasing the partial semigroup associativity in terms of a partial O operator thusly:For all x, y, z:If x O y and y O z are both defined, thenx O (y O z) is defined if and only if (x O y) O z is defined, andif these things are4 all defined, then the axiom for total semigroups x O (y O z) = (x O y) O z must hold.partial-semigroupyApply a semigroup operation to any pairs of consecutive list elements where the semigroup operation is defined over them.ExamplesFor J, ! combines contiguous sublists of M and contiguous sublists of K.Cxs = [Left "a", Right "b", Right "c", Left "d", Left "e", Left "f"]groupAndConcat xs [Left "a",Right "bc",Left "def"]partial-semigroupIf xsV is nonempty and the partial semigroup operator is defined for all pairs of values in xs, then  xs produces a IC result with the combination of all the values. Otherwise, returns L.Examples&When all values can combine, we get a I of their combination.,partialConcat [Left "a", Left "b", Left "c"]Just (Left "abc"),When some values cannot be combined, we get L.-partialConcat [Left "a", Left "b", Right "c"]NothingWhen the list is empty, we get L.partialConcat []Nothingpartial-semigroupLike , but for non-empty lists.Examples&When all values can combine, we get a I of their combination.1partialConcat1 (Left "a" :| [Left "b", Left "c"])Just (Left "abc"),When some values cannot be combined, we get L.2partialConcat1 (Left "a" :| [Left "b", Right "c"])Nothingpartial-semigroupExamplesSIf lists are the same length and each pair of elements successfully, then we get a I 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 L.$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 L.$xs = [Left "a", Left "b", Right "c"]ys = [Left "1", Left "2"]partialZip xs ysNothingpartial-semigroupLike , but for non-empty lists.ExamplesSIf lists are the same length and each pair of elements successfully, then we get a I 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 L.&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 L.&xs = Left "a" :| [Left "b", Right "c"]ys = Left "1" :| [Left "2"]partialZip1 xs ysNothingpartial-semigroup    6Safe>UVUžApartial-semigroupThe class of generic type P(s for which we can automatically derive :Q - a single valueRB - a value with some additional metadata (which we simply discard)S - sum typesT - product typesABCCABU        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHGIJKJLGMJNOPOQRSTUVW/partial-semigroup-0.5.1.0-8kzR2qqVvfnbGd9NF5wK5Data.PartialSemigroup.GenericsData.PartialSemigroupbase GHC.GenericsGeneric AtMostOne theOneMaybeOnetheOne AppendRight unAppendRight AppendLeft unAppendLeftTotalunTotalPartial unPartialPartialSemigroup<>?groupAndConcat partialConcatpartialConcat1 partialZip partialZip1$fPartialSemigroupZipList$fPartialSemigroup(,,)$fPartialSemigroup(,)$fPartialSemigroupEither$fPartialSemigroupIdentity$fPartialSemigroupProduct$fPartialSemigroupSum$fPartialSemigroup[]$fPartialSemigroup()$fSemigroupPartial$fPartialSemigroupTotal$fPartialSemigroupAppendLeft$fPartialSemigroupAppendRight$fPartialSemigroupOne$fPartialSemigroupAtMostOne $fEqPartial $fOrdPartial $fReadPartial $fShowPartial $fEqTotal $fOrdTotal $fReadTotal $fShowTotal$fEqAppendLeft$fOrdAppendLeft$fReadAppendLeft$fShowAppendLeft$fEqAppendRight$fOrdAppendRight$fReadAppendRight$fShowAppendRight$fEqOne$fOrdOne $fReadOne $fShowOne $fEqAtMostOne$fOrdAtMostOne$fReadAtMostOne$fShowAtMostOnePartialSemigroupReprepPartialSemigroupOpgenericPartialSemigroupOp$fPartialSemigroupRep:+:$fPartialSemigroupRep:*:$fPartialSemigroupRepM1$fPartialSemigroupRepK1 GHC.MaybeMaybeJust Data.EitherEitherRightNothingLeftGHC.Base Semigroup<>RepK1M1:+::*: