Options

Question 1.1 - Functions in mathematics and Haskell

Functions in mathematics and Haskell.

Suppose \(f : Int \to Int \) sends an integer to its square, \(f(x) := x^2 \) and that \(g : Int \to Int \) sends an integer to its successor, \(g(x) := x+ 1\).

(a) Write \(f \) and \(g \) in Haskell, including their type signature and their implementation.

(b) Let \(h := f◦g \). What is \(h(2) \)?

(c) Let \(i := f ; g \). What is \(i(2) \)?

Sign In or Register to comment.