summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/generics/Uniplate/Main.hs
blob: 95d84244faec44d823108392da20c4edec924546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE DeriveGeneric #-}

module Main where

import GHC.Generics
import GUniplate


data Tree     = Leaf | Node Int Tree Tree deriving (Show, Generic)
data Pair a b = Pair a b                  deriving (Show, Generic)

instance Uniplate Tree
instance Uniplate (Pair a b)

-- Tests
t1 = children ('p')
t2 = children (Pair "abc" (Pair "abc" 2))
t3 = children (Node 2 Leaf Leaf)

main = print (t1, t2, t3)