yesod-media-simple: Simple display of media types, served by yesod

[ graphics, library, mit ] [ Propose Tags ]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,
Dependencies base (>=4 && <5), bytestring, diagrams-cairo, diagrams-core, diagrams-lib (>=1.3 && <1.5), directory, JuicyPixels, vector, yesod (>1.2) [details]
License MIT
Copyright 2014 Michael Sloan
Author Michael Sloan
Category Graphics
Home page
Uploaded by MichaelSloan at 2018-04-23T22:44:26Z
Distributions NixOS:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3452 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-04-29 [all 1 reports]

Readme for yesod-media-simple-

[back to package description]


This package provides simple utilities for starting a web server which serves some media. This makes serving media as easy as serve image. For example, here's how you serve a simple diagram:

import Diagrams.Prelude
import Yesod.Media.Simple

main = serveDiagram (circle 10 ||| square 20)

Media Types

Currently yesod-media-simple supports serving the following media types:

  • Diagrams, by using cairo to render to png. Just call serveDiagram :: Diagram Cairo -> IO (), or the more generic serve :: RenderContent a => a -> IO ().

  • JuicyPixels images. Also includes utilities for putting JuicyPixels images in Diagrams and vice-versa.