Skip to content
Browse files

Eq is not implied by Num in GHC 7.4.

  • Loading branch information...
1 parent fd2929d commit c5bd3bbf039255131e8de46bd686b4c77d48db26 LeePike committed Feb 12, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 Examples/Examples.hs
View
15 Examples/Examples.hs
@@ -47,6 +47,19 @@ foo = do
trigger "trigger" true [arg $ x < 3]
observer "debug_x" x
+latch :: Stream Bool -> Stream Bool
+latch x = out
+ where out = if x then not st else st
+ st = [False] ++ out
+
+latch' :: Stream Bool -> Stream Bool
+latch' x = out
+ where out = x `xor` st
+ st = [False] ++ out
+
+ext :: Stream Word8
+ext = [1] ++ ext + extern "e0" (Just [2,4..])
+
-}
flipflop :: Stream Bool -> Stream Bool
@@ -63,7 +76,7 @@ even x = x `mod` 2 == 0
odd :: (P.Integral a, Typed a) => Stream a -> Stream Bool
odd = not . even
-counter :: (Num a, Typed a) => Stream Bool -> Stream a
+counter :: (Eq a, Num a, Typed a) => Stream Bool -> Stream a
counter reset = y
where
zy = [0] ++ y

0 comments on commit c5bd3bb

Please sign in to comment.
Something went wrong with that request. Please try again.