나는 간단한 해커를 만들려고 노력하고있다. 간단한 putStrLn과 getLine을 만들려고 노력했다. (이것이 최고의 해결책인지는 모른다. 문제가 있건 없건간에, 나는 상당히 새로운 것입니다.)작은 트위터 클라이언트를위한 하스켈 IO cli 메뉴
나는 이런 식으로 뭔가를하고 싶어하지만 출력 유형이 너무 거 대규모 오류주고 다른 :
Main.hs:86:25: error:
Couldn't match type ‘Either String DM’ with ‘()’
Expected type: IO()
Actual type: IO (Either String DM)
:
main:: IO()
main = do
putStrLn "1)Tweet\n 2)Timeline\n 3)DM\n 4)Inbox\n"
numero <- getLine
if(numero == 1)
then do
frase <- getLine
tweet frase
else
if(numero == 2)
then do
frase <- getLine
timeline frase
else
if(numero == 3)
then do
frase <- getLine
nome <- getLine
dm frase nome
else
if(numero == 4)
then
inbox
else do
PutstrLn "Invalido"
tweet :: String -> IO (Either String Tweet)
timeline :: String -> IO (Either String [Tweet])
dm :: String -> String -> IO(Either String DM)
inbox :: IO(Either String [DM])
을 그리고 같은 내가 그 거 위의 설명은 당신에게 같은 오류를 제공
및 :
Main.hs:75:11: error:
• Couldn't match type ‘Either String Tweet’ with ‘()’
Expected type: IO()
Actual type: IO (Either String Tweet)
이 특정 pr을 해결할 사람이 있다면 oblem 매우 감사하겠습니다.
모든 관련 코드 및 오류 메시지를 게시하십시오. 귀하의 게시물이 [최소, 완전하고 검증 가능한 예] (http://stackoverflow.com/help/mcve)를 제공하지 않으면 귀하를 도울 수 없습니다. – Mephy
@Mephy는 몇 가지 예제를 추가했습니다. –
질문에 오타가 있습니다. 'PutstLn'은'putStrLn'이어야합니다. – Cirdec