@@ -663,12 +663,25 @@ process h fn (Eval t)
663 tyDoc = pprintDelab ist ty'
663 tyDoc = pprintDelab ist ty'
664 ihPrintTermWithType h tmDoc tyDoc
664 ihPrintTermWithType h tmDoc tyDoc
666−process h fn (NewDefn name val)
666+process h fn (NewDefn fc (tyDecl:decls))
667+ | isTyDecl tyDecl = do
668+ elabDecl EAll toplevel tyDecl
669+ name <- getName tyDecl
670+ logLvl 3 $ "Defining " ++ show name ++ " with this type decl: " ++ show tyDecl
671+ logLvl 5 $ "Using this definition: " ++ show decls
672+ elabClauses toplevel fc [] name defn
673+ where getName (PTy docs argdocs syn fc opts name ty) = return name
674+ getName _ = fail "New definitions must begin with a type declaration"
675+ isTyDecl PTy{} = True
677+ defn = concatMap getClauses decls
678+ getClauses (PClauses fc opts name clauses) = clauses
667− = do (tm, ty) <- elabVal toplevel False val
680+ -- = do (tm, ty) <- elabVal toplevel False val
668− ctxt <- getContext
681+ -- ctxt <- getContext
669− let tm' = force (normaliseAll ctxt [] tm)
682+ -- let tm' = force (normaliseAll ctxt [] tm)
670− let ty' = force (normaliseAll ctxt [] ty)
683+ -- let ty' = force (normaliseAll ctxt [] ty)
671− updateContext (addCtxtDef name (Function ty' tm'))
684+ -- updateContext (addCtxtDef name (Function ty' tm'))
673process h fn (ExecVal t)
686process h fn (ExecVal t)
674 = do ctxt <- getContext
687 = do ctxt <- getContext