mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-14 16:28:34 +03:00
annotating type of builtin + function
This commit is contained in:
parent
5e209234bf
commit
5613648bb3
@ -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 ])
|
||||
[]
|
||||
|
Loading…
Reference in New Issue
Block a user