Functional Programming in Scala – Week 6

Week 6 was the second last week in the course and focused on Collections. For collections that are not generally going to have linear type access, Vectors are a more apt collection. Using the Sequence classes allows the inheritance on useful operations: Week 6 Lectures Week 6 assignment source (again this was a quick and dirty job and is far from complete marks)  

Functional Programming in Scala – Week 5

Week 5 – Lists, investigate a ‘fundamental’ data structure in functional programming. The recursive nature of lists in Scala makes them quite different from arrays. This tied in with the power of pattern matching and the recursive nature of function programming gives credibility to the ‘fundamental’ label. Sorting of lists was covered in good detail and in addition to list1.head and list1.tail more functions were revealed: Week 5 Lectures Week 4 and.. Read More

Functional Programming in Scala – Week 4

Week 4 continued to delve into polymorphism with a focus on Types and Pattern Matching. Generalizing functions to accept multiple parameter types is a clear highlight of Scala. Pattern matching was a topic of week 4 that was used in every subsequent week. Case statement with pattern matching appears to be another staple of Scala.

Week 4 lectures Week 4’s assignment of implementing the Huffman coding compression algorithm was a good.. Read More

Functional Programming in Scala – Week 3

Week 3 looked at the object oriented aspects of Scala. The evaluation of encapsulated data was the most interesting part of week 3, The lectures went into details about some more of the ‘syntactic sugar’ of Scala. Abstraction of classes in Scala was explained clearly in the lectures too. The assignment for week 3 demonstrated Scala’s ability to implement sort, filtering, and union operations in just a few lines. Polymorphism in Scala.. Read More

Functional Programming in Scala – Week 2

Week 2 delved more into tail recursion but more broadly review higher order functions. Looking at perhaps the key characteristic of functional programming languages we found that functions are treated as first class values. Meaning like any other values, functions can be passed as a parameter and returned as a results. This becomes important later in the course and in real world applications where the resolution of values can be deferred until the.. Read More

Functional Programming in Scala – Week 1

Started and completed this course in the second half of 2012. Thought revisiting the material and uploading the weekly assignments would be a good idea. Week 1 looked at basic functions and evaluations. The recursive nature of functional programming was alluded to, particularly in the assignment. The basics of (x <- 0 to y) and other scala language specifics such as scoping and structure can all be reviewed in the.. Read More