File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
servant/src/Servant/API/UVerb Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ instance {-# OVERLAPPING #-} UElem x xs => UElem x (x' ': xs) where
111
111
eject (Z _) = Nothing
112
112
eject (S ns) = eject ns
113
113
114
- -- | Check whether @a@ is in list. This will throw nice errors if the element is not in the
115
- -- list, or if there is a duplicate in the list.
114
+ -- | Check whether @a@ is in given type-level list.
115
+ -- This will throw a nice error if the element is not in the list.
116
116
type family CheckElemIsMember (a :: k ) (as :: [k ]) :: Constraint where
117
117
CheckElemIsMember a as =
118
118
If (Elem a as ) (() :: Constraint ) (TypeError (NoElementError a as ))
@@ -132,6 +132,8 @@ type family Elem (x :: k) (xs :: [k]) :: Bool where
132
132
Elem x (_ ': xs ) = Elem x xs
133
133
Elem _ '[] = 'False
134
134
135
+ -- | Check whether all values in a type-level list are distinct.
136
+ -- This will throw a nice error if there are any duplicate elements in the list.
135
137
type family Unique xs :: Constraint where
136
138
Unique xs = If (Nubbed xs == 'True) (() :: Constraint ) (TypeError (DuplicateElementError xs ))
137
139
You can’t perform that action at this time.
0 commit comments