Based on other similar questions I found I figure my problem has to do with indentation, but I’ve messed with it a lot and still can’t figure it out.
addBook = do
putStrLn "Enter the title of the Book"
tit <- getLine
putStrLn "Enter the author of "++tit
aut <- getLine
putStrLn "Enter the year "++tit++" was published"
yr <- getLine
In your case it’s not indentation; you really have finished your function with something that is not an expression.
yr <- getLine— what did you expect to happen toyr, or for that matteraut, after this? They’re just dangling, unused.It may be clearer to show how this translates:
So, what did you want to have following that last arrow?