Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-21 Thread Henning Thielemann
Yitzchak Gale schrieb:

 * Find every single package depending on old-time and get it to use
 time instead.
 
 Most importantly, base.
 
 These old- packages have been deprecated for long enough.
 Dump them.

Once I tried to move from old-time to time. I quickly stop that attempt
because the types in 'time' are much less specific than in 'old-time'. I
see 'Int's everywhere in 'time'.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Jon Fairbairn

I'm probably terribly out of date with this, so I wonder if
anyone can save me the bother of working out what the
/preferred/ libraries are for (a) determining the
last-modified-time of a file or directory and (b) manipulating
the resulting time datum.

I can find System.Directory.getModificationTime and
Data.Time.formatTime, but using them together seems unduly
awkward.

-- 
Jón Fairbairn jon.fairba...@cl.cam.ac.uk
http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html  (updated 2010-09-14)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread David Virebayre
2010/11/16 Jon Fairbairn jon.fairba...@cl.cam.ac.uk:

 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.

I'm interested too. There's so many times and dates types it's confusing.
I had a problem last week, got it to compile but I'm not sure I'm
doint it right. ( asked but got no replies on the list )

David.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Michael Snoyman
On Tue, Nov 16, 2010 at 12:30 PM, Jon Fairbairn
jon.fairba...@cl.cam.ac.uk wrote:

 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.

Well, if it makes you feel any better: yes, it seems that you're doing
it the right way, and yes the right way is awkward. Perhaps it's time
to deprecate old-time and get directory to use the time datatypes
directly? While we're at it, maybe we could deprecate old-locale as
well. It's always awkward starting a new project and importing an
old-* library immediately...

Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Yitzchak Gale
Jon Fairbairn wrote:
 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.

It's not you who is out of date - it is the base library, which
*still* uses the long deprecated old-time library for these
kinds of functions.

Is there an existing trac ticket about this?

Going via a string representation is obviously not
the most robust or efficient method, but converting to a
CalendarTime and manually building a UTCTime
from it may not be worth the effort.

One alternative is to use the convertible package.
Then you can just say:

utc - fmap convert (getModificationTime myFile) :: IO UTCTime

Regards,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Antoine Latter
On Tue, Nov 16, 2010 at 6:42 AM, Michael Snoyman mich...@snoyman.com wrote:
 On Tue, Nov 16, 2010 at 12:30 PM, Jon Fairbairn
 jon.fairba...@cl.cam.ac.uk wrote:

 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.

 Well, if it makes you feel any better: yes, it seems that you're doing
 it the right way, and yes the right way is awkward. Perhaps it's time
 to deprecate old-time and get directory to use the time datatypes
 directly? While we're at it, maybe we could deprecate old-locale as
 well. It's always awkward starting a new project and importing an
 old-* library immediately...


What is the replacement for old-locale? I've used it and not known I
should have been using something better.

Antoine
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Michael Snoyman
On Tue, Nov 16, 2010 at 3:00 PM, Antoine Latter aslat...@gmail.com wrote:
 On Tue, Nov 16, 2010 at 6:42 AM, Michael Snoyman mich...@snoyman.com wrote:
 On Tue, Nov 16, 2010 at 12:30 PM, Jon Fairbairn
 jon.fairba...@cl.cam.ac.uk wrote:

 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.

 Well, if it makes you feel any better: yes, it seems that you're doing
 it the right way, and yes the right way is awkward. Perhaps it's time
 to deprecate old-time and get directory to use the time datatypes
 directly? While we're at it, maybe we could deprecate old-locale as
 well. It's always awkward starting a new project and importing an
 old-* library immediately...


 What is the replacement for old-locale? I've used it and not known I
 should have been using something better.

Sorry, I didn't mean that there *is* a replacement for it, I meant
that we should replace it with something that isn't old-*. It seems
that the original purpose of old-locale was to support many different
locale issues, not just time (I'm just going based on the docs).
However, since it currently does only support time, I would recommend
we just pack it up and throw it into the time package. In fact, as a
complete strawman, here's a proposal:

* Move System.Locale into the time package, bumping version number to 1.3.
* Bump old-locale to 1.1 and have it simply re-export System.Locale
from time. (Maybe we don't actually need to make that bump, 1.0.1 may
be sufficient.)
* Bump old-time to 2.0 (make it clear this is a *very* different
version) and have it re-export modules from time. (This is the part of
the proposal people should *really* beat up on.)
* Find every single package depending on old-time[1] and get it to use
time instead.

The last part especially will be difficult, but we can at least start
with the packages in the HP.

Michael

[1]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Yitzchak Gale
Michael Snoyman wrote:
 * Move System.Locale into the time package, bumping version number to 1.3.
 * Bump old-locale to 1.1 and have it simply re-export System.Locale
 from time. (Maybe we don't actually need to make that bump, 1.0.1 may
 be sufficient.)
 * Bump old-time to 2.0 (make it clear this is a *very* different
 version) and have it re-export modules from time. (This is the part of
 the proposal people should *really* beat up on.)

I disagree with all of these items, and only support the last item:

 * Find every single package depending on old-time and get it to use
 time instead.

Most importantly, base.

These old- packages have been deprecated for long enough.
Dump them.

Thanks,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Michael Snoyman
On Tue, Nov 16, 2010 at 3:23 PM, Yitzchak Gale g...@sefer.org wrote:
 Michael Snoyman wrote:
 * Move System.Locale into the time package, bumping version number to 1.3.
 * Bump old-locale to 1.1 and have it simply re-export System.Locale
 from time. (Maybe we don't actually need to make that bump, 1.0.1 may
 be sufficient.)
 * Bump old-time to 2.0 (make it clear this is a *very* different
 version) and have it re-export modules from time. (This is the part of
 the proposal people should *really* beat up on.)

 I disagree with all of these items, and only support the last item:

 * Find every single package depending on old-time and get it to use
 time instead.

 Most importantly, base.

 These old- packages have been deprecated for long enough.
 Dump them.

Well, time still depends on old-locale, so if you want to dump them
you'll need to do *something* about it. I frankly don't care too much
about keeping old-locale or old-time on further life support, I just
don't want to start having conflicting implementations of
System.Locale; it gives me too many not-fond-memories of the
mtl/transformers split.

Michael

PS: I'm still a little bit in shock that we actually got past the
mtl/transformers issue. Well done to everyone involved, especially
Ross.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Catching up on Time and Directory

2010-11-16 Thread Christopher Done
On 16 November 2010 11:30, Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote:

 I'm probably terribly out of date with this, so I wonder if
 anyone can save me the bother of working out what the
 /preferred/ libraries are for (a) determining the
 last-modified-time of a file or directory and (b) manipulating
 the resulting time datum.

 I can find System.Directory.getModificationTime and
 Data.Time.formatTime, but using them together seems unduly
 awkward.


Yep, it's still awkward. The annoying thing is these base libraries still
use the old time libraries. Here's me having to use both because of
getModificationTime:

https://github.com/chrisdone/amelie/blob/master/src/Amelie/Import.hs
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe