summaryrefslogtreecommitdiff
path: root/tools/resolver-visualize/Resolver/Util.hs
blob: ff5102d5d44ed4c8e75bdbcd996c1bf600599314 (plain)
1
2
3
4
5
6
7
8
module Resolver.Util where

while :: Monad m => m Bool -> m a -> a -> m a
while cond body dflt =
    do ok <- cond
       (if ok
        then (body >>= while cond body)
        else return dflt)