Table of Contents

Programming Paradigms project

Idea: Tiny Analytics Engine in Haskell

Datasets

The dataset consists of course grades of a real lecture (the names have been changed). The dataset has the following problems:

The query language to be implemented is shown below:

data Query =
  FromCSV String                                     -- extract a table
   | ToCSV Query
   | AsList Query                                 -- a column is turned into a list of values
   | forall a. Filter (FilterCondition a) Query
   | Sort String Query                            -- sort by column-name interpreted as integer. 
   | ValueMap (QVal -> QVal) Query
   | RowMap ([QVal]->QVal) Query
   | TableJoin QKey Query Query                    -- table join according to specs
   | Projection [QVal] Query
   | Cartesian ([QVal] -> [QVal] -> [QVal]) [QVal] Query Query 
   | Graph EdgeOp Query
 
   | VUnion Query Query                           -- adds new rows to the DS (table heads should coincide)
   | HUnion Query Query                           -- 'horizontal union qlues' with zero logic more columns. TableJoin is the smart alternative
   | NameDistanceQuery                            -- dedicated name query
 
data QResult = CSV String | Table [[String]] | List [String]

Task Set 1 (Introduction)

One dataset (exam points) is presented parsed as a matrix in a stub Haskell file.

Task Set 2 (Input/Output)

In Haskell, we will represent the DS as a String. We will refine this strategy later. As with CSVs, we will make no distinction between the column head, and the rest of the rows.

Task Set 3 (Matrix)

Task Set 4 (ATD)

Task Set 5 (table join)

Task Set 6 (typos)

Task Set 7 (data visualisation)