File: value-type-function3.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 (10 lines) | stat: -rw-r--r-- 281 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
-- We can not even use a lifted type parameter as the result type of a
-- condition even if it's not actually instantiated with a function type.
-- ==
-- error:

def cond '^a (b : bool) (x : a) (y : a) : a =
  if b then x else y

def main (b : bool) (x : i32) : i32 =
  cond b x 0