úÎ!Pp<œÿU      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST None.=?HMXkílaopPowerset data type.WThis data type is a newtype wrapper around '[]'. This exists in order to implement an U and V1 instance that cannot be harmful for the outside.laopWrapper around W@s that have a restrictive semantic associated. A value of type  n m$ can only be instanciated with some W i that's  n <= i <= m.laop<Natural constructor function. Throws a runtime error if the W* value is greater than the corresponding m or lower than n in the  n m type.laop(Auxiliary function that promotes binary W functions to  binary functions.laop2Auxiliary function that promotes ternary (binary) W functions to  functions.laop2Auxiliary function that promotes ternary (binary) W functions to  functions. laop Optimized U= instance for tuples that comply with the given constraints. laopIThrows a runtime error if any of the operations overflows or underflows.(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone!j(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',./1=>?@AHUVXkgÈ:laopType class for defining the fromList conversion function.Given that it is not possible to branch on types at the term level type classes are needed bery much like an inductive definition but on types.laopiBuild a matrix out of a list of list of elements. Throws a runtime error if the dimensions do not match.XlaopDConstraint type synonyms to keep the type signatures less convolutedlaopIType family that normalizes the representation of a given data structurelaopHType family that computes of a given type dimension from a given natural4Thanks to Li-Yao Xia this type family is super fast.laopDType family that computes the cardinality of a given type dimension.FIt can also count the cardinality of custom types that implement the Y instance.laopALAoP (Linear Algebra of Programming) Inductive Matrix definition."laopEmpty matrix constructor#laopUnit matrix constructor$laopMatrix   constructor%laopMatrix   constructor&laopMatrix ! constructor'laopMatrix ! constructor(laopTMatrix builder function. Constructs a matrix provided with a construction function.)laop!Constructs a column vector matrix*laopConstructs a row vector matrix+laop6Lifts functions to matrices with arbitrary dimensions.ONOTE: Be careful to not ask for a matrix bigger than the cardinality of types a or b allows.,laop5Lifts functions to matrices with dimensions matching a and b cardinality's.-laop1Converts a matrix to a list of lists of elements..laop(Converts a matrix to a list of elements./laop3The zero matrix. A matrix wholly filled with zeros.0laop2The ones matrix. A matrix wholly filled with ones.Also known as T (Top) matrix.1laopLThe constant matrix constructor. A matrix wholly filled with a given value.2laopThe T (Top) row vector matrix.3laopIdentity matrix.4laop?Matrix composition. Equivalent to matrix-matrix multiplication.QThis definition takes advantage of divide-and-conquer and fusion laws from LAoP.5laop$Biproduct first component projection6laop%Biproduct second component projection7laop#Biproduct first component injection8laop$Biproduct second component injection9laopObtain the number of rows. NOTE: The ZI constaint is needed in order to obtain the dimensions in constant time.TODO: A 9! function that does not need the Z) constraint in exchange for performance.:laopObtain the number of columns. NOTE: The ZI constaint is needed in order to obtain the dimensions in constant time.TODO: A :! function that does not need the Z) constraint in exchange for performance.;laop9Matrix coproduct functor also known as matrix direct sum.<laop5Khatri Rao product first component projection matrix.=laop6Khatri Rao product second component projection matrix.>laop7Khatri Rao Matrix product also known as matrix pairing.DNOTE: That this is not a true categorical product, see for instance: ` | kp1 . khatri a b == a khatri a b ==> | | kp2 . khatri a b == b Emphasis on the implication symbol.?laop6Matrix product functor also known as kronecker product@laopMatrix "abiding" followin the 'Junc'-'Split' abide law.Law:   (! a c) (! b d) == ! (  a b) (  c d) AlaopMatrix "abiding" followin the 'Split'-'Junc' abide law. ! (  a b) (  c d) ==   (! a c) (! b d) BlaopMatrix transposition.ClaopSelective functors CQ operator equivalent inspired by the ArrowMonad solution presented in the paper.Dlaop6McCarthy's Conditional expresses probabilistic choice.ElaopMatrix pretty printerFlaopMatrix pretty printerGlaopHelper conversion functionHlaopHelper conversion functionIlaopRelational negationJlaopRelational additionKlaopRelational multiplicationLlaopRelational subtractionMlaopMatrix relational composition.Nlaop Matrix relational right divisionOlaopMatrix relational left divisionPlaop$Matrix relational symmetric divisionQlaop7Lifts functions to relations with arbitrary dimensions.QNOTE: Be careful to not ask for a relation bigger than the cardinality of types a or b allows.Rlaop6Lifts functions to relations with dimensions matching a and b cardinality's.Slaop-Lifts a relation function to a Boolean MatrixXlaop#It isn't possible to implement the [% function so it's implementation is \ . However 4Z can be and this partial class implementation exists just to make the code more readable. Please use 3 instead.< !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS< !"#$&-.(*)/021:9BCD@A'56%78;?<=>34+,EFGHMNOPQRSIJKL%3'2;5?4(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone &',.1;<>XkÝýTjlaopDConstraint type synonyms to keep the type signatures less convolutedklaopRelation data type.mlaop6Boolean type synonym for working with boolean matricesnlaopEmpty matrix constructorolaopUnit matrix constructorplaopBoolean Matrix Junc1 constructor, also known as relational coproduct.See ¯.qlaopBoolean Matrix Junc constructorSee ¯.rlaopBoolean Matrix Split/ constructor, also known as relational product.slaopBoolean Matrix Split constructortlaopiBuild a matrix out of a list of list of elements. Throws a runtime error if the dimensions do not match.ulaopTMatrix builder function. Constructs a matrix provided with a construction function.vlaop6Lifts functions to matrices with arbitrary dimensions.ONOTE: Be careful to not ask for a matrix bigger than the cardinality of types a or b allows.wlaop5Lifts functions to matrices with dimensions matching a and b cardinality's.xlaopLifts relation functions to k]laop Lowers a k to a functionylaop1Converts a matrix to a list of lists of elements.zlaop(Converts a matrix to a list of elements.{laopConverts a well typed k to ^.|laopPower transpose.)Maps a relation to a set valued function.}laopBelongs relation~laop7The zero relation. A relation where no element of type a relates with elements of type b.4Also known as "¥ (Bottom) Relation or empty Relation.  r `ƒ ` "¥ == "¥ `ƒ` r == "¥ "¥ `Œ ` R && R `Œ` T == True laop:The ones relation. A relation where every element of type a% relates with every element of type b.5Also known as T (Top) Relation or universal Relation.  "¥ `Œ ` R && R `Œ` T == True €laop The T (Top) row vector relation.laopPoint constant relation‚laopIdentity matrix ‚ `ƒ` r == r == r `ƒ` ‚ ƒlaopRelational composition r `ƒ` (s `ƒ ` p) = (r `ƒ` s) `ƒ` p „laopRelational right division„ x y is the largest relation z which, pre-composed with y, approximates x.…laopRelational left divisionThe dual division operator: … y x == ‹ („ (‹ x) (‹ y) †laopRelational symmetric division‰ c b († s r) means that b and c. are related to exactly the same outputs by r and by s.‡laopRelational shrinking.r `‡` s is the largest part of r1 such that, if it yields an output for an input x), it must be a maximum, with respect to s , among all possible outputs of x by r.ˆlaopRelational overriding.r `ˆ` s2 yields the relation which contains the whole of s and that part of r where s is undefined. ~ `ˆ ` s == s r `ˆ` ~ == r r `ˆ` r == r ‰laopRelational application.If a and b are related by k r then ‰ a b r == o ( 1)ŠlaopRelational application The same as ‰ but converts m to ^‹laopRelational converse Given binary k r, writing ‰ a b r (read: b is related to a by r ) means the same as ‰ b a (‹ r), where ‹ r! is said to be the converse of r. In terms of grammar, ‹ r! corresponds to the passive voiceŒlaop&Relational inclusion (subset or equal)laop$Relational implication (the same as Œ)ŽlaopRelational bi-implicationlaopRelational intersectionLifts pointwise conjunction. (r `` s) ` ` t == r `` (s `` t) x `Œ` r ` ` s == x ` ` r && x `` s laopRelational unionLifts pointwise disjunction. (r `` s) ` ` t == r ` (s `` t) r `` s `Œ ` x == r `Œ ` x && s `Œ` x r `ƒ` (s ` ` t) == (r `ƒ` s) `` (r `ƒ ` t) (s `` t) `ƒ ` r == (s `ƒ` r) `` (t `ƒ` r) ‘laopRelation Kernel ‘ r == ‹ r `ƒ` r ‘ r == ’ (‹ r) ’laopRelation Image ’ r == r `ƒ ` conv r ’ r == ‘ (‹ r) “laop#Function division. Special case of †.NOTE: _This is only valid_ if f and g are ˜s, i.e. ” and –. “ f g == ‹ g `ƒ` f”laopA k r is ” Ž Ÿ (’ r)•laopA k r is • Ž Ÿ (‘ r)–laopA k r is – Ž ž (‘ r)—laopA k r is — Ž ž (’ r)˜laopA k r is a ˜ Ž ” r && – rA ˜ f( enjoys the following properties, where r and s are binary relations: f `ƒ` r `Œ ` s == r `Œ` f `ƒ` s r `ƒ` f `Œ ` s == r `Œ` s `ƒ` f ™laopA k r is a ™ Ž • r && – ršlaopA k r is an š Ž — r && ” r›laopA k r is a › Ž ˜ r && š rœlaopA k r is a œ Ž ˜ r && ™ rlaopA k r is an  Ž œ r && › ržlaopA k r is ž Ž ‚ `Œ` rŸlaopA k r is Ÿ Ž r `Œ` ‚ laopA k r is   Ž (r `ƒ` r) `Œ` r¡laopA k r is ¡ Ž r == ‹ r¢laopA k r is anti-symmetric Ž (r `` ‹ r) `Œ` ‚£laopA k r is £ Ž (r `` ‚) == ~¤laopA k r is ¤ Ž (r `` ‹ r) == ¥laopA k r is a ¥ Ž ž r &&   r¦laopA k r is a partial-order Ž ¢ r && ¥ r§laopA k r is a linear-order Ž ¤ r && ¦ r¨laopA k r is an ¨ Ž ¡ r && ¥ r©laopA k r is a partial-equivalence Ž ¦ r && ¨ rªlaopA k r is ª or regular wherever r `ƒ` ‹ r `ƒ` r == r«laopRelational pairing.DNOTE: That this is not a true categorical product, see for instance:  | ¬ `ƒ` « a b `Œ` a « a b  = | | ­ `ƒ` « a b `Œ` b Emphasis on the Œ. « r s `ƒ` f == « (r `ƒ ` f) (s `ƒ` f) (R ® S) `ƒ` « p q == « (r `ƒ ` p) (s `ƒ` q) ‹ (« r s) `ƒ` « x y == (‹ r `ƒ` x) `` (‹ s `ƒ` y) ¯ (« r s) (« t v) == « (¯ r t) (¯ s v) ¬laop-Relational pairing first component projection ¬ `ƒ` « r s `Œ` r ­laop.Relational pairing second component projection ­ `ƒ` « r s `Œ` s ®laopRelational pairing functor r ® s == « (r `ƒ ` p1) (s `ƒ ` p2) (r ® s) `ƒ` (p ® q) == (r `ƒ` p) ® (s `ƒ` q) ¯laopRelational coproduct.  | ¯ a b `ƒ` ° == a ¯ a b  = | | ¯ a b `ƒ` ± == b  ¯ r s `ƒ` ‹ (¯ t u) == (r `ƒ` ‹ t) `` (s `ƒ` ‹ u) ¯ (« r s) (« t v) == « (¯ r t) (¯ s v) °laop.Relational coproduct first component injection ’ ° `` ’ ± == ‚ ° `ƒ` ± = ~ ±laop/Relational coproduct second component injection ’ ° `` ’ ± == ‚ ° `ƒ` ± = ~ ²laopRelational coproduct functor. r ² s == ¯ (° `ƒ` r) (± `ƒ` s) ³laop Relational ³DEvery n-ary relation can be expressed as a binary relation through 'trans'/'untrans'U; more-over, where each particular attribute is placed (input/output) is irrelevant.´laop Relational ´DEvery n-ary relation can be expressed as a binary relation through 'trans'/'untrans'U; more-over, where each particular attribute is placed (input/output) is irrelevant.µlaopTransforms predicate p into a correflexive relation. µ (_ True) == ‚ µ (_ False) == ~ µ q `ƒ` µ p == µ q `` µ p ¶laopEqualizes functions f and g . That is, ¶ f g, is the largest coreflexive that restricts g so that f and g yield the same outputs. ¶ r r == ‚ ¶ ( True) ( False) == ~ ·laopRelational conditional guard. · p = ± `ˆ` ° `ƒ` µ p ¸laop"Relational McCarthy's conditional.¹laopRelational domain.For injective relations, ¹ and ‘nel coincide, since ‘ r `Œ` ‚ in such situations.ºlaopRelational range.For functions, º and ’ (image) coincide, since ’ f `Œ` ‚ for any f.»laopRelation pretty printing¼laopRelation pretty printing¾laop#It isn't possible to implement the `% function so it's implementation is \ . However ƒZ can be and this partial class implementation exists just to make the code more readable. Please use ‚ instead.`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼bklmjihgfedcbanopqrstvwxyz{|}u~€‹ŒŽ‘’•–”—™˜šœ›¹º“„…†‡ˆ«¬­®¯°±²³´žŸ ¡¢£¤¥¦§¨©ª¶µ·¸‚ƒvw‰Š»¼q3s2®4²5(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNoneâŽ`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼bklmjihgfedcbanopqrstvwxyz{|}u~€‹ŒŽ‘’•–”—™˜šœ›¹º“„…†‡ˆ«¬­®¯°±²³´žŸ ¡¢£¤¥¦§¨©ª¶µ·¸‚ƒvw‰Š»¼(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',.;<=>?@AHSUVXk0ÄlaopOne type aliasÅlaopZero type aliasÎlaopDConstraint type synonyms to keep the type signatures less convolutedÑlaopEmpty matrix constructorÒlaopUnit matrix constructorÓlaopMatrix Junc constructorÔlaopMatrix Junc constructorÕlaopMatrix Split constructorÖlaopMatrix Split constructor×laop$Functor instance equivalent functionØlaop Applicative instance equivalent unit function,Ùlaop Applicative instance equivalent unit function,ÚlaopMonad instance equivalent a function,Ûlaop+Monad instance equivalent '(>>=)' function,ÜlaopiBuild a matrix out of a list of list of elements. Throws a runtime error if the dimensions do not match.ÝlaopTMatrix builder function. Constructs a matrix provided with a construction function.Þlaop!Constructs a column vector matrixßlaopConstructs a row vector matrixàlaop6Lifts functions to matrices with arbitrary dimensions.ONOTE: Be careful to not ask for a matrix bigger than the cardinality of types a or b allows.álaop5Lifts functions to matrices with dimensions matching a and b cardinality's.âlaop*Lifts relation functions to Boolean Matrixãlaop1Converts a matrix to a list of lists of elements.älaop(Converts a matrix to a list of elements.ålaop3The zero matrix. A matrix wholly filled with zeros.ælaop2The ones matrix. A matrix wholly filled with ones.Also known as T (Top) matrix.çlaopLThe constant matrix constructor. A matrix wholly filled with a given value.èlaopThe T (Top) row vector matrix.élaopIdentity matrixêlaop?Matrix composition. Equivalent to matrix-matrix multiplication.QThis definition takes advantage of divide-and-conquer and fusion laws from LAoP.ëlaop$Biproduct first component projectionìlaop%Biproduct second component projectionílaop#Biproduct first component injectionîlaop$Biproduct second component injectionïlaopObtain the number of rows. NOTE: The ZI constaint is needed in order to obtain the dimensions in constant time.TODO: A ï! function that does not need the Z) constraint in exchange for performance.ðlaopObtain the number of columns. NOTE: The ZI constaint is needed in order to obtain the dimensions in constant time.TODO: A ð! function that does not need the Z) constraint in exchange for performance.ñlaop9Matrix coproduct functor also known as matrix direct sum.òlaop5Khatri Rao product first component projection matrix.ólaop6Khatri Rao product second component projection matrix.ôlaop7Khatri Rao Matrix product also known as matrix pairing.DNOTE: That this is not a true categorical product, see for instance:  | kp1 ê8 khatri a b == a khatri a b ==> | | kp2 ê khatri a b == b Emphasis on the implication symbol.õlaop6Matrix product functor also known as kronecker productölaopMatrix "abiding" followin the 'Junc'-'Split' abide law.Law: Junc (Split a c) (Split b d) == Split (Junc a b) (Junc c d) ÷laopMatrix "abiding" followin the 'Split'-'Junc' abide law.Law: Split (Junc a b) (Junc c d) == Junc (Split a c) (Split b d) ølaopMatrix transposition.ùlaopSelective functors selectQ operator equivalent inspired by the ArrowMonad solution presented in the paper.úlaop6McCarthy's Conditional expresses probabilistic choice.ûlaopMatrix pretty printerülaopMatrix pretty printerýlaop#It isn't possible to implement the `% function so it's implementation is \ . However êZ can be and this partial class implementation exists just to make the code more readable. Please use é instead.=ÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûü=ÏÐÎÍÌËÊÉÈÇÆÅÄÑÒÓÕÜãäÝßÞåæèçרÙùÚÛðïøúö÷ÖëìÔíîñõòóôéêàáâûüÔ3Ö2ñ5õ4(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',.;<=>?@AHSUVXk) laopDConstraint type synonyms to keep the type signatures less convoluted)laopCoproduct Bifunctor*laop"Khatri Rao Product and projections-laopProduct Bifunctor (Kronecker).laopMatrix abide Junc Split/laopMatrix abide Split Junc0laopMatrix transposition5laop#It isn't possible to implement the `% function so it's implementation is \ . However "Z can be and this partial class implementation exists just to make the code more readable. Please use ! instead.6      !"#$%&'()*+,-./012346      ('012./#$%&)-*+,!"3432)5-4None &',.>HSXk9dAlaopDConstraint type synonyms to keep the type signatures less convolutedBlaopUType synonym for column vector matrices. This represents a probability distribution.Dlaop"Type synonym for probability valueElaopFunctor instanceFlaopApplicative/Monoidal instance unit functionGlaopApplicative/Monoidal instance mult functionHlaopSelective instance functionIlaopMonad instance a functionJlaopMonad instance '(>>=)' functionKlaop%Extract probabilities given an Event.Llaop#Constructs a Bernoulli distributionMlaop-Creates a distribution given a shape functionNlaop Constructs a Linear distributionOlaop"Constructs an Uniform distributionPlaop/Constructs an Negative Exponential distributionQlaop!Constructs an Normal distributionRlaop Transforms a B into a list of pairs.SlaopPretty a distributionTlaopPretty Print a distribution;<=>?@ABCDEFGHIJKLMNOPQRSTBCDA@?>=<;EFGHIJKLMNOPQRST (c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone;q;<=>?@ABCDEFGHIJLMNOPQRSTBCDA@?>=<;EFGHIJLMNOPQRST Safe?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx-./012$y67^89Rz{:;=|>?YZ[}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡@AJ¢BCF£¤¥¦§O¨©PQª«¬­®¯°*±mnopqrstu(²-./012³´µ¶·$34567^89:;<=>?@ABCDEFGHIJKLM¸OPQck`a_bmnp¹qrºstu(²-./012$3456789:;<=>?@ABCDEFGHIJKLMNOPQ»k`a_bnmpqrsu¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÏÐÒÓÔÕuÏÖ×ÏØÙÏÚÛÏÜÝÞÓÔßÏàáÏàâÏàã ä å æ ç è é ê ëìlaop-0.1.0.2-inplaceLAoP.Utils.InternalLAoP.Matrix.InternalLAoP.Relation.InternalLAoP.Matrix.TypeLAoP.Matrix.NatLAoP.Dist.Internal LAoP.Utils LAoP.Relation LAoP.Dist Paths_laopListLNaturalNatnat coerceNat coerceNat2 coerceNat3 $fEnumEither$fBoundedEither $fEnum(,) $fEnumNatural$fBoundedNatural $fNumNatural $fEnumList $fBoundedList $fShowNatural $fReadNatural $fEqNatural $fOrdNatural$fNFDataNatural$fEqList $fShowList $fReadList FromLists fromLists NormalizeFromNatCountMatrixEmptyOneJuncSplitemptyonejunc|||split=== matrixBuildercolrowfromFfromF'toListstoListzerosonesconstantbangidentitycompp1p2i1i2rowscolumns-|-kp1kp2khatri><abideJSabideSJtrselectcondpretty prettyPrinttoBoolfromBoolnegateMorMandMsubMcompReldivRdivLdivSfromFRel fromFRel'toRel $fOrdMatrix $fNumMatrix $fEqMatrix$fNFDataMatrix$fCategoryTYPEMatrix$fFromListseEitherEither$fFromListse()Either$fFromListse()Either0$fFromListseEither()$fFromListseEither()0$fFromListse()()$fFromListseVoidVoid $fShowMatrix TrivialP2TrivialPTrivialETrivialLiftable FromListsNCountableDimensionsN CountableNCountableDimensions CountableRelationRBooleanrelationBuilderptbelongspointshrunkBy overriddenBypointAp pointApBoolconvsseimpliesiff intersectionunionkerimg divisionFsimple injectiveentire surjectivefunctionrepresentation abstraction surjection injection bijection reflexive coreflexive transitive symmetric antiSymmetric irreflexive connectedpreorder partialOrder linearOrder equivalencepartialEquivalence difunctionalsplitReitherRtransuntranspredR equalizerguarddomainrange $fNumRelation$fCategoryTYPERelation$fShowRelation $fEqRelation $fOrdRelation$fNFDataRelation$fReadRelationZeroMfmapMunitMmultMreturnMbindMselectM FromListsNz CountableNz$fCategoryNatMatrixDistDProbfmapDunitDmultDselectDreturnDbindD??chooseshapelinearuniformnegExpnormaltoValues prettyDistprettyPrintDistbaseGHC.EnumEnumBoundedghc-prim GHC.TypesInt GHC.GenericsGeneric GHC.TypeNatsKnownNatControl.CategoryCategoryGHC.Err undefinedfromRelBoolGHC.Baseconstidreturnversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName