setOpt o1 (o : xs)
  | o `same` o1    = o1 : xs
  | otherwise      = o : setOpt o1 xs

    where
      same (TTL _) (TTL _)                     = True
      same (MaxDataPoints _) (MaxDataPoints _) = True
      same Indexing Indexing                   = True
      same _ _                                 = False
setOpt o1 (o : xs)
  | o `same` o1    = o1 : xs
  | otherwise      = o : setOpt o1 xs

    where
      same (TTL _) (TTL _)                     = True
      same (MaxDataPoints _) (MaxDataPoints _) = True
      same Indexing Indexing                   = True
      same _ _                                 = False
setOpt o1 (o : xs)
  | o `same` o1    = o1 : xs
  | otherwise      = o : setOpt o1 xs

    where
      same (TTL _) (TTL _)                     = True
      same (MaxDataPoints _) (MaxDataPoints _) = True
      same Indexing Indexing                   = True
      same _ _                                 = False