File: shape-params7.fut

package info (click to toggle)
haskell-futhark 0.25.27-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 17,836 kB
  • sloc: haskell: 99,384; ansic: 12,821; python: 3,394; yacc: 783; javascript: 558; sh: 550; lisp: 395; makefile: 263
file content (11 lines) | stat: -rw-r--r-- 230 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
-- ==
-- input { [1,2,3] }
-- output { [1,2,3] }

def inc (x: i64) = x + 1

def tail [n] 't (A: [inc n]t) = A[1:] :> [n]t

def cons [n] 't (x: t) (A: [n]t): [inc n]t = [x] ++ A :> [inc n]t

def main (xs: []i32) = tail (cons 2 xs)