Re: [GHC] #7484: Template Haskell allows building invalid record fields/names

2013-01-03 Thread GHC
#7484: Template Haskell allows building invalid record fields/names
-+--
Reporter:  iustin|   Owner:  
Type:  bug   |  Status:  new 
Priority:  normal|   Milestone:  
   Component:  Template Haskell  | Version:  7.6.1   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--

Comment(by igloo):

 The problem with doing the check in `mkName` is that it would still be
 possible to make a variable that starts with a capital letter, or a
 constructor that starts with a lower case letter.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7484#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #7484: Template Haskell allows building invalid record fields/names

2012-12-06 Thread GHC
#7484: Template Haskell allows building invalid record fields/names
-+--
Reporter:  iustin|   Owner:  
Type:  bug   |  Status:  new 
Priority:  normal|   Milestone:  
   Component:  Template Haskell  | Version:  7.6.1   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--
Changes (by simonpj):

  * difficulty:  = Unknown


Comment:

 Yes I see that.  What would you like? Should `mkName` fail (by calling
 `error`) when given an illegal name?

 I wonder if some people might use an illegal name specificaly to ''avoid''
 the danger of accidental capture?  (Though you can always use `newName`
 for that.)

 Perhaps it would suffice to reject spaces in names, becuase that is
 perhaps particularly confusing.

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7484#comment:1
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #7484: Template Haskell allows building invalid record fields/names

2012-12-06 Thread GHC
#7484: Template Haskell allows building invalid record fields/names
-+--
Reporter:  iustin|   Owner:  
Type:  bug   |  Status:  new 
Priority:  normal|   Milestone:  
   Component:  Template Haskell  | Version:  7.6.1   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--

Comment(by iustin):

 Replying to [comment:1 simonpj]:
  Yes I see that.  What would you like? Should `mkName` fail (by calling
 `error`) when given an illegal name?

 Yes, I think that makes sense (and is appropriate).

  I wonder if some people might use an illegal name specificaly to
 ''avoid'' the danger of accidental capture?  (Though you can always use
 `newName` for that.)

 That would be a very ugly way of solving the problem. Since `newName`
 exists and works well, I don't see a problem against moving to that (if
 anyone relies on such behaviour).

  Perhaps it would suffice to reject spaces in names, becuase that is
 perhaps particularly confusing.

 Indeed. I don't know how difficult is to decide whether a name is
 correct versus simply checking for spaces; ideally names should be well-
 formed, but if spaces are much easier to detect, doing just space-checks
 is already an improvement.

 Thanks!
 Iustin

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7484#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs