File: length_app.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 (18 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import Profile

data Nat = Z | S Nat

length2 [] = Z
length2 (x:xs) = S (length2 xs)

append [] ys = ys
append (x:xs) ys = x:(append xs ys)

goal xs ys = PEVAL (length2 (append xs ys))

main = goal [1..10] [11..20]

benchmark = do
  let l1,l2 free
  doSolve (l1 =:= [1..200000] &> l2 =:= [1..1000])
  profileTimeNF (goal l1 l2)