This is a DataKinds action in an action that:
- raises values ββat level level and
- lists types at level level
This, however, causes confusion at the type level. Now in types [X] can be either [X] :: * , type list-of- X , or instead we can have [X] :: [T] because of the rise - this is the value [X] (list, containing only a single value of X ), with an X type T raised at level level.
To overcome this ambiguity, the GHC requires a quote before the constructed value constructors. So we have [X] :: * and '[X] :: [T] .
Specifically, in your case, Get '[JSON] [User] includes both the list value [JSON] raised to the type level and the type of the list [User] . To better understand the difference, note that there are no (useful) terms like '[JSON] , as this is not a list type. We could even have Get '[JSON,JSON,JSON] [User] as a well-defined expression, or even Get '[] [User] . Instead, we cannot have Get '[JSON] [User,User] since [User,User] not a type.
(The type Get '[JSON,JSON,JSON] [User] , even if it is valid, cannot be used meaningfully by the Servant library. I have no idea why this elevated list is used in Servant.)
source share