diff options
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 |