|
1 | 1 | ;;; haskell-snippets.el --- Yasnippets for Haskell |
2 | 2 |
|
3 | | -;; Copyright (C) 2013 Luke Hoersten |
4 | | -;; keywords: snippets |
| 3 | +;; Copyright (C) 2013-2015 Luke Hoersten |
| 4 | + |
| 5 | +;; Author: Luke Hoersten <luke@hoersten.org> |
| 6 | +;; URL: https://github.com/haskell/haskell-snippets |
| 7 | +;; Keywords: snippets, haskell |
5 | 8 | ;; Version: 0.1.0 |
6 | 9 | ;; Package-Requires: ((yasnippet "0.8.0")) |
7 | 10 |
|
|
24 | 27 | ;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
25 | 28 | ;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
26 | 29 |
|
| 30 | +;;; Commentary: |
| 31 | +;; |
| 32 | +;; Haskell-Snippets is a collection of YASnippet Haskell snippets for Emacs. |
| 33 | +;; |
| 34 | +;; Available Expansion Keys: |
| 35 | +;; |
| 36 | +;; new - newtype |
| 37 | +;; mod - module [simple, exports] |
| 38 | +;; main - main module and function |
| 39 | +;; let - let bindings |
| 40 | +;; lang - language extension pragmas |
| 41 | +;; opt - GHC options pragmas |
| 42 | +;; \ - lambda function |
| 43 | +;; inst - instance declairation |
| 44 | +;; imp - import modules [simple, qualified] |
| 45 | +;; if - if conditional [inline, block] |
| 46 | +;; <- - monadic get |
| 47 | +;; fn - top level function [simple, guarded, clauses] |
| 48 | +;; data - data type definition [inline, record] |
| 49 | +;; => - type constraint |
| 50 | +;; {- - block comment |
| 51 | +;; case - case statement |
| 52 | +;; |
| 53 | +;; Design Ideals: |
| 54 | +;; |
| 55 | +;; Keep snippet keys (the prefix used to auto-complete) to four |
| 56 | +;; characters or less while still being as easy to guess as |
| 57 | +;; possible. |
| 58 | +;; |
| 59 | +;; Have as few keys as possible. The more keys there are to |
| 60 | +;; remember, the harder snippets are to use and learn. |
| 61 | +;; |
| 62 | +;; Leverage ido-mode when reasonable. For instance, to keep the |
| 63 | +;; number of snippet keys to a minimum as well as auto complete |
| 64 | +;; things like Haskell Langauge Extension Pragmas. When multiple |
| 65 | +;; snippets share a key (ex: 'fn'), the ido-mode prompts are unique to |
| 66 | +;; one character (ex: 'guarded function' and 'simple function' are 'g' and |
| 67 | +;; 's' respectively). |
| 68 | + |
27 | 69 | ;;; Code: |
28 | 70 |
|
29 | 71 | (setq haskell-snippets-dir |
|
0 commit comments