diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-11-09 11:34:04 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-11-09 11:34:04 +0100 |
commit | 2b1562d33bb9496aa449ef9d52735af0ec61c15c (patch) | |
tree | 77aa4f3195b1493828e3c82c9bae4b419ba27c64 /src/AST.hs | |
parent | 992249ebf159ba3783a9345430013e52294c26aa (diff) |
Some more primitive operators
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |