1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

📝 mlfp.

This commit is contained in:
Rob Rix 2017-12-21 14:44:19 -05:00
parent fb455ce8fc
commit e629b0bc84

View File

@ -131,6 +131,9 @@ fixCache ev' yield e = do
pure value
-- | Compute the Kleene fixed-point theorem in a monadic context.
--
-- cf https://en.wikipedia.org/wiki/Kleene_fixed-point_theorem
mlfp :: (Eq a, Monad m) => a -> (a -> m a) -> m a
mlfp a f = loop a
where loop x = do