diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2024-12-12 16:30:42 +0100 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2024-12-12 16:30:42 +0100 |
commit | f323076ddf6fbea9f7a1a4dfeec98629459c49fc (patch) | |
tree | d19137df436ac388c79bffe55df4a1b9b29316a8 /src/AST.hs | |
parent | fad10d5a218f935d47e8b9dc41256a30b4ec540d (diff) |
Somewhat working Compile
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -175,6 +175,25 @@ data SOp a t where OIDiv :: ScalIsIntegral a ~ True => SScalTy a -> SOp (TPair (TScal a) (TScal a)) (TScal a) deriving instance Show (SOp a t) +opt1 :: SOp a t -> STy a +opt1 = \case + OAdd t -> STPair (STScal t) (STScal t) + OMul t -> STPair (STScal t) (STScal t) + ONeg t -> STScal t + OLt t -> STPair (STScal t) (STScal t) + OLe t -> STPair (STScal t) (STScal t) + OEq t -> STPair (STScal t) (STScal t) + ONot -> STScal STBool + OAnd -> STPair (STScal STBool) (STScal STBool) + OOr -> STPair (STScal STBool) (STScal STBool) + OIf -> STScal STBool + ORound64 -> STScal STF64 + OToFl64 -> STScal STI64 + ORecip t -> STScal t + OExp t -> STScal t + OLog t -> STScal t + OIDiv t -> STPair (STScal t) (STScal t) + opt2 :: SOp a t -> STy t opt2 = \case OAdd t -> STScal t |