
17 Jun
2012
17 Jun
'12
3:08 a.m.
What you want is probably checkNode :: String -> [String] -> Bool checkNode s nodes = and (map (==s) nodes) which returns True iff all nodes equal s.
Am a bit stuck here,... please, what is wrong with this?
checkNode :: String -> [String] -> Bool checkNode s nodes = [s == node | node <- nodes ]
src/me.hs:3:4: Couldn't match expected type `Bool' with actual type `[t0]' [1 of 1] Compiling Main ( src/me.hs, interpreted ) In the expression: [s == node | node <- nodes] Failed, modules loaded: none. In an equation for `checkNode': checkNode s nodes = [s == node | node <- nodes]
thanks, Miro