I have simplified the code using constructors and export.
I can evalute the qualified expressions but I do not get the expected results.
module MONKONMOVE (module MONKONMOVE)where
data Monk = Monk | Monku | Monkd deriving (Show,Eq)
data TimeOfDay = TimeOfDay | Timeu1 | Timeu2 | Timeu3 | Timed1 | Timed2 | Timed3 deriving (Show,Eq)
data LocationOnPath = LocationOnPath | Locationu1 | Locationu2 | Locationu3 | Locationd1 | Locationd2 | Locationd3 deriving (Show,Eq)
meets :: Monk -> Monk -> TimeOfDay -> TimeOfDay -> LocationOnPath -> LocationOnPath -> Bool
meets m1 m2 t1 t2 l1 l2 = if (not(m1 == m2) && (t1 == t2) && (l1 == l2))
then True
else False
module MONKONMOVEUP (module MONKONMOVE,module MONKONMOVEUP) where
import MONKONMOVE
location :: Monk -> TimeOfDay -> LocationOnPath
location Monku Timeu1 = Locationu1
location Monku Timeu2 = Locationu2
location Monku Timeu3 = Locationu3
module MONKONMOVEDOWN (module MONKONMOVE, module MONKONMOVEDOWN) where
import MONKONMOVE
location :: Monk -> TimeOfDay -> LocationOnPath
location Monkd Timed1 = Locationd3
location Monkd Timed2 = Locationd2
location Monkd Timed3 = Locationd1
module MONKMEETSHIMSELF where
import MONKONMOVEUP
import MONKONMOVEDOWN
-- There is one time and location in common
Locationu2 = Locationd2
Timed2 = Timeu2
-- The start of one journey is the end of the other and vice versa
Locationd1 = Locationu3
Locationd3 = Locationu1
Timed1 = Timeu1
Timed3 = Timeu3