[make kind inference handle newtypes of unboxed values properly.
John Meacham <john@repetae.net>**20120123090834
 Ignore-this: a5cc0b45292bd999c1acded83c7df028
] hunk ./src/DataConstructors.hs 339
-            Constructor { conOrigSlots = [SlotNormal st@(ELit LitCons { litName = n, litArgs = []})] } <- getConstructor cn dataTable
+            Constructor { conOrigSlots = [SlotNormal st] } <- getConstructor cn dataTable
+            (ELit LitCons { litName = n, litArgs = []}) <- return $ followAliases dataTable st
hunk ./src/DataConstructors.hs 357
-            Constructor { conOrigSlots = [SlotNormal st@(ELit LitCons { litName = n, litArgs = []})] } <- getConstructor cn dataTable
+            Constructor { conOrigSlots = [SlotNormal st] } <- getConstructor cn dataTable
+            (ELit LitCons { litName = n, litArgs = []}) <- return $ followAliases dataTable st
hunk ./src/FrontEnd/KindInfer.hs 387
-kiDecl HsNewTypeDecl { hsDeclContext = context, hsDeclName = tyconName, hsDeclArgs = args, hsDeclCon = condecl } = kiData context tyconName args [condecl]
+kiDecl HsNewTypeDecl { hsDeclContext = context, hsDeclName = tyconName, hsDeclArgs = args, hsDeclCon = condecl } = kiAlias context tyconName args condecl
hunk ./src/FrontEnd/KindInfer.hs 418
+kiAlias context tyconName args condecl = do
+    args <- mapM (lookupKind KindSimple . toName TypeVal) args
+    kc <- lookupKind KindAny (toName TypeConstructor tyconName)
+    let [a] = hsConDeclArgs condecl
+    va <- newKindVar KindQuestQuest
+    kiType (KVar va) (hsBangType a)
+    kiApps' kc args (KVar va)
+    mapM_ kiPred context
+
hunk ./src/FrontEnd/KindInfer.hs 568
-