This commit is contained in:
Aaro Koivukangas
2025-12-22 21:43:39 +02:00
parent 9545dd72e9
commit 2e3a8a4538
+2 -1
View File
@@ -12,7 +12,7 @@ import Mooc.Todo
-- Bus, Tram and Train. -- Bus, Tram and Train.
-- --
-- The constructors don't need any fields. -- The constructors don't need any fields.
data Vehicle = Bike | Bus | Tram | Train
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Ex 2: Define the type BusTicket that can represent values like these: -- Ex 2: Define the type BusTicket that can represent values like these:
@@ -20,6 +20,7 @@ import Mooc.Todo
-- - MonthlyTicket "January" -- - MonthlyTicket "January"
-- - MonthlyTicket "December" -- - MonthlyTicket "December"
data BusTicket = SingleTicket | MonthlyTicket String
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Ex 3: Here's the definition for a datatype ShoppingEntry that -- Ex 3: Here's the definition for a datatype ShoppingEntry that