I have the following problem with Haskell\'s type system: I am trying to declare a data type and return a list containing elements of this type from a function. Unfortunatel
the offending line is stList :: (Show a) => [a]. You're declaring that stList is a polymorphic list that holds any element which satisfies the show constraint. But stList isn't a polymorphic list! It's a list of SampleTypes. So remove the signature and see what ghci infers, or just give it the correct signature: :: [SampleType].