Next: , Previous: , Up: Top   [Index]


6 Unicode support

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:

SequenceUnicodeSequenceUnicodeSequenceUnicodeSequenceUnicode
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
notElemmembernotMemberunion
intersectionisSubsetOfisProperSubsetOf<<<
>>><||>><
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: , Previous: , Up: Top   [Index]