Last active
May 15, 2020 21:55
-
-
Save anthonyjoeseph/38a778383a58c9f13b669b90b6519b0e to your computer and use it in GitHub Desktop.
Opaque ADT Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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