if I have two data structures
data Tri = Tri {a :: Int, b :: Int , c :: Int} deriving Show
data Quad = Quad {w :: Int, x :: Int, y :: Int, z :: Int} deriving Sh
@talex's answer is correct. Here are some variations (mainly just different syntax).
Without record syntax:
data Shape = ShapeTri Tri | ShapeQuad Quad
deriving Show
It may make more sense to combine Shape, Tri, and Quad:
data Shape = Tri {a :: Int, b :: Int , c :: Int}
| Quad {w :: Int, x :: Int, y :: Int, z :: Int}
deriving Show
You have to give names to data constructors:
data Shape = ShapeTri { shapeTri :: Tri }
| ShapeQuad { shapeQuad :: Quad }
deriving Show