HNHacker News
TopNewBestAskShowJobs

jesseschalken

49 karma · joined March 15, 2016

submissionscomments
jesseschalken··on Flowtype 0.30 adds support for Windows
Am I correct in saying that the Hack and Flow typecheckers share a lot of code? If so, does this mean that Hack typechecking on Windows could be next?
jesseschalken··on State of the Art JavaScript in 2016
ADTs can be very easily replaced with visitors.

  type Maybe<T> = <V>(v:{just(x:T):V, nothing():V}) => V
  
  let just = <T>(x:T):Maybe<T> => <V>(v:{just(x:T):V}) => v.just(x)
  let nothing = <T>():Maybe<T> => <V>(v:{nothing():V}) => v.nothing()
  
  let values:Maybe<number>[] = [just(6), nothing()]
  
  values.forEach(maybe => {
    alert(maybe({
      just: x => 'got: ' + x,
      nothing: () => 'nothing'
    }))
  })
← PreviousPage 2 of 2