File: lopstr07.curry

package info (click to toggle)
curry-tools 1.0.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 121
  • sloc: makefile: 470; sh: 421
file content (17 lines) | stat: -rw-r--r-- 433 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- This example has been taken from:
--   Sebastian Fischer and Josep Silva and Salvador Tamarit and Germ{\'{a}}n Vidal}:
--   Preserving Sharing in the Partial Evaluation of Lazy Functional Programs,
--   LOPSTR 2007
import External (e1)

sumList []     = 0
sumList (x:xs) = x + sumList xs

incList _ []     = []
incList n (x:xs) = (x + n) : incList n xs

e = e1 + 42

goal a b = PEVAL (sumList (incList e [a, b]))

main = goal 1 2