Last active
November 28, 2018 07:54
-
-
Save m-renaud/2c085d453b1263f1a6ed52d0c90688de to your computer and use it in GitHub Desktop.
Pretty Haskell operators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Prefix variable name with mrenaud/ in case haskell-mode adds | |
;; a 'haskell-prettify-alist in a future release. | |
(defvar mrenaud/haskell-prettify-alist | |
'(("\\" . ?λ) | |
("->>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s | |
(Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?> | |
(Bc . Bl) ?- (Br . Br) ?>)) | |
(">>=" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s | |
(Bl . Bl) ?> (Bc . Bc) ?> | |
(Bc . Bl) ?= (Br . Br) ?=)) | |
("=<<" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s | |
(Bl . Bl) ?= (Bc . Br) ?= (Bc . Bc) ?< | |
(Bl . Bl) ?= (Br . Br) ?<)) | |
("->>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s | |
(Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?> | |
(Bc . Bl) ?- (Br . Br) ?>)) | |
("=>" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?= (Bc . Br) ?= (Bc . Bc) ?= | |
(Br . Br) ?>)) | |
("->" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?- | |
(Bc . Bl) ?- (Br . Br) ?>)) | |
("<-" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?< (Bc . Br) ?- (Bc . Bc) ?- | |
(Bc . Bl) ?- (Br . Br) ?-)) | |
("-<" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?- (Bc . Bc) ?- (Br . Br) ?<)) | |
(">-" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?> (Bc . Bc) ?- (Br . Br) ?-)) | |
("++" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?+ (Bc . Br) ?+ (Bc . Bc) ?- | |
(Bc . Bl) ?+ (Br . Br) ?+)) | |
("==" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?= (Bc . Br) ?= (Bc . Bc) ?= | |
(Bc . Bl) ?= (Br . Br) ?=)) | |
("/=" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?= (Bc . Br) ?= (Bc . Bc) ?/ | |
(Bc . Bl) ?= (Br . Br) ?=)) | |
("<>" . (?\s (Br . Bl) ?\s | |
(Bl . Bl) ?< (Bc . Br) ?< | |
(Bc . Bl) ?> (Br . Br) ?>)) | |
("+++" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s | |
(Bl . Bl) ?+ (Bc . Br) ?- (Bc . Bc) ?+ | |
(Bc . Bl) ?- (Br . Br) ?+)))) | |
(defun mrenaud/haskell-mode-hook () | |
(setq prettify-symbols-alist mrenaud/haskell-prettify-alist) | |
(prettify-symbols-mode 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment