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

perm []     = []
perm (x:xs) = insert x (perm xs)

insert x ys     = x : ys
insert x (y:ys) = y : insert x ys

head (x:_) = x

goal xs = PEVAL (head (perm xs))

main = goal [1..10]

benchmark = do
  let l free
  doSolve (l =:= [1 .. 10000])
  profileTimeNF $ unsafePerformIO $ values2list $ set1 goal l