hellomatey27
hellomatey27

Reputation: 115

How to interact with this kind of datatype

I have a datatype which is defined as:

data DType = DT List Int

Since it's neither a tuple, a list, or anything else which looks like I'm used to in other languages, I'm a bit confused as to how I should interact with it. I'd very much appreciate a simple example.

Upvotes: 1

Views: 50

Answers (1)

hellomatey27
hellomatey27

Reputation: 115

Thanks to Willem above:

Through pattern matching, so f (DT mylist myint) = ... with ... an expression with mylist and myint

Upvotes: 1

Related Questions