From ef771c6eda575968fa13d5c2657951d732054e04 Mon Sep 17 00:00:00 2001 From: Felipe Lessa Date: Sun, 9 Sep 2012 10:26:56 -0300 Subject: [PATCH] Provide a veryUnsafeCoerceSqlExprValue function that may be useful. --- src/Database/Esqueleto/Internal/Sql.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index e76fe3b..63f17dc 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -30,6 +30,7 @@ module Database.Esqueleto.Internal.Sql , Mode(..) , Escape , SqlSelect + , veryUnsafeCoerceSqlExprValue ) where import Control.Applicative (Applicative(..), (<$>)) @@ -343,6 +344,13 @@ unsafeSqlBinOp op (ERaw p1 f1) (ERaw p2 f2) = ERaw Parens f , vals1 <> vals2 ) +-- | (Internal) Coerce a type of a 'SqlExpr (Value a)' into +-- another 'SqlExpr (Value b)'. You should /not/ use this +-- function unless you know what you're doing! +veryUnsafeCoerceSqlExprValue :: SqlExpr (Value a) -> SqlExpr (Value b) +veryUnsafeCoerceSqlExprValue (ERaw p f) = ERaw p f + + ----------------------------------------------------------------------