pr3-elm/aufgaben/src/Pflichtuebung_01/Date.elm

51 lines
745 B
Elm

module Pflichtuebung_01.Date exposing (..)
type alias Day =
Int
type alias Month =
Int
type alias Year =
Int
type alias Date =
( Day, Month, Year )
-- 1 Punkt:
year : Date -> Year
year (_, _, c) = c
month : Date -> Month
month (_, b, _) = b
day : Date -> Day
day (a, _, _) = a
-- 1 Punkt:
lt : Date -> Date -> Bool
lt date1 date2 = False
eq : Date -> Date -> Bool
eq date1 date2 = False
gt : Date -> Date -> Bool
gt date1 date2 = False
-- 1 Punkt:
toString : Date -> String
toString date = ""
-- 2 Punkte:
next : Date -> Date
next date = (1, 1, 1)
-- 2 Punkte:
prev : Date -> Date
prev date = (1, 1, 1)
-- 1 Punkt:
leapyear : Year -> Bool
leapyear y = False
-- 2 Punkte:
sub : Date -> Date -> Int
sub date1 date2 = 0