I’m having a little difficulty navigating all the haskell docs..
I want to call the file function from the Text.BibTeX.Parse module in haskell, but I can’t figure out where to get the Parser argument:
file :: Parser [T]
I know it comes from the Parsec module, but when I look there, I have no idea what the numbers variable in the example code of parseFromFile refers to:
main = do{ result <- parseFromFile numbers "digits.txt"
; case result of
Left err -> print err
Right xs -> print (sum xs)
}
You don’t need to produce a
Parserargument to usefile: it already is aParser! The variablenumbersin the Parsec documentation is probably standing in for whatever parser you want to run on the text in"digits.txt". So, in your case, that’s thefileparser; you’d usefileinstead ofnumbers.