@@ -1,13 +1,14 @@
1−{-# LANGUAGE CPP #-}
1+{-# LANGUAGE CPP #-}
2−{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE ConstraintKinds #-}
3−{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE DataKinds #-}
4−{-# LANGUAGE FlexibleContexts #-}
4+{-# LANGUAGE FlexibleContexts #-}
5−{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE FlexibleInstances #-}
6+{-# LANGUAGE MultiParamTypeClasses #-}
6−{-# LANGUAGE ScopedTypeVariables #-}
7+{-# LANGUAGE ScopedTypeVariables #-}
7−{-# LANGUAGE TemplateHaskell #-}
8+{-# LANGUAGE TemplateHaskell #-}
8−{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeFamilies #-}
9−{-# LANGUAGE TypeOperators #-}
10+{-# LANGUAGE TypeOperators #-}
10−{-# LANGUAGE UndecidableInstances #-}
11+{-# LANGUAGE UndecidableInstances #-}
12-- | Generalizes all the data needed to make code generation work with
13-- | Generalizes all the data needed to make code generation work with
13-- arbitrary programming languages.
14-- arbitrary programming languages.
@@ -140,7 +141,12 @@ captureArg _ = error "captureArg called on non capture"
140defReq :: Req
141defReq :: Req
141defReq = Req defUrl "GET" [] False []
142defReq = Req defUrl "GET" [] False []
144+-- | To be used exclusively as a "negative" return type/constraint
145+-- by @'Elem`@ type family.
143type family Elem (a :: *) (ls::[*]) :: Constraint where
148type family Elem (a :: *) (ls::[*]) :: Constraint where
149+ Elem a '[] = NotFound
144 Elem a (a ': list) = ()
150 Elem a (a ': list) = ()
145 Elem a (b ': list) = Elem a list
151 Elem a (b ': list) = Elem a list