update to use Control.GArrow instead of GHC.HetMet.GArrow
[coq-hetmet.git] / examples / VerilogDemo.hs
diff --git a/examples/VerilogDemo.hs b/examples/VerilogDemo.hs
new file mode 100644 (file)
index 0000000..9c0b4fd
--- /dev/null
@@ -0,0 +1,9 @@
+{-# OPTIONS_GHC -XModalTypes -fflatten -funsafe-skolemize -dcore-lint -XScopedTypeVariables -fsimpleopt-before-flatten -XKindSignatures #-}
+module VerilogDemo (oscillator) where
+
+oscillator :: <[ (w,()) ~~> w ]>@a -> <[ (w,(w,())) ~~> w ]>@a -> <[ (w,()) ~~> w ]>@a
+oscillator reg xor =
+  <[ \input ->
+        let output  = ~~xor input delayed
+            delayed = ~~reg output
+        in output ]>