@@ -1,4 +1,5 @@
1{-# language DerivingStrategies #-}
1{-# language DerivingStrategies #-}
2+{-# language DerivingVia #-}
2{-# language GeneralizedNewtypeDeriving #-}
3{-# language GeneralizedNewtypeDeriving #-}
3{-# language StandaloneKindSignatures #-}
4{-# language StandaloneKindSignatures #-}
@@ -22,12 +23,21 @@ import Rel8.Table.Alternative
22 , AlternativeTable, emptyTable
23 , AlternativeTable, emptyTable
27+import Data.Functor.Apply ( Apply, WrappedApplicative(..) )
28+import Data.Functor.Bind ( Bind, (>>-) )
26-- | The @Query@ monad allows you to compose a @SELECT@ query. This monad has
31-- | The @Query@ monad allows you to compose a @SELECT@ query. This monad has
27-- semantics similar to the list (@[]@) monad.
32-- semantics similar to the list (@[]@) monad.
28type Query :: Type -> Type
33type Query :: Type -> Type
29newtype Query a = Query (Opaleye.Select a)
34newtype Query a = Query (Opaleye.Select a)
30 deriving newtype (Functor, Applicative, Monad)
35 deriving newtype (Functor, Applicative, Monad)
36+ deriving Apply via (WrappedApplicative Opaleye.Select)
39+instance Bind Query where
33-- | '<|>:' = 'unionAll'.
43-- | '<|>:' = 'unionAll'.