on master help sign in
Document Rel8.Expr.Eq.in_
cf03bcdOllie Charles
src/Rel8/Expr/Eq.hs+8
@@ -85,6 +85,14 @@ a /=? b = coalesce $ unsafeLiftOpNullable ne a b
85infix 4 /=?
85infix 4 /=?
86
86
87
87
88+-- | Like the SQL @IN@ operator, but implemented by folding over a list with
89+-- '==.' and '||.'.
90+--
91+-- >>> select c $ return $ lit (5 :: Int32) `in_` [ lit x | x <- [1..5] ]
92+-- [True]
93+--
94+-- >>> select c $ return $ lit (42 :: Int32) `in_` [ lit x | x <- [1..5] ]
95+-- [False]
88in_ :: (DBEq db, Nullabilizes db a, Foldable f)
96in_ :: (DBEq db, Nullabilizes db a, Foldable f)
89 => f (Expr a) -> Expr a -> Expr Bool
97 => f (Expr a) -> Expr a -> Expr Bool
90in_ = sin nullabilization
98in_ = sin nullabilization