copilot-language 0.5 → 0.6
raw patch · 3 files changed
+5/−5 lines, 3 files
Files
- copilot-language.cabal +1/−1
- src/Copilot/Language/Operators/Cast.hs +1/−1
- src/Copilot/Language/Stream.hs +3/−3
copilot-language.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: copilot-language-version: 0.5+version: 0.6 synopsis: A Haskell-embedded DSL for monitoring hard real-time distributed systems. description:
src/Copilot/Language/Operators/Cast.hs view
@@ -23,7 +23,7 @@ -------------------------------------------------------------------------------- -castBool :: (Num a, Typed a) => Stream Bool -> Stream a+castBool :: (Eq a, Num a, Typed a) => Stream Bool -> Stream a castBool (Const bool) = Const $ if bool then 1 else 0 castBool x = Op3 (C.Mux typeOf) x 1 0
src/Copilot/Language/Stream.hs view
@@ -64,7 +64,7 @@ -------------------------------------------------------------------------------- -instance (Typed a, Eq a, Num a) => Num (Stream a) where+instance (Typed a, P.Eq a, Num a) => Num (Stream a) where (Const x) + (Const y) = Const (x + y) (Const 0) + y = y x + (Const 0) = x@@ -93,7 +93,7 @@ -- XXX we may not want to precompute these if they're constants if someone is -- relying on certain floating-point behavior.-instance (Typed a, Fractional a) => Fractional (Stream a) where+instance (Typed a, P.Eq a, Fractional a) => Fractional (Stream a) where (/) = Op2 (Core.Fdiv typeOf) recip (Const x) = Const (recip x)@@ -105,7 +105,7 @@ -- XXX we may not want to precompute these if they're constants if someone is -- relying on certain floating-point behavior.-instance (Typed a, Floating a) => Floating (Stream a) where+instance (Typed a, Eq a, Floating a) => Floating (Stream a) where pi = Const pi exp = Op1 (Core.Exp typeOf) sqrt = Op1 (Core.Sqrt typeOf)