假设我有一个带有换行符的字符串文字:
file :: String
file = "the first line\nthe second line\nthe third line"
有没有办法像这样写?
file :: String
file = "the first line
the second line
the third line"
上面的尝试会导致这个错误:
factor.hs:58:33:
lexical error in string/character literal at character '\n'
Failed, modules loaded: none.