Îõ³h&²È      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG Safe-Inferred  partial-semigroupA wrapper for H3 whose partial semigroup operation fails when two Is are combined.partial-semigroup1A 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.Ãxs = [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.Ãxs = [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 axiomçThe 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 OÅ is undefined. We may gain some insight into the connection between N and Ê 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-semigroupúApply 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.Ãxs = [Left "a", Right "b", Right "c", Left "d", Left "e", Left "f"]groupAndConcat xs [Left "a",Right "bc",Left "def"]partial-semigroupIf xs× is nonempty and the partial semigroup operator is defined for all pairs of values in xs, then  xs produces a IÄ 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-semigroupExamplesÔIf 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.ExamplesÔIf 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    6 Safe-Inferred÷Apartial-semigroupThe class of generic type P)s for which we can automatically derive :Q - a single valueR - a value with some additional metadata (which we simply discard)S - sum typesT - product typesABCCABÕ        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHGIJKJLGMJNOPOQRSTUV×0partial-semigroup-0.6.0.2-2Kl4iqxYtZJFdNlA1mqZqvData.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 $fEqAtMostOne$fOrdAtMostOne$fReadAtMostOne$fShowAtMostOne$fEqOne$fOrdOne $fReadOne $fShowOne$fEqAppendRight$fOrdAppendRight$fReadAppendRight$fShowAppendRight$fEqAppendLeft$fOrdAppendLeft$fReadAppendLeft$fShowAppendLeft $fEqTotal $fOrdTotal $fReadTotal $fShowTotal $fEqPartial $fOrdPartial $fReadPartial $fShowPartialPartialSemigroupReprepPartialSemigroupOpgenericPartialSemigroupOp$fPartialSemigroupRepk:+:$fPartialSemigroupRepk:*:$fPartialSemigroupRepkM1$fPartialSemigroupRepkK1 GHC.MaybeMaybeJust Data.EitherEitherRightNothingLeftGHC.Base Semigroup<>RepK1M1:+::*: