Name: csv-workshop
Owner: Underscore
Description: Functional programming workshop exploring the magical domain of CSV parsing.
Created: 2016-02-19 11:06:38.0
Updated: 2016-02-19 11:07:09.0
Pushed: 2016-02-19 11:07:08.0
Homepage: null
Size: 150
Language: Scala
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A programming workshop exploring functional programming design patterns via the exciting real-world problem domain of CSV parsing.
Workshop Copyright 2016 Dave Gurnell of Underscore. Licensed CC-BY-NC-SA 4.0.
Cities and countries sample data Copyright Statistics Finland.
The workshop will be split into three stages:
Initial discussion (10 minutes).
Discuss the problem as a group and split everyone into teams.
Development (80 minutes)
Each team writes a library to satisfy the design brief (or get as far as they can in the time).
Presentation (30 minutes)
Each team presents its design decisions; we discuss different approaches.
As part of a strategic push towards cutting edge technology, our CTO at Acme Widgets Pty Ltd has recommended that we migrate all of our existing and new IT infrastructure to an exciting new data interchange format called “Comma Separated Values” (aka “CSV”).
Your team has been tasked with building a library to read CSV files. Other teams will use your reader to import CSV data into their Scala applications as well-typed objects.
Feel free to use any general purpose functional programming libraries in your solution. However, do not use any libraries with CSV-specific functionality other than those provided.
The important characteristics of CSV are:
An MVP CSV reader should read a CSV file as a list of records of a type A
.
Users of the library can specify the type A
and how it maps to the CSV data.
The reader should interpret the CSV data, try to parse it appropriately,
and report errors wherever it is unable to do so.
You have been given a low-level CSV parser to get you started.
This turns raw CSV data into a List[List[String]]
ready for transformation by your library.
See LowLevelParser.scala
and LowLevelParserSpec.scala
for examples.
You have also been given two example CSV files for testing purposes:
src/main/resources/cities.csv
and src/main/resources/countries.csv
.
You can load these using the parseCsvResource
method in LowLevelParser
.
A basic CSV reader library will:
A strong CSV reader library will also: