Skip to content

Instantly share code, notes, and snippets.

@sleexyz
Last active February 12, 2017 19:54
Show Gist options
  • Save sleexyz/43f1d9995481330919260175e839479f to your computer and use it in GitHub Desktop.
Save sleexyz/43f1d9995481330919260175e839479f to your computer and use it in GitHub Desktop.
Flow stuff

Flow

Extrinsic type system (Curry style)

Contrast with intrinsic type systems (ML, Haskell, Java, Scala).

Try it!

https://flowtype.org/try/

  • function type annotation
  • type aliases
  • Unions, Intersections
  • dynamic type tests
  • Exact types
  • any vs mixed
  • map types
  • typeof types
  • $Keys<O>
  • $ObjMap<O, F>

Secret sauce

Inference

Instead of typing unannotated terms with any, aka supertype and subtype of all types, try to infer types.

"Lazy"

Instead of eagerly assigning types to terms, record all inflows and check for consistency among flows as information grows.

Video

https://www.youtube.com/watch?v=VEaDsKyDxkY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment