diff options
Diffstat (limited to 'testsuite/tests/generics/Uniplate/Main.hs')
-rw-r--r-- | testsuite/tests/generics/Uniplate/Main.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/generics/Uniplate/Main.hs b/testsuite/tests/generics/Uniplate/Main.hs new file mode 100644 index 0000000000..95d84244fa --- /dev/null +++ b/testsuite/tests/generics/Uniplate/Main.hs @@ -0,0 +1,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) |