gdritter repos dotfiles / ad97a1d
Misc edits, including generating lens code Getty Ritter 8 years ago
1 changed file(s) with 21 addition(s) and 3 deletion(s). Collapse all Expand all
33 (setq initial-scratch-message "")
44 (setq inhibit-startup-message t)
55 (setq inhibit-startup-screen t)
6 (setq-default c-basic-offset 4)
6 (setq-default c-basic-offset 2)
77 (menu-bar-mode 0)
88 (setq column-number-mode t)
99 (setq default-tab-width 4)
293293 (add-to-list 'Info-default-directory-list "/usr/lib/emacs/haskell-mode/")
294294 (setq haskell-mode-hook '(turn-on-haskell-indentation))))
295295
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
296316 ;; (use-package ghc
297317 ;; :ensure t
298318 ;; :init
314334
315335 (use-package idris-mode
316336 :ensure t)
317 ;(use-package helm-idris
318 ; :ensure t)
319337
320338
321339