Skip to content

Instantly share code, notes, and snippets.

@songpp
Last active February 24, 2020 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save songpp/c6b1e946d84e3f29d1128932cbb1859c to your computer and use it in GitHub Desktop.
Save songpp/c6b1e946d84e3f29d1128932cbb1859c to your computer and use it in GitHub Desktop.
vs haskell snipptes
{
// Place your snippets for haskell here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Add LANGUAGE pragma": {
"prefix": "lang",
// Extension list from: http://hackage.haskell.org/package/Cabal-2.0.1.1/docs/Language-Haskell-Extension.html#t:KnownExtension
"body": [
"{-# LANGUAGE ${0} #-}"
],
"description": "Add LANGUAGE pragma"
},
"Module Definition" : {
"prefix" : "mod",
"body": [
"module ${1} where"
],
"description": "New Module"
},
"Add Import" : {
"prefix" : "imp",
"body" : [
"import ${1}"
],
"description": "Add Import"
},
"Add Qualified Import" : {
"prefix" : "impq",
"body" : [
"import qualified ${1} as ${2}"
],
"description": "Add Qualified Import"
},
"Double import": {
"prefix": "impdq",
"body": [
"import ${1:Data.Text} ($2)",
"import qualified ${1:Data.Text} as ${3:Text}"
],
"description": "Import a module qualified and unqualified"
},
"Typeclass declaration": {
"prefix": "class",
"body": [
"class ${1:TypeclassName} ${2:a} where",
"\t$3"
],
"description": "Create new typeclass"
},
"Typeclass instance declaration": {
"prefix": "instance",
"body": [
"instance ${1:TypeclassName} ${2:Type} where",
"\t${3:function} = ${4:undefined}"
],
"description": "Create typeclass instance"
},
"Case statement": {
"prefix": "case",
"body": [
"case ${1:value} of",
"\t${2:_} -> ${3:_}"
],
"description": "Create case statement"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment