putStrLn看到太多的论点haskell

putStrLn看到太多的论点haskell,haskell,io,Haskell,Io,我有一个putStrLn,它在下面一行看到一个函数,因此没有正确编译 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* 我曾尝试使用括号来分隔字符串,但这会引发

我有一个putStrLn,它在下面一行看到一个函数,因此没有正确编译

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*
我曾尝试使用括号来分隔字符串,但这会引发相同的错误

错误消息:

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

是否可能缺少
do

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

另外,尝试对齐
if
块的
then
else
关键字。

是否可能缺少
do

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

另外,尝试对齐
if
块的
then
else
关键字。

对齐
then
else
可能是很好的样式,但肯定不是必需的。除了出现在
do
块中的
if-then-else
这种特殊情况外,
if
then
else
这些关键字都不会触发任何类型的布局行为。出于某种原因,我认为它会触发。谢谢对齐
then
else
可能是一种很好的风格,但肯定不是必需的。除了出现在
do
块中的
if-then-else
这种特殊情况外,
if
then
else
这些关键字都不会触发任何类型的布局行为。出于某种原因,我认为它会触发。谢谢