everything happens for a reason

bassjacob.com
@bassjacob

JavaScript


Reason


so what's the reason for all of this, anyway?

who here has dealt with a runtime error?

null

hoare's billion dollar mistake

unit tests can only tell you when something is broken

they can't tell you that something is ok

make illegal states unrepresentable


but jacob I hear you say

there are already type systems for javascript

flow



merlin says

this pattern-matching is not exhaustive.

Here is an example of a value that is not matched: C

typescript



merlin says

This expression has type Js.t { baz : 'a }

but an expression was expected of type Js.t { bar : Js.fn [ `Arity_0 ] 'b, .. }

The first object type has no method bar

the years of javascript fatigue

the years of javascript fatigue

safe by default

you need to take off the parachute, not put it on

hello world!



open Express;

is kind of like

const express = require('express');



type route = A | B | C;

define the allowed members of the type




FFI?

binding to existing JS code


Typed Templating


Real World Example:

github.com/bassjacob/bassjacob.com





a new meetup

meetup.com/reason-sydney

https://discord.gg/reasonml

${whoami:-Jacob Bass}

github: bassjacob

twitter: @bassjacob

web: www.bassjacob.com

email: [email protected]