diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-04-05 18:30:30 +0200 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-04-05 18:33:37 +0200 |
| commit | 574468a37a0e662c5d63d1cf3f8f876b11b4e332 (patch) | |
| tree | d6015b45903ad21b04533d0bef52cfd38fca5d01 /src/Data/Array/Nested/Mixed/Shape.hs | |
| parent | 84c0878bbae11dbcab0f5b342386a20f716d2397 (diff) | |
Tweak sized list type synonyms slightly
Diffstat (limited to 'src/Data/Array/Nested/Mixed/Shape.hs')
| -rw-r--r-- | src/Data/Array/Nested/Mixed/Shape.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs index 54a945b..25cecb5 100644 --- a/src/Data/Array/Nested/Mixed/Shape.hs +++ b/src/Data/Array/Nested/Mixed/Shape.hs @@ -107,8 +107,8 @@ pattern (:.%) :: forall {sh1} {i}. forall n sh. (n : sh ~ sh1) => i -> IxX sh i -> IxX sh1 i -pattern i :.% sh <- IxX (i ::% (IxX -> sh)) - where i :.% IxX sh = IxX (i ::% sh) +pattern i :.% l <- IxX (i ::% (IxX -> l)) + where i :.% IxX l = IxX (i ::% l) infixr 3 :.% {-# COMPLETE ZIX, (:.%) #-} @@ -305,10 +305,10 @@ instance NFData i => NFData (ListH sh i) where rnf (SNat `ConsKnown` l) = rnf l data UnconsListHRes i sh1 = - forall n sh. (n : sh ~ sh1) => UnconsListHRes (ListH sh i) (SMayNat i n) + forall n sh. (n : sh ~ sh1) => UnconsListHRes (SMayNat i n) (ListH sh i) listhUncons :: ListH sh1 i -> Maybe (UnconsListHRes i sh1) -listhUncons (i `ConsUnknown` shl') = Just (UnconsListHRes shl' (SUnknown i)) -listhUncons (i `ConsKnown` shl') = Just (UnconsListHRes shl' (SKnown i)) +listhUncons (i `ConsUnknown` shl') = Just (UnconsListHRes (SUnknown i) shl') +listhUncons (i `ConsKnown` shl') = Just (UnconsListHRes (SKnown i) shl') listhUncons ZH = Nothing -- | This checks only whether the types are equal; if the elements of the list @@ -422,7 +422,7 @@ pattern (:$%) :: forall {sh1} {i}. forall n sh. (n : sh ~ sh1) => SMayNat i n -> ShX sh i -> ShX sh1 i -pattern i :$% shl <- ShX (listhUncons -> Just (UnconsListHRes (ShX -> shl) i)) +pattern i :$% shl <- ShX (listhUncons -> Just (UnconsListHRes i (ShX -> shl))) where i :$% ShX shl = case i of; SUnknown x -> ShX (x `ConsUnknown` shl); SKnown x -> ShX (x `ConsKnown` shl) infixr 3 :$% @@ -605,7 +605,7 @@ pattern (:!%) :: forall {sh1}. forall n sh. (n : sh ~ sh1) => SMayNat () n -> StaticShX sh -> StaticShX sh1 -pattern i :!% shl <- StaticShX (listhUncons -> Just (UnconsListHRes (StaticShX -> shl) i)) +pattern i :!% shl <- StaticShX (listhUncons -> Just (UnconsListHRes i (StaticShX -> shl))) where i :!% StaticShX shl = case i of; SUnknown () -> StaticShX (() `ConsUnknown` shl); SKnown x -> StaticShX (x `ConsKnown` shl) infixr 3 :!% |
