> tracesplitter' :: Bool -> Exp -> Exp -> NameL (Exp,[Rule]) > -> NameL (Exp,[Rule]) > tracesplitter' fflex arg term splitterres > = trace ("splitting "++showExp arg++" from "++showExp term++"\n") $ > do res <- splitterres > let (f,rules) = res > trace ("result function: "++showExp f++" rules: "++showRules rules++"\n") $ return res > tracesplitter :: AppSplitter -> AppSplitter > tracesplitter appsplitter fflex arg term > = tracesplitter' fflex arg term (appsplitter fflex arg term) > showRule (Rule (p,t)) = showExp p ++ " => " ++ showExp t > showRules rules = show (map showRule rules) createexpfromtype :: Type -> NameL (LamBind,Exp) createexpfromtype typ@(TCon ('T':'u':'p':'l':'e':_) ts) = (LamTup ps, Tupl es typ) where (ps,es)