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