Comment puis-je écrire multi-chaînes en Haskell?

Disons que j'ai cette chaîne littérale avec des sauts de ligne:

file :: String
file = "the first line\nthe second line\nthe third line"

Est-il possible de l'écrire comme ça?

file :: String
file = "the first line
        the second line
        the third line"

La tentative juste au-dessus conduit à cette erreur:

factor.hs:58:33:
    lexical error in string/character literal at character '\n'
Failed, modules loaded: none.
  • À supposer qu'il y avait un moyen, ne serait-il pas ajouter un espace afin d'atteindre l'indentation?
  • Voir ma réponse.
InformationsquelleAutor liubiantao | 2014-04-07