Changes between Version 1 and Version 2 of ExplicitTypeApplication


Ignore:
Timestamp:
Dec 14, 2011 11:33:54 AM (2 years ago)
Author:
dreixel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitTypeApplication

    v1 v2  
    66{{{ 
    77case x of 
     8  (C @a y z) -> .... 
     9}}} 
     10On the right-hand side we would have the type variable `a` in scope. 
     11 
     12Note how the use of the symbol `@` is (in this case) unproblematic, since we can 
     13use the fact that constructors always start with an uppercase letter to distinguish 
     14whether the `@` refers to an "as pattern" or to a type application: 
     15{{{ 
     16case x of 
    817  p@(C @a y z) -> .... 
    918}}} 
    10 On the right-hand side we would have the type variable `a` in scope. Note how 
    11 the use of `@` is (in this case) unproblematic, since we can use the fact that 
    12 constructors always start with an uppercase letter to distinguish whether the 
    13 `@` refers to an "as pattern" or to a type application. This cannot be used 
    14 to pattern-match on specific types: the only thing that we can match on are 
    15 variables. 
     19 
     20Also note that this would not allow you to to pattern-match on specific types: 
     21the only thing that we can match on are type or kind variables. 
    1622 
    1723