开发者

WxHaskell thinks my strings are 1 character long

开发者 https://www.devze.com 2023-03-30 00:41 出处:网络
Whenever I use a string in WxHaskell, it thinks the string is one character (it only displays the first character). It only happens when using the WxHaskell functions, not functions like putStrLn.

Whenever I use a string in WxHaskell, it thinks the string is one character (it only displays the first character). It only happens when using the WxHaskell functions, not functions like putStrLn.

For example, the bug happens in this code

module Main where
import Graphics.UI.WX

main = start hello
hello = do f <- frame [text := "Hello"]
           quit <- button f [text := "quit", 开发者_StackOverflow中文版on command := close f]
           set f [layout := widget quit]

It doesn't happen in this program:

module Main where

main = putStrLn "hello"


I had this behavior a while back. Turned out to be a unicode issue. Recompiling with some sort of unicode flag fixed things, IIRC.

0

精彩评论

暂无评论...
验证码 换一张
取 消