Added emacs scripts
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: case
|
||||
# name: case
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
case ${1:x} of
|
||||
${2:Data} -> ${4:undefined}
|
||||
${3:Data} -> ${5:undefined}$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: {-
|
||||
# name: block comment
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
{- $0 -}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: =>
|
||||
# name: Type constraint
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
(${1:Class} ${2:m}) => $0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: data
|
||||
# name: inline data
|
||||
# condition: (= (length "data") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
data ${1:Type} = ${2:Data}$0 ${3:deriving (${4:Show, Eq})}
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: data
|
||||
# name: record data
|
||||
# condition: (= (length "data") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
data ${1:Type} = $1
|
||||
{ ${2:field} :: ${3:Type}
|
||||
, ${4:field} :: ${5:Type}$0
|
||||
} ${6:deriving (${7:Show, Eq})}
|
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fn
|
||||
# name: simple function
|
||||
# condition: (= (length "fn") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
${1:f} :: ${2:a} ${3:-> ${4:b}}
|
||||
$1 ${5:x} = ${6:undefined}$0
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fn
|
||||
# name: clause function
|
||||
# condition: (= (length "fn") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
${1:f} :: ${2:a} ${3:-> ${4:b}}
|
||||
$1 ${5:pattern} = ${7:undefined}
|
||||
$1 ${6:pattern} = ${8:undefined}$0
|
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fn
|
||||
# name: guarded function
|
||||
# condition: (= (length "fn") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
${1:f} :: ${2:a} ${3:-> ${4:b}}
|
||||
$1 ${5:x}
|
||||
| ${6:conditional} = ${8:undefined}
|
||||
| ${7:conditional} = ${9:undefined}$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: <-
|
||||
# name: monadic get
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
${1:x} <- ${2:undefined}$0
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: if
|
||||
# name: block if
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
if ${1:condition}
|
||||
then ${2:undefined}
|
||||
else ${3:undefined}$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: if
|
||||
# name: inline if
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
if ${1:condition} then ${2:undefined} else ${3:undefined}$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: imp
|
||||
# name: simple import
|
||||
# condition: (= (length "imp") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
import ${1:Module} ${2:(${3:f})}
|
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: imp
|
||||
# name: qualified import
|
||||
# condition: (= (length "imp") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
import qualified ${1:Module} as ${2:${1:$(let ((name (car (last (split-string yas-text "\\\.")))))
|
||||
(if (= 0 (length name)) ""
|
||||
(subseq name 0 1)))}}$0
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: inst
|
||||
# name: instance
|
||||
# condition: (= (length "inst") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
instance ${1:Class} ${2:Data} where
|
||||
${3:f} = ${4:undefined}$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: \
|
||||
# name: lambda
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
\\${1:x} -> ${2:undefined}$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: lang
|
||||
# name: language pragma
|
||||
# condition: (= (length "lang") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>, John Wiegley
|
||||
# --
|
||||
{-# LANGUAGE `(progn (require 'haskell-yas) (haskell-yas-complete "Extension: " haskell-yas-ghc-language-pragmas))` #-}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: let
|
||||
# name: let
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
let ${1:x} = ${2:undefined}$0
|
13
.emacs.d/elpa/haskell-mode-13.12/snippets/haskell-mode/main
Normal file
13
.emacs.d/elpa/haskell-mode-13.12/snippets/haskell-mode/main
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: main
|
||||
# name: main module
|
||||
# condition: (= (length "main") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
module Main where
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
${1:undefined}$0
|
||||
return ()
|
@@ -0,0 +1,14 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: mod
|
||||
# name: simple module
|
||||
# condition: (= (length "mod") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name))))
|
||||
(if (search "src/" name)
|
||||
(replace-regexp-in-string "/" "." (car (last (split-string name "src/"))))
|
||||
(file-name-nondirectory name))))`} where
|
||||
|
||||
$0
|
@@ -0,0 +1,17 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: mod
|
||||
# name: exports module
|
||||
# condition: (= (length "mod") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name))))
|
||||
(if (search "src/" name)
|
||||
(replace-regexp-in-string "/" "." (car (last (split-string name "src/"))))
|
||||
(file-name-nondirectory name))))`}
|
||||
( ${3:export}
|
||||
${4:, ${5:export}}
|
||||
) where
|
||||
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: new
|
||||
# name: newtype
|
||||
# condition: (= (length "new") (current-column))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
newtype ${1:Type} = $1 { un$1 :: ${2:a} } ${3:deriving (${4:Show, Eq})}
|
Reference in New Issue
Block a user