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`
This commit is contained in:
akp 2023-10-23 14:06:42 +01:00
parent 74576b123a
commit 405dc77434
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755
4 changed files with 27 additions and 0 deletions

21
week3/Homework3.hs Normal file
View file

@ -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

6
week3/Types.hs Normal file
View file

@ -0,0 +1,6 @@
{-# LANGUAGE StandaloneDeriving, Safe #-}
module Types where
data Classification = Low | Medium | High | SuperHigh deriving (Show, Eq)