module Logging.Types.Class.Filterable ( Filterable(..) ) where

import           Prelude              hiding (filter)

import           Logging.Types.Record


-- |A class represents a common trait of filtering 'LogRecord's
class Filterable a where
  filter :: a -> LogRecord -> Bool

instance Filterable a => Filterable [a] where
  filter [] _       = True
  filter (f:fs) rcd = (filter f) rcd && (filter fs rcd)