From 07970d6a4476fc1d39457193d9f6175fe7b69dad Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 2 Jun 2025 23:04:29 +0200 Subject: Make MapJust injective --- src/Data/Array/Nested/Types.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Data/Array') diff --git a/src/Data/Array/Nested/Types.hs b/src/Data/Array/Nested/Types.hs index 4172fa0..b8a9aea 100644 --- a/src/Data/Array/Nested/Types.hs +++ b/src/Data/Array/Nested/Types.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} @@ -111,7 +112,7 @@ type family Replicate n a where lemReplicateSucc :: (a : Replicate n a) :~: Replicate (n + 1) a lemReplicateSucc = unsafeCoerceRefl -type family MapJust l where +type family MapJust l = r | r -> l where MapJust '[] = '[] MapJust (x : xs) = Just x : MapJust xs -- cgit v1.2.3-70-g09d2