Skip to content

RouteT: More stack-efficient (*>)#7

Open
rhendric wants to merge 2 commits intoHappstack:masterfrom
rhendric:rhendric/routet-then
Open

RouteT: More stack-efficient (*>)#7
rhendric wants to merge 2 commits intoHappstack:masterfrom
rhendric:rhendric/routet-then

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