From ffbaf8371b6d5ade87311307435316256497eaef Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 14 May 2024 10:43:18 +0200 Subject: More coerce --- src/Data/Array/Nested/Internal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Data/Array/Nested') 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 -- cgit v1.2.3-70-g09d2