Next: Indentation, Previous: Completion support, Up: Top [Index]
See the Haskell Wiki’s entry on Unicode Symbols for general information about Unicode support in Haskell.
As Emacs supports editing files containing Unicode out of the box, so
does Haskell Mode. As an add-on, Haskell Mode includes the
haskell-unicode
input method which allows you to easily type a
number of Unicode symbols that are useful when writing Haskell code;
See (emacs)Input Methods, for more details.
To automatically enable the haskell-unicode
input method in
haskell-mode buffers use M-x customize-variable RET
haskell-mode-hook or put the following code in your .emacs file:
(add-hook 'haskell-mode-hook 'turn-on-haskell-unicode-input-method)
To temporarily enable this input method for a single buffer you can use M-x turn-on-haskell-unicode-input-method.
When the haskell-unicode
input method is active, you can simply
type ‘->’ and it is immediately replaced with ‘→’. Use
C-\ to toggle the input method. To see a table of all key
sequences use M-x describe-input-method RET
haskell-unicode. A sequence like ‘<=’ is ambiguous and can mean
either ‘⇐’ or ‘≤’. Typing it presents you with a choice. Type
1 or 2 to select an option or keep typing to use the default
option.
Currently defined sequences are listed in the following table:
Sequence | Unicode | Sequence | Unicode | Sequence | Unicode | Sequence | Unicode |
---|---|---|---|---|---|---|---|
alpha | α | Alpha | Α | beta | β | Beta | Β |
gamma | γ | Gamma | Γ | delta | δ | Delta | Δ |
epsilon | ε | Epsilon | Ε | zeta | ζ | Zeta | Ζ |
eta | η | Eta | Η | theta | θ | Theta | Θ |
iota | ι | Iota | Ι | kappa | κ | Kappa | Κ |
lambda | λ | Lambda | Λ | lamda | λ | Lamda | Λ |
mu | μ | Mu | Μ | nu | ν | Nu | Ν |
xi | ξ | Xi | Ξ | omicron | ο | Omicron | Ο |
pi | π | Pi | Π | rho | ρ | Rho | Ρ |
sigma | σ | Sigma | Σ | tau | τ | Tau | Τ |
upsilon | υ | Upsilon | Υ | phi | φ | Phi | Φ |
chi | χ | Chi | Χ | psi | ψ | Psi | Ψ |
omega | ω | Omega | Ω | digamma | ϝ | Digamma | Ϝ |
san | ϻ | San | Ϻ | qoppa | ϙ | Qoppa | Ϙ |
sampi | ϡ | Sampi | Ϡ | stigma | ϛ | Stigma | Ϛ |
heta | ͱ | Heta | Ͱ | sho | ϸ | Sho | Ϸ |
|A| | 𝔸 | |B| | 𝔹 | |C| | ℂ | |D| | 𝔻 |
|E| | 𝔼 | |F| | 𝔽 | |G| | 𝔾 | |H| | ℍ |
|I| | 𝕀 | |J| | 𝕁 | |K| | 𝕂 | |L| | 𝕃 |
|M| | 𝕄 | |N| | ℕ | |O| | 𝕆 | |P| | ℙ |
|Q| | ℚ | |R| | ℝ | |S| | 𝕊 | |T| | 𝕋 |
|U| | 𝕌 | |V| | 𝕍 | |W| | 𝕎 | |X| | 𝕏 |
|Y| | 𝕐 | |Z| | ℤ | |gamma| | ℽ | |Gamma| | ℾ |
|pi| | ℼ | |Pi| | ℿ | :: | ∷ | forall | ∀ |
exists | ∃ | -> | → | <- | ← | => | ⇒ |
~> | ⇝ | <~ | ⇜ | && | ∧ | || | ∨ |
== | ≡ | /= | ≢, ≠ | <= | ≤ | >= | ≥ |
/< | ≮ | /> | ≯ | * | ⋅ | elem | ∈ |
notElem | ∉ | member | ∈ | notMember | ∉ | union | ∪ |
intersection | ∩ | isSubsetOf | ⊆ | isProperSubsetOf | ⊂ | <<< | ⋘ |
>>> | ⋙ | <| | ⊲ | |> | ⊳ | >< | ⋈ |
mappend | ⊕ | . | ∘ | undefined | ⊥ | := | ≔ |
=: | ≕ | =def | ≝ | =? | ≟ | ... | … |
_0 | ₀ | _1 | ₁ | _2 | ₂ | _3 | ₃ |
_4 | ₄ | _5 | ₅ | _6 | ₆ | _7 | ₇ |
_8 | ₈ | _9 | ₉ | ^0 | ⁰ | ^1 | ¹ |
^2 | ² | ^3 | ³ | ^4 | ⁴ | ^5 | ⁵ |
^6 | ⁶ | ^7 | ⁷ | ^8 | ⁸ | ^9 | ⁹ |
If you don’t like the highlighting of partially matching tokens you can
turn it off by setting input-method-highlight-flag
to nil
via M-x customize-variable.
Next: Indentation, Previous: Completion support, Up: Top [Index]