1
Fork 0
satellite/dotfiles/vscode-snippets/snippets/purescript/deriving.json

60 lines
1.5 KiB
JSON
Raw Normal View History

2022-08-05 19:11:10 +02:00
{
"Derive newtype instance": {
"prefix": "nderive",
"description": "Use newtype deriving on any typeclass",
"body": "derive newtype instance $0 $3 $2"
},
"Generate json instances": {
"prefix": "json",
"description": "Generate the deriving of the EncodeJson and DecodeJson typeclasses",
"body": [
"derive newtype instance EncodeJson $1",
"derive newtype instance DecodeJson $1"
]
},
"Generic": {
"prefix": "generic",
"description": "Generate the generic instance for a type",
"body": "derive instance Generic $1 _"
},
"Generic Show": {
"prefix": "gshow",
"description": "Generate generic show instances",
"body": [
"instance Show $1 where",
" show = genericShow"
]
},
"Generic Debug": {
"prefix": "gdebug",
"description": "Generate generic debug instances",
"body": [
"instance Debug $1 where",
" debug = genericDebug"
]
},
"Generic json": {
"prefix": "gjson",
"description": "Generate generic json instances",
"body": [
"instance EncodeJson $1 where",
" encodeJson = genericEncodeJson",
"instance DecodeJson $1 where",
" decodeJson = genericDecodeJson"
]
},
"Instance": {
"prefix": "instance",
"description": "Declare typeclass instance",
"body": [
"instance $2 $3 where",
" $0"
]
},
"Functor": {
"prefix": "functor",
"description": "Derive a Functor instance",
"body": "derive instance Functor $1$0"
}
}