Support @ patterns as in Haskell

This patch also fixes a corner case in the type substitution code that is hit by declarations using at patterns.

Example:
```
data MyType = MyType Int
-- Passes typecheck (with patch)
result v@(MyType x) n =
       if x - n == 0
         then "Done"
         else (show n) ++ " " ++ result v (n + 1)

-- Fails type checking:
-- badTypes : MyType -> String
-- badTypes (v@(MyType x)) = show (v + 1)

main = plainText (result (MyType 10) 0)
```