@@ -1,4 +1,5 @@
11{-# language DerivingStrategies #-}
2+{-# language DerivingVia #-}
23{-# language GeneralizedNewtypeDeriving #-}
34{-# language StandaloneKindSignatures #-}
45
@@ -22,12 +23,21 @@ import Rel8.Table.Alternative
2223 , AlternativeTable, emptyTable
2324 )
2425
26+-- semigroupoids
27+import Data.Functor.Apply ( Apply, WrappedApplicative(..) )
28+import Data.Functor.Bind ( Bind, (>>-) )
29+
2530
2631-- | The @Query@ monad allows you to compose a @SELECT@ query. This monad has
2732-- semantics similar to the list (@[]@) monad.
2833type Query :: Type -> Type
2934newtype Query a = Query (Opaleye.Select a)
3035 deriving newtype (Functor, Applicative, Monad)
36+ deriving Apply via (WrappedApplicative Opaleye.Select)
37+
38+
39+instance Bind Query where
40+ (>>-) = (>>=)
3141
3242
3343-- | '<|>:' = 'unionAll'.