Document Rel8.Expr.Eq.in_
commitcf03bcd648897a7877fc23cd7974293099a6c5ed
authorOllie Charles <ollie@ocharles.org.uk>
dateTue 23 Mar 2021, 16:06 (6 years ago)
parente150ff4
src/Rel8/Expr/Eq.hs+8
@@ -85,6 +85,14 @@ a /=? b = coalesce $ unsafeLiftOpNullable ne a b
8585infix 4 /=?
8686
8787
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]
8896in_ :: (DBEq db, Nullabilizes db a, Foldable f)
8997 => f (Expr a) -> Expr a -> Expr Bool
9098in_ = sin nullabilization