Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (26 sloc) 0.831 kb
d636587 @leepike Moving examples over from sub-packages.
authored
1 --------------------------------------------------------------------------------
2 -- Copyright © 2011 National Institute of Aerospace / Galois, Inc.
3 --------------------------------------------------------------------------------
4
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
5 -- | Another small example.
d636587 @leepike Moving examples over from sub-packages.
authored
6
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
7 module AddMult ( addMult ) where
d636587 @leepike Moving examples over from sub-packages.
authored
8
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
9 import Prelude ()
68cc043 @leepike Clean up imports.
authored
10 import Language.Copilot
d636587 @leepike Moving examples over from sub-packages.
authored
11
12 --------------------------------------------------------------------------------
13
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
14 spec :: Spec
15 spec =
16 trigger "f" true [ arg $ mult 5 ]
d636587 @leepike Moving examples over from sub-packages.
authored
17
18 where
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
19 mult :: Word64 -> Stream Word64
20 mult 0 = 1
21 mult i = constant i * mult (i-1)
22
23 addMult :: IO ()
24 addMult = do
25 putStrLn "PrettyPrinter:"
26 putStrLn ""
27 prettyPrint spec
28 putStrLn ""
29 putStrLn ""
30 putStrLn "Interpreter:"
31 putStrLn ""
32 interpret 100 spec
d636587 @leepike Moving examples over from sub-packages.
authored
33
34
77885d8 @leepike Major update of examples, fixing them up. Not done!
authored
35 --------------------------------------------------------------------------------
Something went wrong with that request. Please try again.