Content deleted Content added
Line 60:
What you really want is something like this:
(
Day = saturday,
OpenHours = (8 - 15)
;
Day = sunday,
OpenHours = (9 - 13)
;
( Day = monday
; Day = tuesday
Line 74:
),
OpenHours = (8 - 17)
)
This is a switch whose third case is a multi-cons-id case, This gets compiled efficiently, expresses the computation clearly and (in the right context) uses the determinism checker to ensure that all days are covered exactly once. It can also be run in reverse where the OpenHours is ground and Day is free, where it would be nondeterministic.
|