I'm new to haskell, and I'm trying to get better with it. Recently I completed one of the challenges from Programming Praxis and I was wondering if people would be willing to spend some time and tell me how I could improve my code.
import Data.List
import Data.Maybe
sumCheck :: Int -> [Int] -> [Int] -> Maybe (Int, Int)
sumCheck _ [] _ = Nothing
sumCheck total (x:xs) ys = if total' == Nothing
then sumCheck total xs ys
else return (x, (ys !! ( fromJust total')))
where total' = (total - x) `elemIndex` ys