nponeccop / HNC

HN Compiler
GNU Lesser General Public License v3.0
62 stars 5 forks source link

Integrate monomorphization into Checker #27

Open nponeccop opened 12 years ago

nponeccop commented 12 years ago

If a polymorphic definition is used only monomorphically (e.g. id x = x is only fed ints) its @definitionType should be int->int and not forall a . a -> a.

Note that function monomorphization can be applied to individual arguments. E.g. apply f x = f x can be monomorphized in x but not in f, e.g. (int -> a) -> int -> a