File: AddMult.hs

package info (click to toggle)
haskell-copilot 3.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 140 kB
  • sloc: haskell: 452; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- Copyright © 2019 National Institute of Aerospace / Galois, Inc.

-- | Another small example that calculates a constant value using a recursive
-- function.

module Main where

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)

main :: IO ()
main = interpret 100 spec