Home

Awesome

typescript-flow-haskell-types-comparison

TypeHaskellTypeScriptFlowJsDocJSON Schema
Uniondata Shape = Circle | Triangletype Shape = CircleInterface | TriangleInterfacevar Shape: CircleVar | TriangleVar`({x: number, y: number, r: number}{{x: number, y: number, a: number, b: number, c: number}})`
ProductData Circle = Int Int Intinterface 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"}
NullableMaybe typetype 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 unionPattern matching in type constructorUnderstanding contextUnderstanding context--
Genericsdata Maybe a = Nothing | Just ainterface GenericObject<T> {foo: T;}type GenericObject<T> = { foo: T };--