First go at making Representable0 just a standard derivable class.
[ghc-hetmet.git] / tmp / Main.hs
1 {-# LANGUAGE FlexibleContexts, UndecidableInstances, StandaloneDeriving #-}
2 {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, DeriveRepresentable #-}
3 {-# LANGUAGE Generics #-}
4
5 module Main where
6
7 import GHC.Generics
8
9 data Tree a = Leaf | Node a (Tree a) (Tree a) deriving Representable0
10
11 instance Representable0 Char
12 instance (Representable0 (Tree a)) => Show (Tree a)
13
14 -- deriving instance Representable0 (Tree a)
15
16 tree1, tree2 :: Tree Char
17 tree1 = Node 'a' Leaf  Leaf
18 tree2 = Node 'c' tree1 tree1
19
20 main = print tree2