Created
November 24, 2016 13:08
-
-
Save kosmikus/f74cbc987a6be519e05c27e845acd1ff to your computer and use it in GitHub Desktop.
First steps towards extending the servant language with webdav/caldav verbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds, OverloadedStrings #-} | |
module Servant.Caldav where | |
import Servant.API | |
data CaldavMethod = | |
PROPFIND | |
| PROPPATCH | |
| MKCOL | |
| MKCALENDAR | |
| REPORT | |
-- ... | |
instance ReflectMethod 'PROPFIND where | |
reflectMethod _ = "PROPFIND" | |
instance ReflectMethod 'PROPPATCH where | |
reflectMethod _ = "PROPPATCH" | |
instance ReflectMethod 'MKCOL where | |
reflectMethod _ = "MKCOL" | |
instance ReflectMethod 'MKCALENDAR where | |
reflectMethod _ = "MKCALENDAR" | |
instance ReflectMethod 'REPORT where | |
reflectMethod _ = "REPORT" | |
type Propfind = Verb 'PROPFIND 200 | |
type Proppatch = Verb 'PROPPATCH 200 | |
type Mkcol = Verb 'MKCOL 201 | |
type Mkcalendar = Verb 'MKCALENDAR 201 | |
type Report = Verb 'REPORT 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment