list indexing by pattern matching
fix type checking of pattern matching, better error messages, starting
generic patterns