See the link below for a nicely-rendered version of this article. https://ayazhafiz.com/articles/21/type-inference-for-flow-typingThe FT calculusPearce's subtyping algorithm$\infer$: type inference for FTPreliminariesInferring single variablesBoundsSolution setsExistence and construction of $\infer1$Dealing with cyclesSolution ordersSolving for minimal typesPutting it all togetherConclusionTakeawaysAn implementation of the type inferer can be found on GitHub. We have also provided a play...