#2034: In FilePath, current directory should be ".", not ""
--------------------------------+-------------------------------------------
  Reporter:  igloo              |          Owner:  neil            
      Type:  proposal           |         Status:  closed          
  Priority:  normal             |      Milestone:  Not GHC         
 Component:  libraries (other)  |        Version:  6.8.1           
Resolution:  fixed              |       Keywords:                  
Difficulty:  Unknown            |             Os:  Unknown/Multiple
  Testcase:                     |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown       |  
--------------------------------+-------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Pushed, and filepath version bumped to 1.2.0.0:

 {{{
 Wed Nov  4 09:51:09 GMT 2009  Simon Marlow <[email protected]>
   * The current directory is ".", not "" (GHC bug #2034) (patch version 2)

   So now
           splitFileName "foo" = ("./", "foo")

   which gives us the additional property that

   > Valid x => isValid (fst (splitFileName x))

   This property is important, because it means that we can pass the
   result of takeDirectory to any of the functions in System.Directory,
   whereas previously we would have to check for the empty case first.

   After discussion on the libraries list, I removed the second part of
   the original change:

           "." </> x = x

   This small bit of normalisation was there to ensure that the property

   > Valid x => uncurry </> (splitFileName x) == x

   still held.  However, it was arguably inconsistent (see the
   discussion).  Now this property has an exception:

   > Valid x => uncurry (</>) (splitFileName x) == x || fst (splitFileName
 x) == "./"

   This is a small price to pay to gain the new property above.
 Shall I push this patch? (1/3)  [ynWsfvplxdaqjk], or ? for help: y
 Wed May  5 10:52:12 BST 2010  Simon Marlow <[email protected]>
   * bump to 1.2.0.0, after semantics change (current dir is now ".", not
 "")
 Shall I push this patch? (2/3)  [ynWsfvplxdaqjk], or ? for help: y
 Wed May  5 10:58:43 BST 2010  Simon Marlow <[email protected]>
   * warning suppression
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2034#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to