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’
sommeNeuron (Neuron ws0) ws1 = Neuron ws2 where {TODO must define ws2 as a function of ws0 and ws1}
. – jpmarinier