diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-05-14 10:43:18 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-05-14 10:43:18 +0200 |
commit | ffbaf8371b6d5ade87311307435316256497eaef (patch) | |
tree | 72e3ad0f757c6594b507dc9a4fcd77ffb3504284 /src/Data/Array | |
parent | f5bc67f8530c50f90692824192d7dfb81ba1b334 (diff) |
More coerce
Diffstat (limited to 'src/Data/Array')
-rw-r--r-- | src/Data/Array/Nested/Internal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs index d75aeaf..4a03548 100644 --- a/src/Data/Array/Nested/Internal.hs +++ b/src/Data/Array/Nested/Internal.hs @@ -1051,7 +1051,7 @@ rtoVector = coerce mtoVector rfromList1 :: forall n a. (KnownINat n, Elt a) => NonEmpty (Ranked n a) -> Ranked (S n) a rfromList1 l | Dict <- lemKnownReplicate (Proxy @n) - = Ranked (mfromList ((\(Ranked x) -> x) <$> l)) + = Ranked (mfromList1 (coerce l)) rfromList :: Elt a => NonEmpty a -> Ranked I1 a rfromList = Ranked . mfromList1 . fmap mscalar @@ -1258,7 +1258,7 @@ sfromList1 :: forall n sh a. (KnownNat n, KnownShape sh, Elt a) => NonEmpty (Shaped sh a) -> Shaped (n : sh) a sfromList1 l | Dict <- lemKnownMapJust (Proxy @sh) - = Shaped (mfromList ((\(Shaped x) -> x) <$> l)) + = Shaped (mfromList1 (coerce l)) sfromList :: (KnownNat n, Elt a) => NonEmpty a -> Shaped '[n] a sfromList = Shaped . mfromList1 . fmap mscalar |