I'm a novice with no functional programming experience in the past (yet, quite a bit of procedural/imperative programming experience). I'm having a bit of trouble with understanding how declaring your own datatype works.
For instance, say I declared a datatype:
data SomeThing = Int [Int]
how would you write a Haskell function which consumes a someData and produces a someData; only the produced data's Int is the sum of all the elements in the consumed data's [Int], and where the consumed value's [Int] has had every element multiplied by 2 in the produced [Int].
This is obviously possible, but I have not found any answers that made sense to me after a web search.