File: value-type-function4.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-- 311 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
-- A value type parameter of a polymorphic function cannot be instantiated to a
-- function type by passing the function as an argument to another function.
-- ==
-- error: functional

def app (f : (i32 -> i32) -> (i32 -> i32)) : i32 =
  f (\(x:i32) -> x+x) 42

def id 'a (x:a) : a = x

def main : i32 = app id