resolve :: (Dependant id a, Eq id)
        => [a]            -- ^ The list of Dependants
        -> Either [a] [a] -- ^ Return Left with the Dependants that couldn't be
                          --   resolved (cyclic dependency, missing dependency)
resolve xs = go xs []
    where go [] xs = Right xs
          go unresolved resolved =
            let (resolvables, unresolvables) =
                    partition (resolvable resolved) unresolved
            in if not . null $ resolvables
                then go unresolvables (resolved ++ resolvables)
                else Left unresolvables
resolve :: (Dependant id a, Eq id)
        => [a]            -- ^ The list of Dependants
        -> Either [a] [a]
resolve xs = go xs []
    where go [] xs = Right xs
          go unresolved resolved =
            let (resolvables, unresolvables) =
                    partition (resolvable resolved) unresolved
            in if not . null $ resolvables
                then go unresolvables (resolved ++ resolvables)
                else Left unresolvables
resolve xs = go xs []
    where go [] xs = Right xs
          go unresolved resolved =
            let (resolvables, unresolvables) =
                    partition (resolvable resolved) unresolved
            in if not . null $ resolvables
                then go unresolvables (resolved ++ resolvables)
                else Left unresolvables