From c275e73a54ca3e382d394d57c703f3c3eb7b36dd Mon Sep 17 00:00:00 2001 From: Julien Moutinho <julm@sourcephile.fr> Date: Mon, 20 Apr 2020 14:25:21 +0200 Subject: [PATCH] Add Generic instance to Tree --- Data/TreeSeq/Strict.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/TreeSeq/Strict.hs b/Data/TreeSeq/Strict.hs index 046665d..0f8b230 100644 --- a/Data/TreeSeq/Strict.hs +++ b/Data/TreeSeq/Strict.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveGeneric #-} module Data.TreeSeq.Strict where import Control.Applicative (Applicative(..)) @@ -11,6 +12,7 @@ import Data.Ord (Ord(..)) import Data.Semigroup (Semigroup(..)) import Data.Sequence (Seq, ViewL(..)) import Data.Traversable (Traversable(..)) +import GHC.Generics (Generic) import Text.Show (Show(..)) import qualified Data.List as List import qualified Data.Sequence as Seq @@ -20,7 +22,7 @@ data Tree a = Tree { unTree :: !a , subTrees :: !(Trees a) } - deriving (Eq, Ord, Show) + deriving (Eq, Ord, Show, Generic) instance Functor Tree where fmap f (Tree a ts) = Tree (f a) (fmap (fmap f) ts) instance Applicative Tree where -- 2.47.2