Type | Haskell | TypeScript | Flow | JsDoc | JSON Schema |
---|---|---|---|---|---|
Union | data Shape = Circle | Triangle |
type Shape = CircleInterface | TriangleInterface |
var Shape: CircleVar | TriangleVar |
`({x: number, y: number, r: number} | {{x: number, y: number, a: number, b: number, c: number}})` |
Product | Data Circle = Int Int Int |
interface Circle {x: number; y: number; radius: number } |
var Circle = {x: number, y: number, radius: number} |
{{x: number; y: number; radius: number}} |
type: "object", properties: {x: "number", y: "number", radius: "number"} |
Nullable | Maybe type | type T1 = (x?: number) |
var Salary = ?number |
{?number} |
Depends on parser, either type: null if it supports undefined as well or using required |
Non-nulalble | - | let s = e!.name |
? | {!{number}} |
- |
Discriminated union | Pattern matching in type constructor | Understanding context | Understanding context | - | - |
Generics | data Maybe a = Nothing | Just a |
interface GenericObject<T> {foo: T;} |
type GenericObject<T> = { foo: T }; |
- | - |
-
Notifications
You must be signed in to change notification settings - Fork 0
yarax/typescript-flow-haskell-types-comparison
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published