diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-11-10 10:04:27 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-11-10 10:04:27 +0100 |
commit | 42d59947356ab51e5a4070b930f02f4909208d35 (patch) | |
tree | 3c8afab888e61c4e3157a257f0a40ae2fd4eb9c1 /src/Interpreter.hs | |
parent | 33e0ed21603cbd85d6aba6548811db27480647db (diff) |
Complete GMM implementation
Diffstat (limited to 'src/Interpreter.hs')
-rw-r--r-- | src/Interpreter.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Interpreter.hs b/src/Interpreter.hs index 576b0d9..37d4a83 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -173,6 +173,7 @@ interpretOp op arg = case op of ORecip st -> floatingIsFractional st $ recip arg OExp st -> floatingIsFractional st $ exp arg OLog st -> floatingIsFractional st $ log arg + OIDiv st -> integralIsIntegral st $ uncurry div arg where styIsEq :: SScalTy t -> (Eq (Rep (TScal t)) => r) -> r styIsEq STI32 = id @@ -526,10 +527,14 @@ numericIsNum STI64 = id numericIsNum STF32 = id numericIsNum STF64 = id -floatingIsFractional :: ScalIsFloating st ~ True => SScalTy st -> ((Floating (ScalRep st), Ord (ScalRep st), ScalIsNumeric st ~ True) => r) -> r +floatingIsFractional :: ScalIsFloating st ~ True => SScalTy st -> ((Floating (ScalRep st), Ord (ScalRep st), ScalIsNumeric st ~ True, ScalIsFloating st ~ True) => r) -> r floatingIsFractional STF32 = id floatingIsFractional STF64 = id +integralIsIntegral :: ScalIsIntegral st ~ True => SScalTy st -> ((Integral (ScalRep st), Ord (ScalRep st), ScalIsNumeric st ~ True, ScalIsIntegral st ~ True) => r) -> r +integralIsIntegral STI32 = id +integralIsIntegral STI64 = id + unTupRepIdx :: f Z -> (forall m. f m -> Int -> f (S m)) -> SNat n -> Rep (Tup (Replicate n TIx)) -> f n unTupRepIdx nil _ SZ _ = nil |