X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=CoreTools.hs;h=b08f3ce9897d65b607c14a7ed3db2ed8eca195ad;hb=6fffdcf32a54a6372442d22a87537ee9733073ad;hp=3c26793c8c804ce7f9dd7262851565398638195d;hpb=98734f52c51081459172bd28c0913162264cf3e5;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/CoreTools.hs b/CoreTools.hs index 3c26793..b08f3ce 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -142,3 +142,8 @@ is_applicable expr = is_fun expr || is_poly expr -- Does the given CoreExpr have any free type vars? has_free_tyvars :: CoreSyn.CoreExpr -> Bool has_free_tyvars = not . VarSet.isEmptyVarSet . (CoreFVs.exprSomeFreeVars Var.isTyVar) + +-- Turns a Var CoreExpr into the Id inside it. Will of course only work for +-- simple Var CoreExprs, not complexer ones. +exprToVar :: CoreSyn.CoreExpr -> Var.Id +exprToVar (CoreSyn.Var id) = id