findMediaType :: ByteString -> ByteString -> [M.MediaType] -> [Media t s]
findMediaType t s = mapMaybe (\m -> do
    let mt = M.medType m
        ms = M.medSubtype m
    guard ((mt == "*" || t == mt) && (ms == "*" || s == ms))
    return $ Media t s (M.medQuality m) (M.medParams m))
findMediaType :: ByteString -> ByteString -> [M.MediaType] -> [Media t s]
findMediaType t s = mapMaybe (\m -> do
    let mt = M.medType m
        ms = M.medSubtype m
    guard ((mt == "*" || t == mt) && (ms == "*" || s == ms))
    return $ Media t s (M.medQuality m) (M.medParams m))
findMediaType t s = mapMaybe (\m -> do
    let mt = M.medType m
        ms = M.medSubtype m
    guard ((mt == "*" || t == mt) && (ms == "*" || s == ms))
    return $ Media t s (M.medQuality m) (M.medParams m))