I was wondering if there is an easy way to get the difference between 2 data types in Haskell, in a list of tuples.
Let's says I define 2 data types :
type Name = String
type Age = String
type Color = String
type Size = Int
data Animal = Animal Name Age Color Size
data Cat = Cat Name Age Color
Then, I want to get a list of tuples containing all the animals but the cats. The function would be something like :
getAnimalsButCats :: [Animal] -> [Cat] -> [(Name, Age, Color)]
getAnimalsButCats [(Animal name age color _)] [(Cat nameC ageC colorC)] = //diff between [Animal] and [Cat]