X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=src%2FHaskWeakToCore.v;h=290d6341344c8f80f03d266b2a1fe30e7cc70643;hp=39871a3ef33f93ccb4e968ce4c681482807c0f05;hb=034f7e7856bebbbcb3c83946aa603c640b17f3bb;hpb=c9a110c17f24f89f0375c3207b7c544e87a3cee8 diff --git a/src/HaskWeakToCore.v b/src/HaskWeakToCore.v index 39871a3..290d634 100644 --- a/src/HaskWeakToCore.v +++ b/src/HaskWeakToCore.v @@ -31,9 +31,6 @@ Variable mkUnsafeCoercion : CoreType -> CoreType -> CoreCoercion. Variable coreCoercionsAreReallyTypes : CoreCoercion -> CoreType. Extract Inlined Constant coreCoercionsAreReallyTypes => "(\x -> x)". -Variable ModalBoxTyCon : TyCon. Extract Inlined Constant ModalBoxTyCon => "TysWiredIn.hetMetCodeTypeTyCon". -Variable ArrowTyCon : TyCon. Extract Constant ArrowTyCon => "Type.funTyCon". - Definition weakAltConToCoreAltCon (wa:WeakAltCon) : CoreAltCon := match wa with | WeakDataAlt cdc => DataAlt cdc @@ -60,10 +57,8 @@ Fixpoint weakTypeToCoreType (wt:WeakType) : CoreType := (weakTypeToCoreType t3) end. -Definition weakCoercionToCoreCoercion (wc:WeakCoercion) : CoreCoercion. - admit. - Defined. - (*mkUnsafeCoercion (weakTypeToCoreType (fst (weakCoercionTypes wc))) (weakTypeToCoreType (snd (weakCoercionTypes wc))).*) +Definition weakCoercionToCoreCoercion (wc:WeakCoercion) : CoreCoercion := + mkUnsafeCoercion (weakTypeToCoreType (fst (weakCoercionTypes wc))) (weakTypeToCoreType (snd (weakCoercionTypes wc))). Fixpoint weakExprToCoreExpr (me:WeakExpr) : @CoreExpr CoreVar := match me with @@ -97,8 +92,8 @@ Fixpoint weakExprToCoreExpr (me:WeakExpr) : @CoreExpr CoreVar := nil) (CoreEVar v) | WELet (weakExprVar v _) ve e => mkCoreLet (CoreNonRec v (weakExprToCoreExpr ve)) (weakExprToCoreExpr e) - | WECase vscrut e tbranches tc types alts => - CoreECase (weakExprToCoreExpr e) vscrut (weakTypeToCoreType tbranches) + | WECase vscrut escrut tbranches tc types alts => + CoreECase (weakExprToCoreExpr escrut) vscrut (weakTypeToCoreType tbranches) (sortAlts (( fix mkCaseBranches (alts:Tree ??(WeakAltCon*list WeakTypeVar*list WeakCoerVar*list WeakExprVar*WeakExpr)) :=