I need to implement a function that takes a list of Dists and returns a list of Dists. I need the function to return only the Dists with the label "pass", but somehow this does not work. Any help?
data Ex = Ex Float Float String String deriving Show data NewSt = NewSt Float Float String deriving Show data Dist = Dist Float NewSt Ex deriving Show helper1 [] = [] helper1 (Dist x (NewSt midterm1 quiz1 name1) (Ex midterm quiz name label) : xs) = if (label == "pass") then Dist x (NewSt midterm1 quiz1 name1) (Ex midterm quiz name label) : (helper1 xs) else helper1 xs