Zebra puzzle: Difference between revisions
Content deleted Content added
Line 1,107:
postCheck_ houses
| -- NOTE: list of houses is generated "from tail"
[White, Green] `isInfixOf` map color houses
,
,
,
,
= return ()
| otherwise = mzero
where
▲nextTo :: (House -> Bool) -> [House] -> [House]
| (_:h:_) <- dropWhile (not . match) hs = match h
▲nextTo p (h:hs)
|
where
</lang>
▲ | otherwise = go x xs
{{out}}
<pre>House {color = Yellow, man = Nor, pet = Cats, drink = Water, smoke = Dunhill}
|