Remove unused code.

Not sure why -Werror didn't catch these.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Types: Add `instance Applicative Private`

Fixes warning with GHC 7.8 (Applicative will be a base class of Monad).

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Rename Ganeti.Utils.MonadPlus to Ganeti.Utils.Monad.

It contains only one MonadPlus-specific function and we would like
to add more Monad-specific functions.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Auto-derive instances where possible

Removes a lot of unnecessary code.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Utils.Monad: Add anyM and allM

Useful for short-circuiting computations.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Query.Filter: Simplify `evaluateFilter` recursion

We can remove the explicit recursion and special-casing using
`anyM` and `allM`.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Query.Filter: Simplify `wrapGetter`

No need to pass the unmodified QffMode `qff` supplied by the caller
unmodified to a function supplied by the caller.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Query.Filter: Add evaluateFilterM

This is a more general version of evaluateFilter, which can be
used for general evaluations of the Ganeti filter language that
do not involve ConfigData, live data and other specialties.

To make this function general enough for expressing very specific
evaluations (such as expressing `evaluateFilter`, which has various
short-cuts, in terms of `evaluateFilterM`), a GADT is introduced
that captures the operations we can perform on the leaves of the
query language.

This lack of separation between the recursive structure and the leaf
structure is what made it hard to write generic functions on `Filter`.

However, we currently need this separation only for filter evaluation
functions and not in the type of `Filter` itself, so
Ganeti.Query.Language remains unchanged.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Query.Filter: Simplify `evaluateFilter`

We can now express it in terms of `evaluateFilterM`.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Query.Filter: `evaluateFilter` -> `evaluateQueryFilter`

This captures better what it does, and doesn't give the impression
that it is a pure version of `evaluateFilterM`.

Signed-off-by: Niklas Hambuechen <niklash@google.com>