Skip to content

Abstract Handler #641

Closed
Closed
@jkarni

Description

@jkarni

@kosmikus suggested this a while back, but: is everyone okay with making Handler it's own abstract monad (rather than a type synonym)? This will make it easier to add more instances without breaking backwards compatibility.

Currently I'm thinking of making it a MonadResource (as part of the work on file uploads, I'd be using MonadResource anyhow, and it seems reasonable to allow handlers to also register cleanup actions). I've also thought about adding functions:

etagIs :: Etag -> Handler ()
lastModifiedAt :: DateTime -> Handler ()

With the functionality that if there is a If-Match/If-None-Match (or If-Modified-Since/If-Unmodified-Since) header in the request that doesn't/does match the mentioned Etag/DateTime, and appropriate throwError is thrown. (This seems like a nice API for servers, but I still haven't figured out how it would work for clients.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions