packages feed

ivory-examples 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+22/−2 lines, 2 files

Files

+ examples/Array.hs view
@@ -0,0 +1,19 @@+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE DataKinds #-}++module Array where++import Ivory.Language+import Ivory.Compile.C.CmdlineFrontend++cmodule :: Module+cmodule = package "Array" $ incl arrayExample++runArrayExample :: IO ()+runArrayExample = runCompiler [cmodule] initialOpts { stdOut = True }++arrayExample :: Def('[Ref s (Array 4 (Stored Uint8)), Uint8] :-> ())+arrayExample = proc "arrayExample" $ \arr n -> body $ do+  arrayMap $ \ ix -> do+    v <- deref (arr ! ix)+    store (arr ! ix) (v + n)
ivory-examples.cabal view
@@ -1,5 +1,5 @@ name:                ivory-examples-version:             0.1.0.0+version:             0.1.0.1 author:              Galois, Inc maintainer:          trevor@galois.com copyright:           2013 Galois, Inc.@@ -14,7 +14,7 @@ source-repository    this   type:     git   location: https://github.com/GaloisInc/ivory-  tag:      hackage-examples-0100+  tag:      hackage-examples-0101   executable ivory-fibtutorial@@ -49,6 +49,7 @@                         PublicPrivate,                         Bits,                         SizeOf,+                        Array,                         AddrOfRegression,                         QC   hs-source-dirs:       examples