{-# LANGUAGE FlexibleContexts #-}
module Opaleye.Internal.Lateral
( lateral
, viaLateral
, laterally
, bilaterally
, bind
, arrowApply
)
where
import Opaleye.Internal.QueryArr
laterally :: (Select a -> Select b) -> SelectArr i a -> SelectArr i b
laterally :: (Select a -> Select b) -> SelectArr i a -> SelectArr i b
laterally Select a -> Select b
f SelectArr i a
as = (i -> Select b) -> SelectArr i b
forall i a. (i -> Select a) -> SelectArr i a
lateral (\i
i -> Select a -> Select b
f (SelectArr i a -> i -> Select a
forall i a. SelectArr i a -> i -> Select a
viaLateral SelectArr i a
as i
i))
bilaterally :: (Select a -> Select b -> Select c)
-> SelectArr i a -> SelectArr i b -> SelectArr i c
bilaterally :: (Select a -> Select b -> Select c)
-> SelectArr i a -> SelectArr i b -> SelectArr i c
bilaterally Select a -> Select b -> Select c
f SelectArr i a
as SelectArr i b
bs = (i -> Select c) -> SelectArr i c
forall i a. (i -> Select a) -> SelectArr i a
lateral (\i
i -> Select a -> Select b -> Select c
f (SelectArr i a -> i -> Select a
forall i a. SelectArr i a -> i -> Select a
viaLateral SelectArr i a
as i
i) (SelectArr i b -> i -> Select b
forall i a. SelectArr i a -> i -> Select a
viaLateral SelectArr i b
bs i
i))