@@ -48,9 +48,9 @@ data Evaluations = Evaluations
48-- | Some PostgreSQL functions, such as 'Rel8.nextval', have side effects,
48-- | Some PostgreSQL functions, such as 'Rel8.nextval', have side effects,
49-- breaking the referential transparency we would otherwise enjoy.
49-- breaking the referential transparency we would otherwise enjoy.
51−-- To try to recover our ability to reason about such expressions, 'Rel8'
51+-- To try to recover our ability to reason about such expressions, 'Evaluate'
52−-- provides the 'Evaluate' monad, which allows us to control the evaluation
53−-- order of side-effects by sequencing them monadically.
52+-- allows us to control the evaluation order of side-effects by sequencing
54type Evaluate :: Type -> Type
54type Evaluate :: Type -> Type
55newtype Evaluate a = Evaluate (State Evaluations a)
55newtype Evaluate a = Evaluate (State Evaluations a)
56 deriving newtype (Functor, Apply, Applicative, Monad)
56 deriving newtype (Functor, Apply, Applicative, Monad)
@@ -61,8 +61,8 @@ instance Bind Evaluate where
63-- | 'eval' takes expressions that could potentially have side effects and
63-- | 'eval' takes expressions that could potentially have side effects and
64−-- lifts them into the 'Evaluate' monad. The resulting expressions has no side
64+-- \"runs\" them in the 'Evaluate' monad. The returned expressions have no
65−-- effetcs and can safely be reused.
65+-- side effetcs and can safely be reused.
66eval :: Table Expr a => a -> Evaluate a
66eval :: Table Expr a => a -> Evaluate a
67eval a = Evaluate $ do
67eval a = Evaluate $ do
68 Evaluations {tag, bindings} <- get
68 Evaluations {tag, bindings} <- get