To convert records from old versions to new, I have a typeclass with a convert
function. There is an instance for every type of record. (Cf. previous question.)
class Converter c1 c2 where
convert : c1 -> c2
There exist instances for many record types like e.g.:
instance C1 C2 where
convert (C1 with ..) = C2 with ..
Now, I try to define one instance that just handles arrays of other types:
instance (Converter c1 c2) => Converter [c1] [c2] where
convert [c1] = map convert [c1]
This yields the error
Pattern match(es) are non-exhaustive
In an equation for ‘convert’:
Patterns not matched:
[]
(_:_:_)
I don’t get where the incomplete pattern match is, or how it could be made complete. Does someone understand this problem?
Thanks a lot,
mesch.