20-CS-4003-001 Organization of Programming Languages Fall 2018
Lab Assignment 10

Lambda calculus, Type theory, Formal semantics, Program analysis

Types and functions

Due: 12 November, 2018 (submit instructions: here)

    Understand the basic mechanisms of haskell.
Lab Problem (two parts):
1. What type is this list?:
   higgins = ["The", "rain", "in", "spain", "falls", "mainly", "on", "the", "plain"]

2. Create a haskell function that solves the fractional Knapsack problem. Input is of the form:

   [("label 1", value, weight), ("label 2", value, weight), ...]
and output is of the form:
   [("label 1", value, solution_weight), ("label 2", value, solution_weight), ...]

Remember when writing these to observe the offside or `layout' rule for function scope i.e. "Always indent. When the compiler complains, indent more."

See this link for a description of the fractional knapsack problem and examples.