<p>I was reading a research paper about Haskell and how HList is implemented and wondering when the techniques described are and are not decidable for the type checker.  Also, because you can do similar things with GADTs, I was wondering if GADT type checking is always decidable.</p>

<p>I would prefer citations if you have them so I can read/understand the explanations.</p>

<p>Thanks!</p>

[{'answer_id': 51518, 'author': 'Nick Fortescue', 'author_id': 5346, 'author_profile': 'https://Stackoverflow.com/users/5346', 'pm_score': 1, 'selected': False, 'text': '<p>You\'ve probably already seen this but there are a collection of papers on this issue at Microsoft research: <a href="http://research.microsoft.com/~simonpj/papers/assoc-types/" rel="nofollow noreferrer">Type Checking papers</a>. The first one describes the decidable algorithm actually used in the Glasgow Haskell compiler.</p>\n'}, {'answer_id': 125852, 'author': 'Jude Allred', 'author_id': 1388, 'author_profile': 'https://Stackoverflow.com/users/1388', 'pm_score': 4, 'selected': True, 'text': "<p>I believe GADT type checking is always decidable; it's inference which is undecidable, as it requires higher order unification.  But a GADT type checker is a restricted form of the proof checkers you see in eg. Coq, where the constructors build up the proof term.  For example, the classic example of embedding lambda calculus into GADTs has a constructor for each <em>reduction rule</em>, so if you want to find the normal form of a term, you have to tell it which constructors will get you to it.  The halting problem has been moved into the user's hands :-)</p>\n"}]
['https://Stackoverflow.com/questions/48905', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5113/']