Skip to content

Instantly share code, notes, and snippets.

@shapr
Created October 4, 2019 00:15
Show Gist options
  • Select an option

  • Save shapr/5882fba3dfec2bf6bb2047b6899a5b98 to your computer and use it in GitHub Desktop.

Select an option

Save shapr/5882fba3dfec2bf6bb2047b6899a5b98 to your computer and use it in GitHub Desktop.
-- | given a directory for a paper, read that json file into a Paper value
readPaper :: FilePath -> IO (Maybe Paper)
readPaper fp = do
f <- findPaper fp "paper.json"
let f' = listToMaybe f
bs <- mapM BS.readFile f' -- XXX this gonna be a problem at some point XXX
mapM decodeStrict bs -- is this right? do I need this pure? can I concat it with the previous line?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment