@@ -1,10 +1,11 @@
1−{-# LANGUAGE DataKinds #-}
2−{-# LANGUAGE DefaultSignatures #-}
3−{-# LANGUAGE DeriveAnyClass #-}
4−{-# LANGUAGE DeriveGeneric #-}
5−{-# LANGUAGE FlexibleContexts #-}
6−{-# LANGUAGE MonoLocalBinds #-}
7−{-# LANGUAGE TypeApplications #-}
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DefaultSignatures #-}
3+{-# LANGUAGE DeriveAnyClass #-}
4+{-# LANGUAGE DeriveGeneric #-}
5+{-# LANGUAGE FlexibleContexts #-}
6+{-# LANGUAGE MonoLocalBinds #-}
7+{-# LANGUAGE StandaloneDeriving #-}
8+{-# LANGUAGE TypeApplications #-}
89
910module Main (main) where
1011
@@ -21,7 +22,9 @@ main = void $ runTestTT $
2122data Tree a w = Leaf a
2223 | Fork (Tree a w) (Tree a w)
2324 | WithWeight (Tree a w) w
24− deriving (Show, Eq, Generic, Bifunctor)
25+ deriving (Show, Eq, Generic)
26+
27+deriving instance Bifunctor (Tree a w)
2528
2629mytree :: Tree Int Int
2730mytree = Fork (WithWeight (Leaf 42) 1)