更新时间:2022-12-07 07:36:25
The code you gave has a few errors.
xs
missing.elem x
over a list - which would need a list of lists to be correct.here is what I would guess what you intended.
members :: Code -> Bool
members xs = and [ x `elem` symbols | x <- xs ]
which can be written a bit more concise (I believe tools like hlint would even suggest this simplification).
members' :: Code -> Bool
members' = all (`elem` symbols)