source: doc/theses/jiada_liang_MMath/test1.hs @ 2514d3d7

Last change on this file since 2514d3d7 was 1725989, checked in by Peter A. Buhr <pabuhr@…>, 5 months ago

add enumeration test programs for different programming languages

  • Property mode set to 100644
File size: 356 bytes
Line 
1data Week = Mon | Tue | Wed | Thu | Fri | Sat | Sun deriving(Eq, Enum, Show)
2
3day = Tue
4main = do
5  if day == Tue then
6     print day
7  else
8     putStr "not Tue"
9  print (enumFrom Mon) -- week
10  print (enumFromTo Mon Fri) -- weekday
11  print (enumFromTo Sat Sun) -- weekend
12
13-- Local Variables: --
14-- compile-command: "ghc test1.hs; ./test1" --
15-- End: --
Note: See TracBrowser for help on using the repository browser.