[clean-list] Interesting run-time error

Edsko de Vries devriese at cs.tcd.ie
Wed Aug 30 10:50:45 MEST 2006


On Wed, Aug 30, 2006 at 09:57:55AM +0200, Hernyák Zoltán wrote:
> Hi,
> 
> I have succeeded to reduce the program which produces the run-time
> error (or I hope so):
> 
> Start w = fromTup2L data
> 
> data =  [[[101,102,103,104]],[[101,102,103,104]]]
> 
> fromTup2L :: [[[Int]]] -> [([Int], [Int])]
> fromTup2L l = map f l
>    where 
>       f [x,y] = (x, y)
> 
> 
> and the error message again:
> [Run time error, rule 'f;53' in module 'masik' does not match

It means that you have a pattern matching failure in your local function
"f". Your outer list has two elements, [[101,102,103,104]] and
[[101,102,103,104]]. You are applying f to each of those two elements,
but your f only allows for a list containing exactly two elements,
whereas the elements of your outerlist contain exactly one element, i.e.
[101,102,103,104] and [101,102,103,104]. 

Edsko


More information about the clean-list mailing list