Skip to content

Conversation

rhendric
Copy link

To see the difference, run this file before and after patch with GHCRTS=-K1m cabal exec runghc:

import Web.Routes.RouteT

times :: Applicative f => Integer -> f a -> f a
times 1 m = m
times n m = m *> times (n - 1) m

main :: IO ()
main = unRouteT (times 100000 $ pure ()) $ \_ _ -> mempty

rhendric added 2 commits June 12, 2025 01:59
This appeases the -Wnoncanonical-monad-instances warning. This warning
exists because a future GHC release may treat noncanonical definitions
as errors.

See also:
  https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant