hindley-milner

What is Hindley-Milner?

I encountered this term "Hindley-Milner" which I'm not sure if grasp what it means. I read Steve Yegge's "Dynamic Languages Strike Back" and "The Pinocchio Problem" and Daniel Spiewak's "What is Hindley-Milner? (and why is it cool?)". But there is no single entry for this term in wikipedia where usually offers me a concise explanation. ...

Describe the Damas-Milner type inference in a way that a CS101 student can understand

Hindley-Milner is a type system that is the basis of the type systems of many well known functional programming languages. Damas-Milner is an algorithm that infers (deduces?) types in a Hindley-Milner type system. Wikipedia gives a description of the algorithm which, as far as I can tell, amounts to a single word: "unification." Is ...

What are the limits of type inference?

What are the limits of type inference? Which type systems have no general inference algorithm? ...

Inferred type appears to detect an infinite loop, but what's really happening?

In Andrew Koenig's An anecdote about ML type inference, the author uses merge sort as a learning exercise for ML and is pleased to find an "incorrect" type inference: Much to my surprise, the compiler reported a type of 'a list -> int list In other words, this sort function accepts a list of any type at all and returns a list ...

What causes this Standard-ML type error?

I was trying to make a tail-recursive version of this very simple SML function: fun suffixes [] = [[]] | suffixes (x::xs) = (x::xs) :: suffixes xs; During the course of this, I was using type annotations on the paramaters. The following code shows this, and causes a type error (given below), whereas if I simply remove the type annot...

Damas-Hindley-Milner type inference algorithm implementation

I'm looking for information about the well-known Damas-Hindley-Milner algorithm to do type inference for functional languages, especially information about implementation. I already know how to do the W-algorithm, but I heard about recent new algorithms based on constraint generator/solver rather than usual unification. However, I can't...

What makes Haskell's type system more "powerful" than other languages' type systems?

Reading Disadvantages of Scala type system versus Haskell?, I have to ask: what is it, specifically, that makes Haskell's type system more powerful than other languages' type systems (C, C++, Java). Apparently, even Scala can't perform some of the same powers as Haskell's type system. What is it, specifically, that makes Haskell's type s...

Keeping type generic without η-expansion

What I'm doing: I'm writing a small interpreter system that can parse a file, turn it into a sequence of operations, and then feed thousands of data sets into that sequence to extract some final value from each. A compiled interpreter consists of a list of pure functions that take two arguments: a data set, and an execution context. Each...