Skip to content

Instantly share code, notes, and snippets.

@kosmikus
Created November 24, 2016 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosmikus/f74cbc987a6be519e05c27e845acd1ff to your computer and use it in GitHub Desktop.
Save kosmikus/f74cbc987a6be519e05c27e845acd1ff to your computer and use it in GitHub Desktop.
First steps towards extending the servant language with webdav/caldav verbs
{-# 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