-
Notifications
You must be signed in to change notification settings - Fork 4
/
purescript.miros
107 lines (93 loc) · 2.2 KB
/
purescript.miros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
block start auto
string val
name value definition
desc Create a value-level declaration
snip
$1 :: $2
$1 $3 = $4
for kind <- @⟨type,newtype,data⟩
string @kind
name @kind definition
desc Define a @⟨@kind:type,newtype,adt⟩
snip @kind $1 = $2
string example
name example docstring
desc Provide example usage for some piece of code
snip
-- | Example:
-- | ```purs
-- | $0
-- | ```
string class
name typeclass declaration
desc Declare a typeclass
snip
class $1 $|2⟨
where
$2,
$2
⟩
string instance
name typeclass instance
desc Declare a typeclass instance
snip
instance $1 $|2⟨
where
$2,
$2
⟩
string derive
name derive typeclass instance
desc Derive a typeclass instance
snip derive instance $|1⟨$1,newtype $1⟩instance $0
for typeclass <- @⟨Eq,Ord,Functor⟩
string d@⟨@typeclass:eq,ord,functor⟩
name derive @typeclass
snip derive instance @typeclass $0
for typeclass <- @⟨Newtype,Generic⟩
string d@⟨@typeclass:newtype,generic⟩
name derive @typeclass
snip derive instance @typeclass $1 _
for typeclass <- @⟨Show,Debug⟩
for lower <- @⟨@typeclass:show,debug⟩
string g@lower
name generic @lower instance
snip
instance @typeclass $1 where
@lower = generic@typeclass
string djson
name derive json instances
snip
derive newtype instance EncodeJson $",
derive newtype instance DecodeJson $1
string gjson
name generic json instances
snip
instance EncodeJson $1 where
encodeJson = genericEncodeJson
instance DecodeJson $1 where
decodeJson = genericDecodeJson
block auto
string ite
name if-then-else
snip if $1 then $2 else $0
string caseof
name pattern match
snip
case $1 of
$2 -> $0
block start
for module <- @⟨
Map,
HashMap,
Set,
HashSet,
Array,
List,
String,
Int,
Number
⟩
string imp@⟨@module:map,hashmap,set,hashset,array,list,string,int,number⟩
name import Data.@module
snip import Data.@module as @module