From 405dc77434bbb992e4bea55b8b89b25840ce63a2 Mon Sep 17 00:00:00 2001 From: AKP Date: Mon, 23 Oct 2023 14:06:42 +0100 Subject: [PATCH] Alter 4 files Rename `02-lab.hs` to `lab.hs` Rename `02-polymorphic_functions.hs` to `polymorphic_functions.hs` Add `Homework3.hs` Add `Types.hs` --- 02-lab.hs => week2/lab.hs | 0 .../polymorphic_functions.hs | 0 week3/Homework3.hs | 21 +++++++++++++++++++ week3/Types.hs | 6 ++++++ 4 files changed, 27 insertions(+) rename 02-lab.hs => week2/lab.hs (100%) rename 02-polymorphic_functions.hs => week2/polymorphic_functions.hs (100%) create mode 100644 week3/Homework3.hs create mode 100644 week3/Types.hs 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) +