diff --git a/src/Database/Esqueleto/Experimental.hs b/src/Database/Esqueleto/Experimental.hs index 4f15517..316cfe9 100644 --- a/src/Database/Esqueleto/Experimental.hs +++ b/src/Database/Esqueleto/Experimental.hs @@ -61,7 +61,6 @@ module Database.Esqueleto.Experimental , ToAliasReference(..) , ToAliasReferenceT , ToSqlSetOperation(..) - , ValidOnClauseValue -- * The Normal Stuff , where_ diff --git a/src/Database/Esqueleto/Experimental/From/Join.hs b/src/Database/Esqueleto/Experimental/From/Join.hs index afce940..be4d462 100644 --- a/src/Database/Esqueleto/Experimental/From/Join.hs +++ b/src/Database/Esqueleto/Experimental/From/Join.hs @@ -46,19 +46,6 @@ instance (ToMaybe a, ToMaybe b) => ToMaybe (a :& b) where type ToMaybeT (a :& b) = (ToMaybeT a :& ToMaybeT b) toMaybe (a :& b) = (toMaybe a :& toMaybe b) --- | Constraint for `on`. Ensures that only types that require an `on` can be used on --- the left hand side. This was previously reusing the From class which was actually --- a bit too lenient as it allowed to much. --- --- @since 3.4.0.0 -type family ValidOnClauseValue a :: Constraint where - ValidOnClauseValue (Table a) = () - ValidOnClauseValue (SubQuery a) = () - ValidOnClauseValue (SqlQuery a) = () - ValidOnClauseValue (SqlSetOperation a) = () - ValidOnClauseValue (a -> SqlQuery b) = () - ValidOnClauseValue (From a) = () - ValidOnClauseValue _ = TypeError ('Text "Illegal use of ON") -- | An @ON@ clause that describes how two tables are related. This should be -- used as an infix operator after a 'JOIN'. For example, @@ -70,7 +57,7 @@ type family ValidOnClauseValue a :: Constraint where -- \`on\` (\\(p :& bP) -> -- p ^. PersonId ==. bP ^. BlogPostAuthorId) -- @ -on :: ValidOnClauseValue a => a -> (b -> SqlExpr (Value Bool)) -> (a, b -> SqlExpr (Value Bool)) +on :: ToFrom a a' => a -> (b -> SqlExpr (Value Bool)) -> (a, b -> SqlExpr (Value Bool)) on = (,) infix 9 `on`