@@ -226,8 +226,8 @@ instance {-# OVERLAPPING #-} FromLists e () () where
226 fromLists _ = error "Wrong dimensions"
226 fromLists _ = error "Wrong dimensions"
228instance (FromLists e cols ()) => FromLists e (Either () cols) () where
228instance (FromLists e cols ()) => FromLists e (Either () cols) () where
229− fromLists [(h : t)] = Junc (One h) (fromLists [t])
229+ fromLists [h : t] = Junc (One h) (fromLists [t])
230− fromLists _ = error "Wrong dimensions"
230+ fromLists _ = error "Wrong dimensions"
232instance (FromLists e () rows) => FromLists e () (Either () rows) where
232instance (FromLists e () rows) => FromLists e () (Either () rows) where
233 fromLists ([h] : t) = Split (One h) (fromLists t)
233 fromLists ([h] : t) = Split (One h) (fromLists t)
@@ -296,7 +296,7 @@ fromF f =
296 buildList l r = take r l : buildList (drop r l) r
296 buildList l r = take r l : buildList (drop r l) r
299− forall a b cols rows e.
299+ forall a b e.
300 ( Bounded a,
300 ( Bounded a,
301 Bounded b,
301 Bounded b,
@@ -492,7 +492,7 @@ infixl 4 ><
492abideJS :: Matrix e cols rows -> Matrix e cols rows
492abideJS :: Matrix e cols rows -> Matrix e cols rows
493abideJS (Junc (Split a c) (Split b d)) = Split (Junc (abideJS a) (abideJS b)) (Junc (abideJS c) (abideJS d)) -- Junc-Split abide law
493abideJS (Junc (Split a c) (Split b d)) = Split (Junc (abideJS a) (abideJS b)) (Junc (abideJS c) (abideJS d)) -- Junc-Split abide law
494abideJS Empty = Empty
494abideJS Empty = Empty
495−abideJS (One e) = (One e)
495+abideJS (One e) = One e
496abideJS (Junc a b) = Junc (abideJS a) (abideJS b)
496abideJS (Junc a b) = Junc (abideJS a) (abideJS b)
497abideJS (Split a b) = Split (abideJS a) (abideJS b)
497abideJS (Split a b) = Split (abideJS a) (abideJS b)
@@ -501,7 +501,7 @@ abideJS (Split a b) = Split (abideJS a) (abideJS b)
501abideSJ :: Matrix e cols rows -> Matrix e cols rows
501abideSJ :: Matrix e cols rows -> Matrix e cols rows
502abideSJ (Split (Junc a b) (Junc c d)) = Junc (Split (abideSJ a) (abideSJ c)) (Split (abideSJ b) (abideSJ d)) -- Split-Junc abide law
502abideSJ (Split (Junc a b) (Junc c d)) = Junc (Split (abideSJ a) (abideSJ c)) (Split (abideSJ b) (abideSJ d)) -- Split-Junc abide law
503abideSJ Empty = Empty
503abideSJ Empty = Empty
504−abideSJ (One e) = (One e)
504+abideSJ (One e) = One e
505abideSJ (Junc a b) = Junc (abideSJ a) (abideSJ b)
505abideSJ (Junc a b) = Junc (abideSJ a) (abideSJ b)
506abideSJ (Split a b) = Split (abideSJ a) (abideSJ b)
506abideSJ (Split a b) = Split (abideSJ a) (abideSJ b)
@@ -515,20 +515,13 @@ tr (Split a b) = Junc (tr a) (tr b)
516-- Selective 'select' operator
516-- Selective 'select' operator
518−select ::
518+select :: (Bounded a1, Bounded b, Enum a1, Enum b, Num e, Ord e,
525− KnownNat (Count a2),
526− KnownNat (Count rows),
519+ KnownNat (Count a2), KnownNat (Count rows), FromLists e rows a2,
527− FromLists e rows a2,
528− FromLists e rows rows,
520+ FromLists e rows rows, Eq b) =>
530− ) => Matrix e cols (Either a2 rows) -> (a1 -> b) -> Matrix e cols rows
521+ Matrix e cols (Either a2 rows) -> (a1 -> b) -> Matrix e cols rows
531−select m y = (junc (fromF y) identity) `comp` m
524+ in junc f identity `comp` m
533-- McCarthy's Conditional
526-- McCarthy's Conditional