Misc edits, including generating lens code
Getty Ritter
8 years ago
3 | 3 | (setq initial-scratch-message "") |
4 | 4 | (setq inhibit-startup-message t) |
5 | 5 | (setq inhibit-startup-screen t) |
6 |
(setq-default c-basic-offset |
|
6 | (setq-default c-basic-offset 2) | |
7 | 7 | (menu-bar-mode 0) |
8 | 8 | (setq column-number-mode t) |
9 | 9 | (setq default-tab-width 4) |
293 | 293 | (add-to-list 'Info-default-directory-list "/usr/lib/emacs/haskell-mode/") |
294 | 294 | (setq haskell-mode-hook '(turn-on-haskell-indentation)))) |
295 | 295 | |
296 | ;; an editor macro for creating obvious trivial lens impls | |
297 | (defun mk-lens () | |
298 | (interactive) | |
299 | (let ((rstart (region-beginning)) | |
300 | (rend (region-end))) | |
301 | (goto-char rstart) | |
302 | (if (re-search-forward | |
303 | "^@lens \\([A-Za-z0-9_]+\\) *\\([A-Za-z0-9_]+\\) *\\([A-Za-z0-9._]+\\)" | |
304 | nil | |
305 | t) | |
306 | (let ((val (match-string 1)) | |
307 | (typ (match-string 2)) | |
308 | (fil (match-string 3))) | |
309 | (goto-char (match-beginning 0)) | |
310 | (delete-region (match-beginning 0) (match-end 0)) | |
311 | (insert val "L :: Lens' " typ " " fil "\n") | |
312 | (insert val "L = makeLens " val " (\\ t s -> s { " val " = t })\n") | |
313 | (mk-lens))))) | |
314 | ||
315 | ||
296 | 316 | ;; (use-package ghc |
297 | 317 | ;; :ensure t |
298 | 318 | ;; :init |
314 | 334 | |
315 | 335 | (use-package idris-mode |
316 | 336 | :ensure t) |
317 | ;(use-package helm-idris | |
318 | ; :ensure t) | |
319 | 337 | |
320 | 338 | |
321 | 339 |