!F4      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None.=?HMXk#laopPowerset data type.WThis data type is a newtype wrapper around '[]'. This exists in order to implement an  and 1 instance that cannot be harmful for the outside.laopWrapper around @s that have a restrictive semantic associated. A value of type  n m$ can only be instanciated with some  i that's  n <= i <= m.laop<Natural constructor function. Throws a runtime error if the * value is greater than the corresponding m or lower than n in the  n m type.laop(Auxiliary function that promotes binary  functions to  binary functions.laop2Auxiliary function that promotes ternary (binary)  functions to  functions.laop2Auxiliary function that promotes ternary (binary)  functions to  functions.laop Optimized = 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(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',./1=>?@AHUVXkb: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.laopDConstraint type synonyms to keep the type signatures less convolutedlaopIType family that normalizes the representation of a given data structure laopHType 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  instance.laopALAoP (Linear Algebra of Programming) Inductive Matrix definition.laopEmpty matrix constructorlaopUnit matrix constructorlaopMatrix  constructorlaopMatrix  constructorlaopMatrix  constructorlaopMatrix  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.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 projectionlaop%Biproduct second component projectionlaop#Biproduct first component injectionlaop$Biproduct second component injectionlaopObtain the number of rows. NOTE: The I constaint is needed in order to obtain the dimensions in constant time.TODO: A ! function that does not need the ) constraint in exchange for performance.laopObtain the number of columns. NOTE: The I constaint is needed in order to obtain the dimensions in constant time.TODO: A ! function that does not need the ) 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) #laopMatrix "abiding" followin the 'Split'-'Junc' abide law.  ( a b) ( c d) ==  ( a c) ( b d) $laopMatrix transposition.%laopSelective functors %Q operator equivalent inspired by the ArrowMonad solution presented in the paper.&laop6McCarthy's Conditional expresses probabilistic choice.'laopMatrix pretty printer(laopMatrix pretty printer)laopHelper conversion function*laopHelper conversion function+laopRelational negation,laopRelational addition-laopRelational multiplication.laopRelational subtraction/laopMatrix relational composition.0laop Matrix relational right division1laopMatrix relational left division2laop$Matrix relational symmetric division3laop7Lifts 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.4laop6Lifts functions to relations with dimensions matching a and b cardinality's.5laop-Lifts a relation function to a Boolean Matrix6laop#It isn't possible to implement the 7% function so it's implementation is 8 . However Z can be and this partial class implementation exists just to make the code more readable. Please use  instead.< 9:      !"#$%&'()*+,-./012345325!4(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone &',.1;<>Xk%TlaopDConstraint type synonyms to keep the type signatures less convolutedlaopRelation data type.laop6Boolean type synonym for working with boolean matriceslaopEmpty matrix constructorlaopUnit matrix constructorlaopBoolean Matrix Junc1 constructor, also known as relational coproduct.See Y.laopBoolean Matrix Junc constructorSee Y.laopBoolean Matrix Split/ constructor, also known as relational product.laopBoolean Matrix Split constructorlaopiBuild 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. 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."laopLifts relation functions to ;laop Lowers a  to a function#laop1Converts a matrix to a list of lists of elements.$laop(Converts a matrix to a list of elements.%laopConverts a well typed  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 == " " `6 ` R && R `6` 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.  " `6 ` R && R `6` 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 == 5 (. (5 x) (5 y) 0laopRelational symmetric division3 c b (0 s r) means that b and c. are related to exactly the same outputs by r and by s.1laopRelational shrinking.r `1` 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.2laopRelational overriding.r `2` s2 yields the relation which contains the whole of s and that part of r where s is undefined. ( `2 ` s == s r `2` ( == r r `2` r == r 3laopRelational application.If a and b are related by  r then 3 a b r ==  ( 1)4laopRelational application The same as 3 but converts  to <5laopRelational converse Given binary  r, writing 3 a b r (read: b is related to a by r ) means the same as 3 b a (5 r), where 5 r! is said to be the converse of r. In terms of grammar, 5 r! corresponds to the passive voice6laop&Relational inclusion (subset or equal)7laop$Relational implication (the same as 6)8laopRelational bi-implication9laopRelational intersectionLifts pointwise conjunction. (r `9` s) `9 ` t == r `9` (s `9` t) x `6` r `9 ` s == x `9 ` r && x `9` s :laopRelational unionLifts pointwise disjunction. (r `:` s) `: ` t == r `: (s `:` t) r `:` s `6 ` x == r `6 ` x && s `6` x r `-` (s `: ` t) == (r `-` s) `:` (r `- ` t) (s `:` t) `- ` r == (s `-` r) `:` (t `-` r) ;laopRelation Kernel ; r == 5 r `-` r ; r == < (5 r) <laopRelation Image < r == r `- ` conv r < r == ; (5 r) =laop#Function division. Special case of 0.NOTE: _This is only valid_ if f and g are Bs, i.e. > and @. = f g == 5 g `-` f>laopA  r is > 8 I (< r)?laopA  r is ? 8 I (; r)@laopA  r is @ 8 H (; r)AlaopA  r is A 8 H (< r)BlaopA  r is a B 8 > r && @ rA B f( enjoys the following properties, where r and s are binary relations: f `-` r `6 ` s == r `6` f `-` s r `-` f `6 ` s == r `6` s `-` f ClaopA  r is a C 8 ? r && @ rDlaopA  r is an D 8 A r && > rElaopA  r is a E 8 B r && D rFlaopA  r is a F 8 B r && C rGlaopA  r is an G 8 F r && E rHlaopA  r is H 8 , `6` rIlaopA  r is I 8 r `6` ,JlaopA  r is J 8 (r `-` r) `6` rKlaopA  r is K 8 r == 5 rLlaopA  r is anti-symmetric 8 (r `9` 5 r) `6` ,MlaopA  r is M 8 (r `9` ,) == (NlaopA  r is N 8 (r `:` 5 r) == )OlaopA  r is a O 8 H r && J rPlaopA  r is a partial-order 8 L r && O rQlaopA  r is a linear-order 8 N r && P rRlaopA  r is an R 8 K r && O rSlaopA  r is a partial-equivalence 8 P r && R rTlaopA  r is T or regular wherever r `-` 5 r `-` r == rUlaopRelational pairing.DNOTE: That this is not a true categorical product, see for instance:  | V `-` U a b `6` a U a b  = | | W `-` U a b `6` b Emphasis on the 6. U r s `-` f == U (r `- ` f) (s `-` f) (R X S) `-` U p q == U (r `- ` p) (s `-` q) 5 (U r s) `-` U x y == (5 r `-` x) `9` (5 s `-` y) Y (U r s) (U t v) == U (Y r t) (Y s v) Vlaop-Relational pairing first component projection V `-` U r s `6` r Wlaop.Relational pairing second component projection W `-` U r s `6` s XlaopRelational pairing functor r X s == U (r `- ` p1) (s `- ` p2) (r X s) `-` (p X q) == (r `-` p) X (s `-` q) YlaopRelational coproduct.  | Y a b `-` Z == a Y a b  = | | Y a b `-` [ == b  Y r s `-` 5 (Y t u) == (r `-` 5 t) `:` (s `-` 5 u) Y (U r s) (U t v) == U (Y r t) (Y s v) Zlaop.Relational coproduct first component injection < Z `:` < [ == , Z `-` [ = ( [laop/Relational coproduct second component injection < Z `:` < [ == , Z `-` [ = ( \laopRelational coproduct functor. r \ s == Y (Z `-` 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) == ( alaopRelational conditional guard. a p = [ `2` Z `-` _ p blaop"Relational McCarthy's conditional.claopRelational domain.For injective relations, c and ;nel coincide, since ; r `6` , in such situations.dlaopRelational range.For functions, d and < (image) coincide, since < f `6` , for any f.elaopRelation pretty printingflaopRelation pretty printing>laop#It isn't possible to implement the ?% function so it's implementation is 8 . However -Z can be and this partial class implementation exists just to make the code more readable. Please use , instead.`  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef32X4\5(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone/`  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefb   !"#$%&'()*+59:678;<?@>ACBDFEGcd=./012UVWXYZ[\]^HIJKLMNOPQRST`_ab,- !34ef(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',.;<=>?@AHSUVXk0glaopOne type aliashlaopZero type aliasqlaopDConstraint type synonyms to keep the type signatures less convolutedtlaopEmpty matrix constructorulaopUnit matrix constructorvlaopMatrix Junc constructorwlaopMatrix Junc constructorxlaopMatrix Split constructorylaopMatrix Split constructorzlaop$Functor instance equivalent function{laop Applicative instance equivalent unit function,|laop Applicative instance equivalent unit function,}laopMonad instance equivalent @ 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 matrixlaopConstructs a row vector matrixlaop6Lifts 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 Matrixlaop1Converts 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 matrixlaop?Matrix composition. Equivalent to matrix-matrix multiplication.QThis definition takes advantage of divide-and-conquer and fusion laws from LAoP.laop$Biproduct first component projectionlaop%Biproduct second component projectionlaop#Biproduct first component injectionlaop$Biproduct second component injectionlaopObtain the number of rows. NOTE: The I constaint is needed in order to obtain the dimensions in constant time.TODO: A ! function that does not need the ) constraint in exchange for performance.laopObtain the number of columns. NOTE: The I constaint is needed in order to obtain the dimensions in constant time.TODO: A ! function that does not need the ) 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 productlaopMatrix "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 printerlaopMatrix pretty printerlaop#It isn't possible to implement the ?% function so it's implementation is 8 . However Z can be and this partial class implementation exists just to make the code more readable. Please use  instead.= ghijklmnopqrstuvwxyz{|}~=rsqponmlkjihgtuvx z{|}~yww3y254(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone&',.;<=>?@AHSUVXk"1laopDConstraint type synonyms to keep the type signatures less convolutedlaopCoproduct Bifunctorlaop"Khatri Rao Product and projectionslaopProduct Bifunctor (Kronecker)laopMatrix abide Junc SplitlaopMatrix abide Split JunclaopMatrix transpositionlaop#It isn't possible to implement the ?% function so it's implementation is 8 . However Z can be and this partial class implementation exists just to make the code more readable. Please use  instead.6 6 3254 None &',.>HSXk2laopDConstraint type synonyms to keep the type signatures less convolutedlaopUType synonym for column vector matrices. This represents a probability distribution.laop"Type synonym for probability valuelaopFunctor instancelaopApplicative/Monoidal instance unit functionlaopApplicative/Monoidal instance mult functionlaopSelective instance functionlaopMonad instance @ functionlaopMonad instance '(>>=)' functionAlaop%Extract probabilities given an Event.laop#Constructs a Bernoulli distributionlaop-Creates a distribution given a shape functionlaop Constructs a Linear distributionlaop"Constructs an Uniform distributionlaop/Constructs an Negative Exponential distributionlaop!Constructs an Normal distributionlaop Transforms a  into a list of pairs.laopPretty a distributionlaopPretty Print a distributionA(c) Armando Santos 2019-2020armandoifsantos@gmail.com experimentalNone3 Safe4BCDEFGHIJ    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu#$%&'(vwxyz){|}+,-./34~578abefgcmpqtu#$%&'(){|}+,./34~578abefgcmpq           )t#$%&'({|}+,./34~578abefgcmpq09:;-r laop-0.1.0.0-inplace LAoP.Utils LAoP.RelationLAoP.Matrix.TypeLAoP.Matrix.Nat LAoP.DistLAoP.Utils.InternalLAoP.Matrix.InternalLAoP.Relation.InternalLAoP.Dist.Internal Paths_laopPowersetPSNaturalnat coerceNat coerceNat2 coerceNat3 FromLists NormalizeFromNatCount TrivialP2TrivialPTrivialETrivialLiftable FromListsNCountableDimensionsN CountableNCountableDimensions CountableRelationRBooleanemptyonejunc|||split=== fromListsrelationBuilderfromFfromF'toReltoListstoListtoBoolptbelongszerosonesbangpointidentitycompdivRdivLdivSshrunkBy overriddenBypointAp pointApBoolconvsseimpliesiff intersectionunionkerimg divisionFsimple injectiveentire surjectivefunctionrepresentation abstraction surjection injection bijection reflexive coreflexive transitive symmetric antiSymmetric irreflexive connectedpreorder partialOrder linearOrder equivalencepartialEquivalence difunctionalsplitRp1p2><eitherRi1i2-|-transuntranspredR equalizerguardconddomainrangepretty prettyPrintOneZeroMatrixMfmapMunitMmultMreturnMbindM matrixBuildercolrowconstantrowscolumnskp1kp2khatriabideJSabideSJtrselectM$fCategoryTYPEMatrix $fShowMatrix $fNumMatrix $fEqMatrix $fOrdMatrix$fNFDataMatrix FromListsNz CountableNzselect$fCategoryNatMatrixDistDProbfmapDunitDmultDselectDreturnDbindDchooseshapelinearuniformnegExpnormaltoValues prettyDistprettyPrintDistbaseGHC.EnumEnumBoundedghc-prim GHC.TypesInt $fEnum(,) $fNumNaturalNat GHC.GenericsGenericJuncSplit GHC.TypeNatsKnownNatfromBoolnegateMorMandMsubMcompRelfromFRel fromFRel'Control.CategoryCategoryGHC.Err undefinedEmptyfromRelBoolGHC.Baseconst$fCategoryTYPERelationidreturn??version getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName