-- | which field changed between two filters
--   if more than one change, returns only the first one found
filterFieldChange :: Filter -> Filter -> [Char]
filterFieldChange f1 f2 = let
  -- TODO change 0.0000001 to something else
   fieldDiff p1 p2 = if (abs (snd p1-snd p2)) < 0.00000001 then Nothing else Just $ fst p1
   nodeDiff n1 n2 = zipWith fieldDiff (getParams $ nodeContent n1) (getParams $ nodeContent n2)
   diffTree :: T.Tree ([Maybe String])
   diffTree = zipTree nodeDiff f1 f2
 in 
   case catMaybes $ concat $ T.flatten diffTree of
   []  -> "No change"
   [x] -> x
   xs  -> head xs --error $ "Multiple fields changed at once"++ show diffTree --this shouldnt really happen, but for now just give the head of the list
filterFieldChange :: Filter -> Filter -> [Char]
filterFieldChange f1 f2 = let
  -- TODO change 0.0000001 to something else
   fieldDiff p1 p2 = if (abs (snd p1-snd p2)) < 0.00000001 then Nothing else Just $ fst p1
   nodeDiff n1 n2 = zipWith fieldDiff (getParams $ nodeContent n1) (getParams $ nodeContent n2)
   diffTree :: T.Tree ([Maybe String])
   diffTree = zipTree nodeDiff f1 f2
 in 
   case catMaybes $ concat $ T.flatten diffTree of
   []  -> "No change"
   [x] -> x
   xs  -> head xs --error $ "Multiple fields changed at once"++ show diffTree --this shouldnt really happen, but for now just give the head of the list
filterFieldChange f1 f2 = let
  -- TODO change 0.0000001 to something else
   fieldDiff p1 p2 = if (abs (snd p1-snd p2)) < 0.00000001 then Nothing else Just $ fst p1
   nodeDiff n1 n2 = zipWith fieldDiff (getParams $ nodeContent n1) (getParams $ nodeContent n2)
   diffTree :: T.Tree ([Maybe String])
   diffTree = zipTree nodeDiff f1 f2
 in 
   case catMaybes $ concat $ T.flatten diffTree of
   []  -> "No change"
   [x] -> x
   xs  -> head xs --error $ "Multiple fields changed at once"++ show diffTree --this shouldnt really happen, but for now just give the head of the list