diff --git a/02-lab.hs b/week2/lab.hs similarity index 100% rename from 02-lab.hs rename to week2/lab.hs diff --git a/02-polymorphic_functions.hs b/week2/polymorphic_functions.hs similarity index 100% rename from 02-polymorphic_functions.hs rename to week2/polymorphic_functions.hs diff --git a/week3/Homework3.hs b/week3/Homework3.hs new file mode 100644 index 0000000..abbd7a7 --- /dev/null +++ b/week3/Homework3.hs @@ -0,0 +1,21 @@ +-- setting the "warn-incomplete-patterns" flag asks GHC to warn you +-- about possible missing cases in pattern-matching definitions +{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} + +-- see https://wiki.haskell.org/Safe_Haskell +{-# LANGUAGE Safe #-} + + +module Homework3 (gasUsage , luhnDouble , luhn) where + +import Types + +gasUsage :: (Fractional a, Ord a) => a -> Classification +gasUsage = undefined + +luhnDouble :: Int -> Int +luhnDouble = undefined + +luhn :: Int -> Int -> Int -> Int -> Bool +luhn = undefined + diff --git a/week3/Types.hs b/week3/Types.hs new file mode 100644 index 0000000..a827a33 --- /dev/null +++ b/week3/Types.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE StandaloneDeriving, Safe #-} + +module Types where + +data Classification = Low | Medium | High | SuperHigh deriving (Show, Eq) +