summaryrefslogtreecommitdiff
path: root/src/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-11-09 11:34:04 +0100
committerTom Smeding <tom@tomsmeding.com>2024-11-09 11:34:04 +0100
commit2b1562d33bb9496aa449ef9d52735af0ec61c15c (patch)
tree77aa4f3195b1493828e3c82c9bae4b419ba27c64 /src/AST.hs
parent992249ebf159ba3783a9345430013e52294c26aa (diff)
Some more primitive operators
Diffstat (limited to 'src/AST.hs')
-rw-r--r--src/AST.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/AST.hs b/src/AST.hs
index 28c5b37..e3da634 100644
--- a/src/AST.hs
+++ b/src/AST.hs
@@ -169,6 +169,9 @@ data SOp a t where
OIf :: SOp (TScal TBool) (TEither TNil TNil) -- True is Left, False is Right
ORound64 :: SOp (TScal TF64) (TScal TI64)
OToFl64 :: SOp (TScal TI64) (TScal TF64)
+ ORecip :: ScalIsFloating a ~ True => SScalTy a -> SOp (TScal a) (TScal a)
+ OExp :: ScalIsFloating a ~ True => SScalTy a -> SOp (TScal a) (TScal a)
+ OLog :: ScalIsFloating a ~ True => SScalTy a -> SOp (TScal a) (TScal a)
deriving instance Show (SOp a t)
opt2 :: SOp a t -> STy t
@@ -185,6 +188,9 @@ opt2 = \case
OIf -> STEither STNil STNil
ORound64 -> STScal STI64
OToFl64 -> STScal STF64
+ ORecip t -> STScal t
+ OExp t -> STScal t
+ OLog t -> STScal t
typeOf :: Expr x env t -> STy t
typeOf = \case