[Haskell-beginners] </>? Was: doesFileExist cannot get ~/blah_blah right

David McBride toad3k at gmail.com
Tue Apr 9 18:25:10 CEST 2013


There is a package system-filepath
http://hackage.haskell.org/package/system-filepath which fixes a lot of
quibbles people have with the way filepaths are implemented in haskell.
There are apparently a lot of problems with using strings as filepaths,
like the fact that they are slow, that they have encoding issues, and that
people cannot make a path that is system agnostic.

So the </> operator in that library just joins two filepaths together with
the correct slash.


On Tue, Apr 9, 2013 at 12:15 PM, Tommy M. McGuire <mcguire at crsr.net> wrote:

> On 04/09/2013 07:07 AM, Brent Yorgey wrote:
> > Also, since we are discussing portability, it's a much better idea to do
> >
> >   homedir </> "blah_blah"
> >
> > instead of homedir ++ "/blah_blah", since the former will use the
> > correct path separator character for whatever system it is compiled
> > on.
>
> Wait, what? Where'd "</>" come from?
>
>
> --
> Tommy M. McGuire
> mcguire at crsr.net
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130409/072c350a/attachment-0001.htm>


More information about the Beginners mailing list