From e629b0bc84671392c0fd6bfaf36aa9fa74051a89 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 21 Dec 2017 14:44:19 -0500 Subject: [PATCH] :memo: mlfp. --- src/Analysis/Abstract/Caching.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Analysis/Abstract/Caching.hs b/src/Analysis/Abstract/Caching.hs index 77e39a76e..f8d991560 100644 --- a/src/Analysis/Abstract/Caching.hs +++ b/src/Analysis/Abstract/Caching.hs @@ -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