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:
parent
74576b123a
commit
405dc77434
4 changed files with 27 additions and 0 deletions
21
week3/Homework3.hs
Normal file
21
week3/Homework3.hs
Normal 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
6
week3/Types.hs
Normal file
|
@ -0,0 +1,6 @@
|
|||
{-# LANGUAGE StandaloneDeriving, Safe #-}
|
||||
|
||||
module Types where
|
||||
|
||||
data Classification = Low | Medium | High | SuperHigh deriving (Show, Eq)
|
||||
|
Reference in a new issue