ormolu-0.8.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Utils.IO

Synopsis

- findClosestFileSatisfying :: MonadIO m => (FilePath -> Bool) -> FilePath -> m (Maybe FilePath)
- data Cache k v
- newCache :: Ord k => IO (Cache k v)
- withCache :: Ord k => Cache k v -> k -> IO v -> IO v

# Documentation

findClosestFileSatisfying Source #

Arguments

:: MonadIO m |
=> (FilePath -> Bool) | The predicate that determines what we are looking for
-> FilePath | Path to the starting point for the search
-> m (Maybe FilePath) | Absolute path to the found file if available

Find the path to the closest file higher in the file hierarchy that satisfies a given predicate.

data Cache k v Source #

newCache :: Ord k => IO (Cache k v) Source #

withCache :: Ord k => Cache k v -> k -> IO v -> IO v Source #

Execute an `IO` action but only if the given key is not found in the cache.