System.FilePath

System.FilePath is a Haskell library from Yhc originally, now with added tweaks.
Download

System.FilePath Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Siti Saleh
  • Publisher web site:
  • http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#filepath

System.FilePath Tags


System.FilePath Description

System.FilePath is a Haskell library from Yhc originally, now with added tweaks. System.FilePath is a Haskell library from Yhc originally, now with added tweaks. Pure Haskell 98 (with Hierarchical libraries), no preprocessor. It has a nice interface for doing file manipulations, and works portably between Windows and Unix. The interface is still changing, for that reason please use System.FilePath.Version_0_10 or System.FilePath.Version_0_11 which will be guaranteed to work unmodified in future releases.I have written a System.FilePath module in part based on the one inYhc, and in part based on the one in Cabal (thanks to Lemmih). The aimis to try and get this module into the base package, as FilePath's aresomething many programs use, but its all too easy to hack up a littlefunction that gets it right most of the time on most platforms, andthere lies a source of bugs.This module is Posix (Linux) and Windows capable - just importSystem.FilePath and it will pick the right one. Of course, if youdemand Windows paths on all OS's, then System.FilePath.Windows willgive you that (same with Posix). Written in Haskell 98 + HeirarchicalModules.Haddock: http://www-users.cs.york.ac.uk/~ndm/projects/filepath/System-FilePath.htmlDarcs: darcs get http://www.cs.york.ac.uk/fp/darcs/filepathSource: http://www.cs.york.ac.uk/fp/darcs/filepath/System/FilePath.hsHomepage: http://www-users.cs.york.ac.uk/~ndm/projects/libraries.phpIf you go to the haddock page there are a few little examples at thetop of the file.AcknowledgementsThanks to Marc Webber, shapr, David House, Lemmih, others...CompetitorsSystem.FilePath from Cabal, by LemmihFilePath.hs and NameManip.hs from MissingHThe one from Cabal and FilePath.hs in MissingH are both very similar, Istole lots of good ideas from those two.NameManip seems to be more unix specific, but all functions in that modulehave equivalents in this new System.FilePath module.Hopefully this new module can be used without noticing any lost functions,and certainly adds new features/functions to the table.Should FilePath by an abstract data type?The answer for this library is no. This is a deliberate design decision.In Haskell 98 the definition is 'type FilePath = String', and all functionsoperating on FilePath's, i.e. readFile/writeFile etc take FilePath's. Theonly way to introduce an abstract type is to provide wrappers for thesefunctions or casts between String's and FilePathAbstract's.There are also additional questions as to what constitutes a FilePath, andwhat is just a pure String. For example, "/path/file.ext" is a FilePath. Is"/" ? "/path" ? "path" ? "file.ext" ? ".ext" ? "file" ?With that being accepted, it should be trivial to writeSystem.FilePath.ByteString which has the same interface as System.FilePathyet operates on ByteString's.


System.FilePath Related Software