@@ -137,8 +137,8 @@ Migrations left to run:
137137module Squeal.PostgreSQL.Migration
138138 ( -- * Migration
139139 Migration (..)
140− , Unital
141− , unitally
140+ , Terminally (..)
141+ , terminally
142142 , pureMigration
143143 , Migratory (..)
144144 -- * Migration table
@@ -179,38 +179,38 @@ data Migration p schemas0 schemas1 = Migration
179179 , down :: p schemas1 schemas0 -- ^ The `down` instruction of a `Migration`.
180180 } deriving (GHC.Generic)
181181
182−-- | `Unital` turns an indexed monad transformer into a category by
182+-- | `Terminally` turns an indexed monad transformer into a category by
183183-- restricting the return type to `()` and permuting the type variables.
184−newtype Unital trans monad x0 x1 = Unital
185− { runUnital :: trans x0 x1 monad () }
184+newtype Terminally trans monad x0 x1 = Terminally
185+ { runTerminally :: trans x0 x1 monad () }
186186 deriving GHC.Generic
187187
188188-- | A `pureMigration` turns a `Migration` involving only pure SQL
189189-- `Definition`s into a `Migration` that may involve `IO`.
190190pureMigration
191191 :: Migration Definition schema0 schema1
192− -> Migration (Unital PQ IO) schema0 schema1
192+ -> Migration (Terminally PQ IO) schema0 schema1
193193pureMigration migration = Migration
194194 { name = name migration
195− , up = unitally . define $ up migration
196− , down = unitally . define $ down migration
195+ , up = terminally . define $ up migration
196+ , down = terminally . define $ down migration
197197 }
198198
199199instance
200200 ( IndexedMonadTransPQ trans
201201 , Monad monad
202202 , forall x0 x1. Monad (trans x0 x1 monad) )
203− => Category (Unital trans monad) where
204− id = Unital (return ())
205− Unital g . Unital f = Unital $ pqThen g f
203+ => Category (Terminally trans monad) where
204+ id = Terminally (return ())
205+ Terminally g . Terminally f = Terminally $ pqThen g f
206206
207−-- | unitally ignores the output of a computation, returning `()` and
208−-- wrapping it up in a `Unital`.
209−unitally
207+-- | terminally ignores the output of a computation, returning `()` and
208+-- wrapping it up in a `Terminally`.
209+terminally
210210 :: Functor (trans x0 x1 monad)
211211 => trans x0 x1 monad ignore
212− -> Unital trans monad x0 x1
213−unitally = Unital . void
212+ -> Terminally trans monad x0 x1
213+terminally = Terminally . void
214214
215215class Migratory p where
216216 migrateUp
@@ -224,7 +224,7 @@ instance Migratory Definition where
224224 migrateUp = migrateUp . alignedMap pureMigration
225225 migrateDown = migrateDown . alignedMap pureMigration
226226
227−instance Migratory (Unital PQ IO) where
227+instance Migratory (Terminally PQ IO) where
228228
229229 migrateUp migration = unsafePQ $
230230 define createMigrations
@@ -234,25 +234,25 @@ instance Migratory (Unital PQ IO) where
234234 where
235235
236236 upMigrations
237− :: AlignedList (Migration (Unital PQ IO)) schemas0 schemas1
237+ :: AlignedList (Migration (Terminally PQ IO)) schemas0 schemas1
238238 -> PQ MigrationsSchemas MigrationsSchemas IO ()
239239 upMigrations = \case
240240 Done -> return ()
241241 step :>> steps -> upMigration step & pqThen (upMigrations steps)
242242
243243 upMigration
244− :: Migration (Unital PQ IO) schemas0 schemas1
244+ :: Migration (Terminally PQ IO) schemas0 schemas1
245245 -> PQ MigrationsSchemas MigrationsSchemas IO ()
246246 upMigration step =
247247 queryExecuted step
248248 & pqBind ( \ executed -> unless (executed == 1)
249− $ unsafePQ (runUnital (up step))
249+ $ unsafePQ (runTerminally (up step))
250250 & pqThen (manipulateParams insertMigration (Only (name step)))
251251 -- insert execution record
252252 & pqBind okResult )
253253
254254 queryExecuted
255− :: Migration (Unital PQ IO) schemas0 schemas1
255+ :: Migration (Terminally PQ IO) schemas0 schemas1
256256 -> PQ MigrationsSchemas MigrationsSchemas IO Row
257257 queryExecuted step = do
258258 result <- runQueryParams selectMigration (Only (name step))
@@ -267,25 +267,25 @@ instance Migratory (Unital PQ IO) where
267267 where
268268
269269 downMigrations
270− :: AlignedList (Migration (Unital PQ IO)) schemas0 schemas1
270+ :: AlignedList (Migration (Terminally PQ IO)) schemas0 schemas1
271271 -> PQ MigrationsSchemas MigrationsSchemas IO ()
272272 downMigrations = \case
273273 Done -> return ()
274274 step :>> steps -> downMigrations steps & pqThen (downMigration step)
275275
276276 downMigration
277− :: Migration (Unital PQ IO) schemas0 schemas1
277+ :: Migration (Terminally PQ IO) schemas0 schemas1
278278 -> PQ MigrationsSchemas MigrationsSchemas IO ()
279279 downMigration step =
280280 queryExecuted step
281281 & pqBind ( \ executed -> unless (executed == 0)
282− $ unsafePQ (runUnital (down step))
282+ $ unsafePQ (runTerminally (down step))
283283 & pqThen (manipulateParams deleteMigration (Only (name step)))
284284 -- delete execution record
285285 & pqBind okResult )
286286
287287 queryExecuted
288− :: Migration (Unital PQ IO) schemas0 schemas1
288+ :: Migration (Terminally PQ IO) schemas0 schemas1
289289 -> PQ MigrationsSchemas MigrationsSchemas IO Row
290290 queryExecuted step = do
291291 result <- runQueryParams selectMigration (Only (name step))