Changes between Version 10 and Version 11 of Holes


Ignore:
Timestamp:
Feb 10, 2012 2:50:07 PM (3 years ago)
Author:
nomeata
Comment:

Are holes in types more powerful and less intrusive?

Legend:

Unmodified
Added
Removed
Modified
  • Holes

    v10 v11  
    176176 
    177177The same effect of holes can then be achieved by using {{{ {_ undefined _} }}}. To return to the conciseness of holes, {{{__}}} could be syntactic sugar for {{{{_ undefined _}}}}. (Note that defining {{{__ = {_ undefined _}}}} in Haskell would not do this. The type would be {{{forall a. a}}}.) 
     178 
     179== Not ranges, but types == 
     180 
     181A variation of the previous proposal that is a bit more powerful and less syntactically intrusive is to implement this in the type language. So giving an expression (or even a pattern) a type of {{__}} would leave this type arbitrary and make GHC print the type. This subsumes the previous proposals, e.g.  
     182{{{ 
     183test :: [Bool] 
     184test = (undefined::__) : (undefined ++ [] ::__) 
     185}}} 
     186and again a {{{__}}} on the term level could be syntactic sugar for {{{(undefined::__)}}}. 
     187 
     188The benefit from this variant is that {{{__}}} could occur as parts of types as well, e.g.  
     189{{{ 
     190test :: [__] 
     191test = (undefined::__) : (undefined ++ [True] ::__) 
     192}}}