>>> 1 `shouldSatisfy` P.lt 5 P.|| P.gt 10
RB.get (r1 RB.|| r2) === (RB.get r1 || RB.get r2)
RDB.get (r1 RDB.|| r2) === (RDB.get r1 || RDB.get r2)
>>> execState (do _1 ||= True; _2 ||= False; _3 ||= True; _4 ||= False) (True,True,False,False) (True,True,True,False)
(||=) :: MonadState s m => Setter' s Bool -> Bool -> m () (||=) :: MonadState s m => Iso' s Bool -> Bool -> m () (||=) :: MonadState s m => Lens' s Bool -> Bool -> m () (||=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()
>>> both ||~ True $ (False,True) (True,True)
>>> both ||~ False $ (False,True) (False,True)
(||~) :: Setter' s Bool -> Bool -> s -> s (||~) :: Iso' s Bool -> Bool -> s -> s (||~) :: Lens' s Bool -> Bool -> s -> s (||~) :: Traversal' s Bool -> Bool -> s -> s
foo |= expr ==> var foo; foo = expr;
selectList ([ PersonAge >. 25 , PersonAge <. 30 ] ||. [ PersonIncome >. 15000 , PersonIncome <. 25000 ]) []will filter records where a person's age is between 25 and 30 or a person's income is between (15000 and 25000). If you are looking for an (&&.) operator to do (A AND B AND (C OR D)) you can use the (++) operator instead as there is no (&&.). For example:
selectList ([ PersonAge >. 25 , PersonAge <. 30 ] ++ ([PersonCategory ==. 1] ||. [PersonCategory ==. 5])) []will filter records where a person's age is between 25 and 30 and (person's category is either 1 or 5).
>>> ident 3 ||| konst 7 (3,4) (3><7) [ 1.0, 0.0, 0.0, 7.0, 7.0, 7.0, 7.0 , 0.0, 1.0, 0.0, 7.0, 7.0, 7.0, 7.0 , 0.0, 0.0, 1.0, 7.0, 7.0, 7.0, 7.0 ]