scotty-web / wai-middleware-static

WAI middleware that intercepts requests to static files and serves them if they exist.
Other
18 stars 12 forks source link

Why not use Alternative instead of custom <|> operator? #18

Open bsima opened 5 years ago

bsima commented 5 years ago

I think the custom operator should be replaced with an Alternative instance: https://github.com/scotty-web/wai-middleware-static/blob/master/Network/Wai/Middleware/Static.hs#L96-L99

Of course you'll also need Functor and Applicative, not sure how hard that would be to implement. If you'll accept a patch for this, let me know and I'll look into it.