@@ -64,7 +64,6 @@ module LAoP.Matrix.Type
64 FromListsN,
64 FromListsN,
70 -- * Type aliases
69 -- * Type aliases
@@ -93,6 +92,7 @@ module LAoP.Matrix.Type
98 -- * Functor instance equivalent function
98 -- * Functor instance equivalent function
@@ -189,8 +189,9 @@ type CountableN a = KnownNat (I.Count (I.Normalize a))
189type CountableDimensionsN a b = (CountableN a, CountableN b)
189type CountableDimensionsN a b = (CountableN a, CountableN b)
190type FromListsN e a b = I.FromLists e (I.Normalize a) (I.Normalize b)
190type FromListsN e a b = I.FromLists e (I.Normalize a) (I.Normalize b)
191type Liftable e a b = (Bounded a, Bounded b, Enum a, Enum b, Eq b, Num e, Ord e)
191type Liftable e a b = (Bounded a, Bounded b, Enum a, Enum b, Eq b, Num e, Ord e)
192−type Trivial a = I.Normalize a ~ I.Normalize (I.Normalize a)
192+type Trivial a = I.Normalize (I.Normalize a) ~ I.Normalize (I.Normalize (I.Normalize a))
193−type TrivialE a b = I.Normalize (Either a b) ~ Either (I.Normalize a) (I.Normalize b)
193+type Trivial2 a = I.Normalize a ~ I.Normalize (I.Normalize a)
194+type Trivial3 a = I.FromNat (I.Count (I.Normalize (I.Normalize a))) ~ I.Normalize (I.Normalize a)
194type TrivialP a b = I.Normalize (a, b) ~ I.Normalize (I.Normalize a, I.Normalize b)
195type TrivialP a b = I.Normalize (a, b) ~ I.Normalize (I.Normalize a, I.Normalize b)
196-- | It isn't possible to implement the 'id' function so it's
197-- | It isn't possible to implement the 'id' function so it's
@@ -220,7 +221,6 @@ one = M . I.One
221-- | Matrix 'Junc' constructor
222-- | Matrix 'Junc' constructor
224 Matrix e a rows ->
224 Matrix e a rows ->
225 Matrix e b rows ->
225 Matrix e b rows ->
226 Matrix e (Either a b) rows
226 Matrix e (Either a b) rows
@@ -229,7 +229,6 @@ junc (M a) (M b) = M (I.Junc a b)
229infixl 3 |||
229infixl 3 |||
230-- | Matrix 'Junc' constructor
230-- | Matrix 'Junc' constructor
233 Matrix e a rows ->
232 Matrix e a rows ->
234 Matrix e b rows ->
233 Matrix e b rows ->
235 Matrix e (Either a b) rows
234 Matrix e (Either a b) rows
@@ -237,7 +236,6 @@ infixl 3 |||
238-- | Matrix 'Split' constructor
237-- | Matrix 'Split' constructor
241 Matrix e cols a ->
239 Matrix e cols a ->
242 Matrix e cols b ->
240 Matrix e cols b ->
243 Matrix e cols (Either a b)
241 Matrix e cols (Either a b)
@@ -246,7 +244,6 @@ split (M a) (M b) = M (I.Split a b)
246infixl 2 ===
244infixl 2 ===
247-- | Matrix 'Split' constructor
245-- | Matrix 'Split' constructor
250 Matrix e cols a ->
247 Matrix e cols a ->
251 Matrix e cols b ->
248 Matrix e cols b ->
252 Matrix e cols (Either a b)
249 Matrix e cols (Either a b)
@@ -396,6 +393,18 @@ bang ::
396 Matrix e cols One
393 Matrix e cols One
397bang = M I.bang
394bang = M I.bang
396+-- | Point constant relation
405+ ) => a -> Matrix e One a
406+point = fromF' . const
399-- Identity Matrix
408-- Identity Matrix
401-- | Identity matrix
410-- | Identity matrix
@@ -418,8 +427,7 @@ p1 ::
419 CountableDimensionsN n m,
428 CountableDimensionsN n m,
420 FromListsN e n m,
429 FromListsN e n m,
421− FromListsN e m m,
430+ FromListsN e m m
424 Matrix e (Either m n) m
432 Matrix e (Either m n) m
425p1 = M I.p1
433p1 = M I.p1
@@ -429,8 +437,7 @@ p2 ::
430 CountableDimensionsN n m,
438 CountableDimensionsN n m,
431 FromListsN e m n,
439 FromListsN e m n,
432− FromListsN e n n,
440+ FromListsN e n n
435 Matrix e (Either m n) n
442 Matrix e (Either m n) n
436p2 = M I.p2
443p2 = M I.p2
@@ -442,8 +449,7 @@ i1 ::
443 CountableDimensionsN n m,
450 CountableDimensionsN n m,
444 FromListsN e n m,
451 FromListsN e n m,
445− FromListsN e m m,
452+ FromListsN e m m
448 Matrix e m (Either m n)
454 Matrix e m (Either m n)
449i1 = tr p1
455i1 = tr p1
@@ -453,8 +459,7 @@ i2 ::
454 CountableDimensionsN n m,
460 CountableDimensionsN n m,
455 FromListsN e m n,
461 FromListsN e m n,
456− FromListsN e n n,
462+ FromListsN e n n
459 Matrix e n (Either m n)
464 Matrix e n (Either m n)
460i2 = tr p2
465i2 = tr p2
@@ -492,9 +497,7 @@ infixl 5 -|-
492 FromListsN e k k,
497 FromListsN e k k,
493 FromListsN e j k,
498 FromListsN e j k,
494 FromListsN e k j,
499 FromListsN e k j,
495− FromListsN e j j,
500+ FromListsN e j j
499 Matrix e n k ->
502 Matrix e n k ->
500 Matrix e m j ->
503 Matrix e m j ->
@@ -610,8 +613,7 @@ tr (M m) = M (I.tr m)
610selectM ::
613selectM ::
612 FromListsN e b b,
615 FromListsN e b b,
613− CountableN b,
616+ CountableN b
615 ) => Matrix e cols (Either a b) -> Matrix e a b -> Matrix e cols b
617 ) => Matrix e cols (Either a b) -> Matrix e a b -> Matrix e cols b
616selectM (M m) (M y) = M (I.select m y)
618selectM (M m) (M y) = M (I.select m y)
@@ -620,6 +622,8 @@ selectM (M m) (M y) = M (I.select m y)
620-- | McCarthy's Conditional expresses probabilistic choice.
622-- | McCarthy's Conditional expresses probabilistic choice.
622 ( Trivial a,
624 ( Trivial a,
623 CountableN a,
627 CountableN a,
624 FromListsN e () a,
628 FromListsN e () a,
625 FromListsN e a (),
629 FromListsN e a (),