
4 Feb
2007
4 Feb
'07
1:13 p.m.
Maybe has a Monad instance, so you can write this as follows (untested):
exists str wmap = boolFromMaybe exists' where exists' = do x <- Map.lookup (sort str) wmap find (== str) (snd x) boolFromMaybe (Just _) = True boolFromMaybe Nothing = False
import isJust boolFromMaybe = isJust -- WBR, Max Vasin.