@@ -226,8 +226,8 @@ instance {-# OVERLAPPING #-} FromLists e () () where
226226 fromLists _ = error "Wrong dimensions"
227227
228228instance (FromLists e cols ()) => FromLists e (Either () cols) () where
229− fromLists [(h : t)] = Junc (One h) (fromLists [t])
230− fromLists _ = error "Wrong dimensions"
229+ fromLists [h : t] = Junc (One h) (fromLists [t])
230+ fromLists _ = error "Wrong dimensions"
231231
232232instance (FromLists e () rows) => FromLists e () (Either () rows) where
233233 fromLists ([h] : t) = Split (One h) (fromLists t)
@@ -296,7 +296,7 @@ fromF f =
296296 buildList l r = take r l : buildList (drop r l) r
297297
298298fromF' ::
299− forall a b cols rows e.
299+ forall a b e.
300300 ( Bounded a,
301301 Bounded b,
302302 Enum a,
@@ -492,7 +492,7 @@ infixl 4 ><
492492abideJS :: Matrix e cols rows -> Matrix e cols rows
493493abideJS (Junc (Split a c) (Split b d)) = Split (Junc (abideJS a) (abideJS b)) (Junc (abideJS c) (abideJS d)) -- Junc-Split abide law
494494abideJS Empty = Empty
495−abideJS (One e) = (One e)
495+abideJS (One e) = One e
496496abideJS (Junc a b) = Junc (abideJS a) (abideJS b)
497497abideJS (Split a b) = Split (abideJS a) (abideJS b)
498498
@@ -501,7 +501,7 @@ abideJS (Split a b) = Split (abideJS a) (abideJS b)
501501abideSJ :: Matrix e cols rows -> Matrix e cols rows
502502abideSJ (Split (Junc a b) (Junc c d)) = Junc (Split (abideSJ a) (abideSJ c)) (Split (abideSJ b) (abideSJ d)) -- Split-Junc abide law
503503abideSJ Empty = Empty
504−abideSJ (One e) = (One e)
504+abideSJ (One e) = One e
505505abideSJ (Junc a b) = Junc (abideSJ a) (abideSJ b)
506506abideSJ (Split a b) = Split (abideSJ a) (abideSJ b)
507507
@@ -515,20 +515,13 @@ tr (Split a b) = Junc (tr a) (tr b)
515515
516516-- Selective 'select' operator
517517
518−select ::
519− ( Num e,
520− Bounded a1,
521− Bounded b,
522− Enum a1,
523− Enum b,
524− Ord e,
525− KnownNat (Count a2),
526− KnownNat (Count rows),
527− FromLists e rows a2,
528− FromLists e rows rows,
529− Eq b
530− ) => Matrix e cols (Either a2 rows) -> (a1 -> b) -> Matrix e cols rows
531−select m y = (junc (fromF y) identity) `comp` m
518+select :: (Bounded a1, Bounded b, Enum a1, Enum b, Num e, Ord e,
519+ KnownNat (Count a2), KnownNat (Count rows), FromLists e rows a2,
520+ FromLists e rows rows, Eq b) =>
521+ Matrix e cols (Either a2 rows) -> (a1 -> b) -> Matrix e cols rows
522+select m y =
523+ let f = fromF y
524+ in junc f identity `comp` m
532525
533526-- McCarthy's Conditional
534527