2

I just started using haskell-mode for emacs and am using turn-on-haskell-unicode-input-method, a function that converts various expressions to unicode equivalents in the haskell-mode buffers. I was surprised to find that the ascii values are permanently replaced by the unicode characters, so when trying to load into ghci REPL there are errors. I like the unicode though, and am looking for a quick fix that converts the unicode back to ascii when saving/sending to REPL. Is there an easy way to do this?

Rorschach
  • 31,301
  • 5
  • 78
  • 129

2 Answers2

2

After enabling haskell mode, you can add the following snippet to your .emacs file.

;; Unicode symbols
(defvar haskell-font-lock-symbols)
(setq haskell-font-lock-symbols t)

You will be able to see the symbols, and GHC will interpret your source as a normal .hs file.

You can also check the Haskell Wiki for more information

Jason Robinson
  • 923
  • 9
  • 11
1

If you don't want those Unicode characters in your files, then rather than an input-method, you want some "pretty display" functionalit. I think haskell-mode has a haskell-font-lock-symbols option for that. Emacs-24.4 also introduced a similar (but global) prettify-symbols-mode feature for that purpose, but I don't know if haskell-mode supports it already.

Stefan
  • 27,908
  • 4
  • 53
  • 82