Skip to content

Instantly share code, notes, and snippets.

@anthonyjoeseph
Last active May 15, 2020 21:55
Show Gist options
  • Save anthonyjoeseph/38a778383a58c9f13b669b90b6519b0e to your computer and use it in GitHub Desktop.
Save anthonyjoeseph/38a778383a58c9f13b669b90b6519b0e to your computer and use it in GitHub Desktop.
Opaque ADT Snippet
{
"Opaque ADT": {
"prefix": "oadt",
"body": [
"export const $1ADT = makeADT('type')({$2});",
"export type $1ADT = ADTType<typeof $1ADT>",
"export interface $1 extends Newtype<{ readonly $1: unique symbol }, $1ADT> {}",
"export const $1 = iso<$1>()"
],
"description": "Defines an opaque ADT"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment