每當我在WxHaskell中使用一個字符串時,它認爲該字符串是一個字符(它只顯示第一個字符)。它僅在使用WxHaskell函數時發生,而不是像putStrLn這樣的函數。WxHaskell認爲我的字符串長度爲1個字符
例如,錯誤發生在這個代碼
module Main where
import Graphics.UI.WX
main = start hello
hello = do f <- frame [text := "Hello"]
quit <- button f [text := "quit", on command := close f]
set f [layout := widget quit]
它不會在這個節目發生:
module Main where
main = putStrLn "hello"
運行此程序時,我得到一個標題爲「Hello」的表單,其中標有「quit」的單個按鈕。 – Rotsor
這就是我尋求幫助的原因。我看不出什麼是錯的。我嘗試重新安裝,但沒有奏效。 – Anonymous