Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (26 sloc) 0.831 kb
--------------------------------------------------------------------------------
-- Copyright © 2011 National Institute of Aerospace / Galois, Inc.
--------------------------------------------------------------------------------
-- | Another small example.
module AddMult ( addMult ) where
import Prelude ()
import Language.Copilot
--------------------------------------------------------------------------------
spec :: Spec
spec =
trigger "f" true [ arg $ mult 5 ]
where
mult :: Word64 -> Stream Word64
mult 0 = 1
mult i = constant i * mult (i-1)
addMult :: IO ()
addMult = do
putStrLn "PrettyPrinter:"
putStrLn ""
prettyPrint spec
putStrLn ""
putStrLn ""
putStrLn "Interpreter:"
putStrLn ""
interpret 100 spec
--------------------------------------------------------------------------------
Jump to Line
Something went wrong with that request. Please try again.