Slide 14
Slide 14 text
OhYes:
Constrain PureScript types to be directly
interoperable with TypeScript, with support for
union types with a “type” string literal field using
Variant
(Same with Kancho, for Elm ports)
Sample Applications of RowLists (2 of n)
type VariantTest = Variant
( a :: String
, b :: Number
, c :: Boolean
)
export type VariantTest =
| { type: "a", value: string }
| { type: "b", value: number }
| { type: "c", value: boolean };