mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
📝 mlfp.
This commit is contained in:
parent
fb455ce8fc
commit
e629b0bc84
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user