From ba379287c80e502e47664597370cef4b5593e417 Mon Sep 17 00:00:00 2001 From: akhesaCaro Date: Tue, 23 Mar 2021 14:09:49 +0100 Subject: [PATCH] reverting : removing DerivingVia extension (not compatible ghc < 8.6.1) --- doc/cookbook/uverb/UVerb.lhs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/cookbook/uverb/UVerb.lhs b/doc/cookbook/uverb/UVerb.lhs index 2119706c..93147b68 100644 --- a/doc/cookbook/uverb/UVerb.lhs +++ b/doc/cookbook/uverb/UVerb.lhs @@ -10,6 +10,8 @@ handlers that respond with arbitrary open unions of types. {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} @@ -154,12 +156,8 @@ Example usage: ```haskell data Foo = Foo Int Int Int - deriving (Show, Eq, GHC.Generic) - -instance ToJSON Foo - -instance HasStatus Foo where - type StatusOf Foo = 200 + deriving (Show, Eq, GHC.Generic, ToJSON) + deriving HasStatus via WithStatus 200 Foo data Bar = Bar deriving (Show, Eq, GHC.Generic)