Skip to content

barnabasmolnar/cis-194

Repository files navigation

cis194

This repo is an attempt at solving some of the homework exercises from https://www.seas.upenn.edu/~cis194/spring13/. This resource was first recommended to me by a friend, but I have also read several positive threads about it on the /r/haskell subreddit, as well as this recommendation.

This project has been initialised by stack.

Homework 1

Notes:

Despite the instructions in Exercise 4 in that

This will use all functions defined in the previous exercises.

I ended up not using toDigitsRev for the final validate function, as the doubleEveryOther function already does right-to-left doubling of every other digit.

Homework 2

Notes:

Can be tested with:

testWhatWentWrong parse whatWentWrong' "./src/Homework2/error.log"

Homework 3

Notes:

For the Local Maxima task, I wrote 2 solutions. The 2nd solution, localMaxima' takes advantage of the so called as patterns for the sake of conciseness and improved readability. In fact, I've already used this pattern for the insert function in Homework 2.

The Histogram exercise can be tested with:

putStrLn $ histogram [1,4,5,4,6,6,3,4,2,4,9]

Releases

No releases published

Packages

No packages published