type Matrix = [[Rational]]
type Vector = [Rational]
data Network = Layer | None
type Layer = (Matrix,Vector,Network)
createNetwork :: [Matrix] -> [Vector] -> Network
createNetwork [] _ = None
createNetwork (x:xs) (y:ys) = (x,y,(createNetwork xs ys))
I dont understand why does this code returns the following error, since a layer is exactly fitting for a Network. It doesn't compile even if i define Network as Matrix Vector Network | None
This is the error :
neuro.lhs:17:33: error:
* Couldn't match expected type `Network'
with actual type `(Matrix, Vector, Network)'
* In the expression: (x, y, (createNetwork xs ys))
In an equation for `createNetwork':
createNetwork (x : xs) (y : ys) = (x, y, (createNetwork xs ys))
|
17 | > createNetwork (x:xs) (y:ys) = (x,y,(createNetwork xs ys))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^