aeson-typescript
aeson-typescript copied to clipboard
Haskell types with a `'` in the name result in broken code
Suppose we have this:
data MyThing' a = MyThing a | Nope Int
$(deriveToJSONAndTypeScript defaultOptions ''MyThing')
It'll generate code like this:
export type TMyThing'<T> = IMyThing<T> | INope<T>
type IMyThing<T> = {
tag: "MyThing"
contents: T
}
type INope<T> = {
tag: "Nope"
contents: number
}
TypeScript fails to parse this.
It'd be nice if the TH code threw an error about it, instead.