Content Type Bliss

Recently I came across Timo von Holtz’s servant-JuicyPixels package. It describes servant -compatible content-types for JuicyPixel’s DynamicImage data type, and clocks under 100 airy lines.

Timo and I realized there is a pretty neat demonstration of the advantage of abstracting away content-type serialization and deserialization: the world’s most concise image-conversion web service. Essentially the same application is available as the image conversion example in Timo’s package.

(If you want to know more about how content-types work in servant , the content-type section of the tutorial has more information.)

Conclusion This is just the limit of the relative gain of abstracting content-types - there is nothing to the application besides them! Essentially the same idea could of course be applied to other areas. Document conversion with Pandoc, video and audio formats, etc.

Posted on August 5, 2015 by Julian K. Arni