Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell -- "The last statement in a 'do' construct must be an expression"

Tags:

Like it says in the title: What does The last statement in a 'do' construct must be an expression mean? I ended my do block with a putStrLn like it shows in several examples I've seen, and i get an error.

Code:

main = do args <- getArgs
           file <-readFile "TWL06.txt"
           putStrLn results
like image 320
RCIX Avatar asked Jan 06 '10 22:01

RCIX


1 Answers

Most of the time, it's because your code is mis-aligned and compiler assumes that your "do" block ended prematurely (or has extra code that dont really belong there)

like image 128
ADEpt Avatar answered Sep 28 '22 01:09

ADEpt