JSON a, CachedYamlInfoState s)
                          => FilePath
                          -> DelayedCachedYamlLoader s a
mkDelayedCachedYamlLoader fp base_dir_list = do
  full_path <- liftIO (findFirstMatchedFile base_dir_list fp)
                >>= maybe
                    (liftIO $ throwIO $ mkIOError doesNotExistErrorType "mkDelayedCachedYamlLoader" Nothing (Just fp))
                    return

  bs <- liftIO $ B.readFile full_path
  let md5sum = md5HashBS bs

  st <- ask
  cache_map <- SV.get st
  jv <- case HM.lookup full_path cache_map of
         
findFirstMatchedFile :: (Functor t, Foldable t)
                     => t FilePath  -- ^ base dirs to try
                     -> FilePath    -- ^ sub-path
                     -> IO (Maybe FilePath)
findFirstMatchedFile base_dir_list fp = do
  runMaybeT $ asum $ fmap (MaybeT . try_dir) $ base_dir_list
  where
    try_dir bp = do
        let full_path = bp </> fp

        exists <- doesFileExist full_path
        return $ if exists
                   then Just full_path
                   else Nothing
findFirstMatchedFile base_dir_list fp = do
  runMaybeT $ asum $ fmap (MaybeT . try_dir) $ base_dir_list
  where
    try_dir bp = do
        let full_path = bp </> fp

        exists <- doesFileExist full_path
        return $ if exists
                   then Just full_path
                   else Nothing