inter :: [Integer] -> [Integer] -> [Integer]
inter s1 s2 = [s | s <- s2, s `elem` s1]
inter [5, 6, 3, 1], [5, 2, 1, 3]
main = return()
I am not sure of how to test the above implementation, I am trying to pass two different lists here.
I keep getting:
GHCi, version 8.10.6: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/runner/University-Labs/.ghci
[1 of 1] Compiling Main ( Main.hs, interpreted )
Main.hs:4:19: error: parse error on input ‘,’
|
4 | inter [5, 6, 3, 1], [5, 2, 1, 3]
| ^
Failed, no modules loaded.
<interactive>:1:1: error:
• Variable not in scope: main
• Perhaps you meant ‘min’ (imported from Prelude)
^C Leaving GHCi.
repl process died unexpectedly:
GHCi, version 8.10.6: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/runner/University-Labs/.ghci