Skip to content

Commit 10d14a2

Browse files
committed
Fix non-canonical-return warnings
1 parent ae4f14e commit 10d14a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Distribution/Server/Features/Security/Migration.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ data Migrated a = Migrated MigrationStats a | AlreadyMigrated a
206206
deriving (Functor)
207207

208208
instance Applicative Migrated where
209-
pure = return
209+
pure = AlreadyMigrated
210210
f <*> x = do f' <- f ; x' <- x ; return $ f' x'
211211

212212
instance Monad Migrated where
213-
return = AlreadyMigrated
213+
return = pure
214214
AlreadyMigrated a >>= f = f a
215215
Migrated stats a >>= f =
216216
case f a of

src/Distribution/Server/Framework/BackupRestore.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ data Restore a = RestoreDone a
251251
| RestoreFindBlob BlobId (Bool -> Restore a)
252252

253253
instance Monad Restore where
254-
return = RestoreDone
254+
return = pure
255255
RestoreDone x >>= g = g x
256256
RestoreFail err >>= _ = RestoreFail err
257257
RestoreAddBlob bs f >>= g = RestoreAddBlob bs $ \bid -> f bid >>= g
@@ -270,7 +270,7 @@ instance Functor Restore where
270270
fmap = liftM
271271

272272
instance Applicative Restore where
273-
pure = return
273+
pure = RestoreDone
274274
mf <*> mx = do f <- mf ; x <- mx ; return (f x)
275275

276276
runRestore :: BlobStores -> Restore a -> IO (Either String a)

0 commit comments

Comments
 (0)