@@ -189,6 +189,11 @@ class KnownNat n => HasParameter
189189 (params :: [NullityType])
190190 (ty :: NullityType)
191191 | n params -> ty where
192+ -- | `parameter` takes a `Nat` using type application and a `TypeExpression`.
193+ --
194+ -- >>> let expr = parameter @1 int4 :: Expression sch rels grp '[ 'Null 'PGint4] ('Null 'PGint4)
195+ -- >>> printSQL expr
196+ -- ($1 :: int4)
192197 parameter
193198 :: TypeExpression schema (PGTypeOf ty)
194199 -> Expression schema relations grouping params ty
@@ -199,10 +204,16 @@ instance {-# OVERLAPPING #-} HasParameter 1 schema (ty1:tys) ty1
199204instance {-# OVERLAPPABLE #-} (KnownNat n, HasParameter (n-1) schema params ty)
200205 => HasParameter n schema (ty' : params) ty
201206
207+-- | `param` takes a `Nat` using type application and for basic types,
208+-- infers a `TypeExpression`.
209+--
210+-- >>> let expr = param @1 :: Expression sch rels grp '[ 'Null 'PGint4] ('Null 'PGint4)
211+-- >>> printSQL expr
212+-- ($1 :: int4)
202213param
203214 :: forall n schema params relations grouping ty
204215 . (PGTyped schema (PGTypeOf ty), HasParameter n schema params ty)
205− => Expression schema relations grouping params ty
216+ => Expression schema relations grouping params ty -- ^ param
206217param = parameter @n pgtype
207218
208219instance (HasUnique relation relations columns, Has column columns ty)