[Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Petr P
  Dear Haskellers,

could somebody recommend me study materials for learning Hindley-Milner
type inference algorithm I could recommend to undergraduate students? The
original paper is harder to understand, I'm looking for something more
didactic. The students are familiar with the lambda calculus, natural
deduction and System F.

  Thanks for help,
  Petr Pudlak
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Vo Minh Thu
2013/1/18 Petr P petr@gmail.com:
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students? The
 original paper is harder to understand, I'm looking for something more
 didactic. The students are familiar with the lambda calculus, natural
 deduction and System F.

I think I really liked

Cardelli's paper Basic Polymorphic Typechecking, 1987

HTH,
Thu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Anton Dergunov
 I also agree that Cardelli paper is great.

It was also very useful for me to follow Python implementation provided in the 
following blog post:
http://www.smallshire.org.uk/sufficientlysmall/2010/04/11/a-hindley-milner-type-inference-implementation-in-python/

I found it useful to investigate in Python debugger how various terms were 
interpreted.

You may also find useful implementations in Scala and Perl:
http://dysphoria.net/2009/06/28/hindley-milner-type-inference-in-scala/
http://web.archive.org/web/20050911123640/http://www.cs.berkeley.edu/~nikitab/courses/cs263/hm.html

Also, I have plans to read Typing Haskell in Haskell by Mark Jones and 
Practical type inference for arbitrary-rank types by Simon Peyton-Jones et. 
al. They are also related here, but not directly.

--
Best Regards,
Anton Dergunov

Пятница, 18 января 2013, 11:12 +01:00 от Vo Minh Thu not...@gmail.com:
2013/1/18 Petr P  petr@gmail.com :
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students? The
 original paper is harder to understand, I'm looking for something more
 didactic. The students are familiar with the lambda calculus, natural
 deduction and System F.

I think I really liked

Cardelli's paper Basic Polymorphic Typechecking, 1987

HTH,
Thu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Jan Stolarek
Dnia piątek, 18 stycznia 2013, Petr P napisał:
 for learning Hindley-Milner type inference algorithm I could recommend to
 undergraduate students? The original paper is harder to understand, I'm
 looking for something more didactic. The students are familiar with the
 lambda calculus, natural deduction and System F.

Perhaps chapters on H-M from Appel's Modern compiler implementation in C/Java 
would be good?

Janek

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Rustom Mody
On Fri, Jan 18, 2013 at 5:49 PM, Jan Stolarek jan.stola...@p.lodz.plwrote:

 Dnia piątek, 18 stycznia 2013, Petr P napisał:
  for learning Hindley-Milner type inference algorithm I could recommend to
  undergraduate students? The original paper is harder to understand, I'm
  looking for something more didactic. The students are familiar with the
  lambda calculus, natural deduction and System F.


What is the current opinion of Mark Jones Typing haskell in haskell?
http://web.cecs.pdx.edu/~mpj/thih/TypingHaskellInHaskell.html

[Note This is to add to the question more than the answer]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread Stephen Tetley
There is a summary paper by Sunil Kothari and James L. Cladwell
covering the algorithms M, J and W with informal presentations plus
code available in Ocaml. Paper is on Citeseer, code is available from
Sunil Kothari's home page.

Martin Grabmueller has a tutorial implementation of algorithm W in Haskell:

http://www.grabmueller.de/martin/www/pub/pub.en.html

On 18 January 2013 10:06, Petr P petr@gmail.com wrote:
   Dear Haskellers,

 could somebody recommend me study materials for learning Hindley-Milner type
 inference algorithm I could recommend to undergraduate students?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] resources for learning Hindley-Milner type inference for undergraduate students

2013-01-18 Thread oleg

Petr Pudlak wrote:
 could somebody recommend me study materials for learning Hindley-Milner
 type inference algorithm I could recommend to undergraduate students? 

Perhaps you might like a two-lecture course for undergraduates, which
uses Haskell throughout

http://okmij.org/ftp/Haskell/AlgorithmsH.html#teval

It explained HM type inference in a slightly different way, strongly
emphasizing type inference as a non-standard interpretation. The
second main idea was relating polymorphism and `inlining' (copying).
Type schemas were then introduced as an optimization, to inlining. It
becomes clear why it is unsound to infer a polymorphic type for ref
[]: expressions of polymorphic types are always inlined (conceptually,
at least), which goes against the dynamic semantics of reference
cells.

The lectures also show how to infer not only the type but also the
type environment. This inference helps to make the point that `tests'
cannot replace typing. We can type check open expressions (and infer
the minimal environment they make sense to use in). We cannot run
(that is, dynamically check) open expressions.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe