fork download
  1. member :: a -> [a] -> Bool
  2. member y [] = False
  3. member y (x:xs) = (x == y) || member y xs
  4.  
  5.  
  6. main = print $ member 3 [1..5]
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:3:19:
    Could not deduce (Eq a) from the context ()
      arising from a use of `==' at prog.hs:3:19-24
    Possible fix:
      add (Eq a) to the context of the type signature for `member'
    In the first argument of `(||)', namely `(x == y)'
    In the expression: (x == y) || member y xs
    In the definition of `member':
        member y (x : xs) = (x == y) || member y xs
stdout
Standard output is empty