I am trying to define a data type using other data types like this:
data A = Something String | SomethingElse Int
data B = Another B | YetAnother A
data C = A | B
x :: [ C ]
x = [ YetAnother (SomethingElse 0), Something "Hello World" ]
But this is giving me an error saying that I cannot have a type A when expecting a type B. Why is this?
You’re missing the data constructors for
C.