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