In the interests of self describing media, I find myself often implementing these:
mapDescribe :: Accept a => [(a, b)] -> ByteString -> Maybe (a, b)
mapDescribe options header = mapAccept (map (\(a, b) -> (a, (a, b))) options) header
mapQualityDescribe :: Accept a => [(Quality a, b)] -> [Quality a] -> Maybe (a, b)
mapQualityDescribe options header = mapQuality (map (\(a, b) -> (a, (a, b))) options) header
It seems like this sort of function belongs to this library rather than users' code since a) it's quite useful for self-describing media, and b) an internal implementation can do it with fewer thunks. I'm not really sure about the names I've chosen here, though.
In the interests of self describing media, I find myself often implementing these:
It seems like this sort of function belongs to this library rather than users' code since a) it's quite useful for self-describing media, and b) an internal implementation can do it with fewer thunks. I'm not really sure about the names I've chosen here, though.