on master help sign in
proxy-fy toDefineExpr
commitd36fa645845145e60cfe2fad95f0d8814a524d69 authorAgentM <agentm@themactionfaction.com> dateThu 5 Oct 2017, 17:29 (9 years ago) parent5b1fe0f
1 file changed+3−3
src/lib/ProjectM36/Tupleable.hs+3−3
src/lib/ProjectM36/Tupleable.hs+3−3
@@ -56,10 +56,10 @@ toInsertExpr vals rvName = do
5656 pure (Insert rvName rel)
5757
5858-- | Convert a 'Tupleable' to a create a 'Define' expression which can be used to create an empty relation variable. Use 'toInsertExpr' to insert the actual tuple data. This function is typically used with 'Data.Proxy'.
59−toDefineExpr :: Tupleable a => Proxy a -> RelVarName -> DatabaseContextExpr
60−toDefineExpr prox rvName = Define rvName (map NakedAttributeExpr (V.toList attrs))
59+toDefineExpr :: forall a proxy. Tupleable a => proxy a -> RelVarName -> DatabaseContextExpr
60+toDefineExpr _ rvName = Define rvName (map NakedAttributeExpr (V.toList attrs))
6161 where
62− attrs = toAttributes prox
62+ attrs = toAttributes (Proxy :: Proxy a)
6363
6464class Tupleable a where
6565 toTuple :: a -> RelationTuple