user3420768
user3420768

Reputation: 13

putStrLn seeing too many arguments haskell

I have a putStrLn that is seeing a function on a following line and therefore not being compiled properly.

if director == "" then
        putStrLn "Please enter a directors name"
        startFunctional 5 userName database --This line is seen as an argument for the putStrLn
    else do
        *etc*

I have tried to use brackets to isolate the string, but this throws the same error.

Error message:

The function `putStrLn' is applied to five arguments, but its type `String -> IO ()' has only one

Upvotes: 1

Views: 297

Answers (1)

Benesh
Benesh

Reputation: 3428

Is it possible that you're missing a do block?

if director == "" 
then do
    putStrLn "Please enter a directors name"
    startFunctional 5 userName database
else do
    *etc*

Also, try to align the then and else keywords of an if block.

Upvotes: 6

Related Questions