以下のサイトを参考に http://dysphoria.net/2009/06/28/hindley-milner-type-inference-in-scala/ hindley-milnerの型推論をPython版をPHPで実装してみました。 Modula2->Perl->Scala->Python->PHP という流れで移植に移植を重ねられています。 洗練されたり、悪くなったりしてると思います。 今週末はいろいろと、型推論のソースを見てました。 まだ良くわかってませんが、単相だけではなくて多相の型推論も眼中に入って来た感じで 嬉しいです。 <?php abstract class Term { function __toString() { switch (true) { case $this instanceOf Ident: return $this->name; case $t