{"id":20055028,"url":"https://github.com/lukehoersten/haskell-snippets","last_synced_at":"2025-03-02T09:22:43.505Z","repository":{"id":9041890,"uuid":"10805030","full_name":"lukehoersten/haskell-snippets","owner":"lukehoersten","description":"Moved to https://github.com/haskell/haskell-snippets","archived":false,"fork":false,"pushed_at":"2017-09-07T17:49:54.000Z","size":27,"stargazers_count":15,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T21:32:40.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukehoersten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-19T20:05:53.000Z","updated_at":"2023-11-26T08:43:36.000Z","dependencies_parsed_at":"2022-09-13T06:50:16.669Z","dependency_job_id":null,"html_url":"https://github.com/lukehoersten/haskell-snippets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukehoersten%2Fhaskell-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukehoersten%2Fhaskell-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukehoersten%2Fhaskell-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukehoersten%2Fhaskell-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukehoersten","download_url":"https://codeload.github.com/lukehoersten/haskell-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241483520,"owners_count":19970093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T12:45:27.887Z","updated_at":"2025-03-02T09:22:43.481Z","avatar_url":"https://github.com/lukehoersten.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Haskell-Snippets\n\n\n**Haskell-Snippets** is a collection of\n[YASnippet][yas]\n[Haskell][haskell] snippets for Emacs.\n\n\n## Installation\n\nEnable the Emacs package manager and make sure the melpa package\nrepository is set up.\n\n```lisp\n(require 'package)\n(add-to-list 'package-archives\n             '(\"melpa\" . \"http://melpa.milkbox.net/packages/\") t)\n(package-initialize)\n```\n\n\u003ckbd\u003eM-x package-install haskell-snippets\u003c/kbd\u003e\n\nAdd the following to your Emacs config:\n\n```lisp\n(require 'haskell-snippets)\n```\n\nSnippets may have to be recompiled and reloaded in Emacs if YASnippet\nis already in use:\n\n\u003ckbd\u003eM-x yas-recompile-all\u003c/kbd\u003e\n\u003ckbd\u003eM-x yas-reload-all\u003c/kbd\u003e\n\nHaskell snippts should now be available to use! In a `haskell-mode`\nbuffer, type `fn\u003cTAB\u003e`. A prompt should appear asking which `fn`\nsnippet to expand.\n\nI **highly** recommend using YASnippet with [ido-mode]. Configure\nEmacs:\n\n```lisp\n(setq-default yas-prompt-functions '(yas-ido-prompt yas-dropdown-prompt))\n```\n\nThis is important so that alternatives (like `import` vs. `import\nqualified`) can quickly be selected with a single key stroke.\n\n\n## Available Expansion Keys\n\n* `new` - newtype\n* `mod` - module [simple, exports]\n* `main ` - main module and function\n* `let` - let bindings\n* `lang` - language extension pragmas\n* `opt` - GHC options pragmas\n* `\\` - lambda function\n* `inst` - instance declairation\n* `imp` - import modules [simple, qualified]\n* `if` - if conditional [inline, block]\n* `\u003c-` - monadic get\n* `fn` - top level function [simple, guarded, clauses]\n* `data` - data type definition [inline, record]\n* `=\u003e` - type constraint\n* `{-` - block comment\n* `case` - case statement\n\n\n## Design Ideals\n\n* Keep snippet keys (the prefix used to auto-complete) to four\n  characters or less while still being as easy to guess as possible.\n\n* Have as few keys as possible. The more keys there are to remember,\n  the harder snippets are to use and learn.\n\n* Leverage [ido-mode][] when reasonable. For instance, to keep the\n  number of snippet keys to a minimum as well as auto complete things\n  like [Haskell Langauge Extension Pragmas][lang-pragma]. When\n  multiple snippets share a key (ex: `fn`), the `ido-mode` prompts are\n  unique to one character (ex: `guarded function` and `simple\n  function` are `g` and `s` respectively).\n\n\n## Authors\n\nThis code is written and maintained by Luke Hoersten,\n\u003cluke@hoersten.org\u003e.\n\n\n[yas]: https://github.com/capitaomorte/yasnippet\n[ido-mode]: http://www.emacswiki.org/emacs/InteractivelyDoThings\n[lang-pragma]: http://hackage.haskell.org/packages/archive/Cabal/1.16.0.3/doc/html/Language-Haskell-Extension.html#t:KnownExtension\n[haskell]: http://haskell.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehoersten%2Fhaskell-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukehoersten%2Fhaskell-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehoersten%2Fhaskell-snippets/lists"}