Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2019/functional-programming-design-and-analysis-of-algorithms/1/f/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2019 Functional programming, design and analysis of algorithms 1 f Solution by
Codex 0 2026-10-25
Assign and . The application
s y x forces for a fresh type ; applying f to that result forces . No further equations identify these four type variables. The principal type is thereforek :: (u -> v -> w) -> v -> (w -> r) -> u -> r
k s x f y = f (s y x)Every compatible typing is an instance of this one, because type inference imposed precisely the two application constraints and no class constraints.
New to topics? Read the docs here!