Haskell logo CIS 552: Advanced Programming

Fall 2021

  • Home
  • Schedule
  • Homework
  • Resources
  • Software
  • Style guide

HW 3 - Typeclasses

This homework assignment is composed of three problems.

Make all of your edits in the files Kata.hs, SortedList.hs and MergeSort.hs found in your github repository.

Problem - Return of the Data Munging Kata

See Kata.lhs

Problem - Sorted lists and type abstraction

See SortedList.lhs

Problem - MergeSort for foldable data structures

See MergeSort.lhs

> -- obligatory main
> module Main where
> import Kata(testParseEventChar)
> import SortedList(testListMonoid, testSortedList,
>                   testMinimum, testNumDistinct, testCount)
> import MergeSort(testSortedFromList,testSortedFromList',
>                  testSumOfProducts,testCrispy, testDivide, testDivideList)
> import Test.HUnit ( runTestTT, Test(TestList) )
> 
> main :: IO ()
> main = do
>   _ <- runTestTT $ TestList [testParseEventChar]
>   _ <- runTestTT $ TestList [testListMonoid, testSortedList, testMinimum, testNumDistinct, testCount]
>   _ <- runTestTT $ TestList [testSortedFromList, testSortedFromList', testSumOfProducts,
>                              testCrispy, testDivide, testDivideList]
>   return ()
Design adapted from Minimalistic Design | Powered by Pandoc and Hakyll