From c769800adbb5c74e5f54e85b42812f457c041b3a Mon Sep 17 00:00:00 2001 From: Nickolay Kudasov Date: Sat, 19 Sep 2015 01:22:28 +0300 Subject: [PATCH] Add ToSample instances for (), Bool and Ordering Also remove `instance ToSample ()` from example. --- servant-docs/example/greet.hs | 3 --- servant-docs/src/Servant/Docs/Internal.hs | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/servant-docs/example/greet.hs b/servant-docs/example/greet.hs index 1835b290..dff4a397 100644 --- a/servant-docs/example/greet.hs +++ b/servant-docs/example/greet.hs @@ -53,9 +53,6 @@ instance ToParam (MatrixParam "lang" String) where "Get the greeting message selected language. Default is en." Normal -instance ToSample () () where - toSample _ = Just () - instance ToSample Greet Greet where toSample _ = Just $ Greet "Hello, haskeller!" diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index 56d9b924..5857b616 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -961,6 +961,11 @@ instance HasDocs sublayout => HasDocs (Vault :> sublayout) where docsFor Proxy ep = docsFor (Proxy :: Proxy sublayout) ep +-- 'ToSample' instances for simple types + +instance ToSample () () +instance ToSample Bool Bool +instance ToSample Ordering Ordering -- polymorphic 'ToSample' instances