I am new to Haskell. I have a Neuron
data type, which owns a list of Double
values:
data Neuron = Neuron [Double]
deriving (Eq, Read, Show)
I am trying to do the sum of each element in the list owned by the Neuron and in the other list:
sommeNeuron :: Neuron -> [Double] -> Neuron
sommeNeuron n1 n2 = n'
where {
--n' = Neuron(zipWith (+) n1 n2);
n' = zip n1 n2
}
That gives me a compile-time error:
Couldn't match expected type ‘[a]’ with actual type ‘Neuron’
Just need to tweak it,
since your data type is defined as
i.e. the
[Double]
list is behind the "tag"Neuron
. This means there's a relationship