Skip to content

Commit

Permalink
remove debug trace
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTaelin committed Sep 26, 2024
1 parent 19c15ee commit 174e027
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/Kind/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,23 @@ extractName basePath = dropBasePath . dropExtension where

apiLoad :: FilePath -> Book -> String -> IO Book
apiLoad basePath book name = do
trace ("load " ++ name) $
if M.member name book
then return book
if M.member name book
then return book
else do
let file = basePath </> name ++ ".kind"
fileExists <- doesFileExist file
if fileExists then
loadFile file
else do
let file = basePath </> name ++ ".kind"
fileExists <- doesFileExist file
if fileExists then
loadFile file
else do
putStrLn $ "Error: Definition '" ++ name ++ "' not found."
exitFailure
where
loadFile filePath = do
code <- readFile filePath
book0 <- doParseBook filePath code
let book1 = M.union book0 book
let deps = getDeps (M.findWithDefault Set name book0)
foldM (apiLoad basePath) book1 deps
putStrLn $ "Error: Definition '" ++ name ++ "' not found."
exitFailure
where
loadFile filePath = do
code <- readFile filePath
book0 <- doParseBook filePath code
let book1 = M.union book0 book
let deps = getDeps (M.findWithDefault Set name book0)
foldM (apiLoad basePath) book1 deps

-- Normalizes a term
apiNormal :: Book -> String -> IO ()
Expand Down

0 comments on commit 174e027

Please sign in to comment.