from pathlib import Path
import yaml


def default_loader(file: Path) -> dict:
    """ Default loader parses .yaml config file. """
    result = yaml.safe_load(file.read_text())
    if not isinstance(result, dict):
        raise ValueError("Loaded config is not a mapping")
    return result