From 5613648bb3cac621700eb3e4ddae87180a6fec21 Mon Sep 17 00:00:00 2001 From: Paul Chiusano Date: Tue, 3 Mar 2015 22:50:37 -0500 Subject: [PATCH] annotating type of builtin + function --- node/src/Node.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/node/src/Node.hs b/node/src/Node.hs index 8737f2cf2..a9df241e9 100644 --- a/node/src/Node.hs +++ b/node/src/Node.hs @@ -41,13 +41,16 @@ builtins = , let r = R.Builtin "Number.minus" in (r, numeric2 (Term.Ref r) (-), t) , let r = R.Builtin "Number.times" in (r, numeric2 (Term.Ref r) (*), t) , let r = R.Builtin "Number.divide" in (r, numeric2 (Term.Ref r) (/), t) ] - where num = Type.Unit Type.Number - arr = Type.Arrow - t = num `arr` num `arr` num + where t = numopTyp + +num = Type.Unit Type.Number +arr = Type.Arrow +numopTyp = num `arr` num `arr` num builtinMetadatas :: Node IO R.Reference Type Term -> N.Noted IO () builtinMetadatas node = do Node.updateMetadata node (R.Builtin "Number.plus") md + Store.annotateTerm store (R.Builtin "Number.plus") numopTyp where md = Metadata Metadata.Term (Metadata.Names [Metadata.Symbol "+" Metadata.InfixL 4 ]) []