Re[2]: [Haskell-cafe] Comma in the front

2006-07-14 Thread Bulat Ziganshin
Hello Tomasz, Friday, July 14, 2006, 9:31:32 AM, you wrote: There might be issues with tuples though, for example (1,2,) would be the (,) tuple and not the (,,) tuple, which is a bit weird. Besides, it might be a bit more natural if (1,2,) was a shorthand for (\x - (1,2,x)) in haskell-prime

[Haskell-cafe] Building Data.Time on WinXP GHC6.4.1

2006-07-14 Thread Alistair Bayley
Has anyone built Ashley's Data.Time package on Windows? I ask because timestuff.c fails to compile for me because it refers to fields (tm_zone, tm_gmtoff) in struct tm which don't seem to exist on Windows (at least, mingw). Alistair ___ Haskell-Cafe

[Haskell-cafe] ANN: Takusen 0.5

2006-07-14 Thread Alistair Bayley
Oleg and I are pleased to announce the release of a new version of Takusen (it's been a while; so long that we don't remember the last version number we used). The most significant code change is a new internal design (courtesy of Oleg) which gives better separation of concerns like statement

[Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Johan Holmquist
I'll answer my own post to elaborate: If Day (and Month) where NOT instances of Bounded, the following would be possible: [Monday .. Sunday] = should return [Monday, Tuesday ... Saturday, Sunday] = but returns [] [Saturday .. Tuesday] = should return [Saturday, Sunday, Monday, Tuesday] = but

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Henning Thielemann
On Fri, 14 Jul 2006, Johan Holmquist wrote: I'll answer my own post to elaborate: If Day (and Month) where NOT instances of Bounded, the following would be possible: [Monday .. Sunday] = should return [Monday, Tuesday ... Saturday, Sunday] = but returns [] Why not [Monday, Tuesday

[Haskell-cafe] Partial Tuple application (Was: Comma in the front)

2006-07-14 Thread Henning Thielemann
On Fri, 14 Jul 2006, Bulat Ziganshin wrote: Hello Tomasz, Friday, July 14, 2006, 9:31:32 AM, you wrote: There might be issues with tuples though, for example (1,2,) would be the (,) tuple and not the (,,) tuple, which is a bit weird. Besides, it might be a bit more natural if

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Malcolm Wallace
Johan Holmquist [EMAIL PROTECTED] wrote: If Day (and Month) where NOT instances of Bounded, the following would be possible: [Saturday .. Tuesday] = should return [Saturday, Sunday, Monday, Tuesday] = but returns [] This does seem like a reasonable argument to me. Some enumerations are

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Chris Kuklewicz
Try this: module Cycle (Cyclic(..)) where import System.Time import Data.Word import Data.Int class (Eq c,Enum c, Bounded c) = Cyclic c where cyclePeriod :: c - Int cyclePeriod _ = fromEnum (maxBound :: c) - fromEnum (minBound :: c) + 1 succCycle :: c - c succCycle c | c ==

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Chris Kuklewicz
Hmmm... I think I should have said: toCycle :: Int - c toCycle = toEnum . (+ (fromEnum (minBound::c))) . (`mod` (cyclePeriod (undefined::c))) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Chris Kuklewicz
Okay...final version attached. This one fixes the toCycle bugs and changes from Int to Integer so overflow is no longer an issue. The result of cycleFromThenTo fits what I would expect, but you are free to drop this or adapt it. cycleFrom and cycleFromTo and cycleFromThen are easy, since

[Haskell-cafe] Re: Partial Tuple application (Was: Comma in the front)

2006-07-14 Thread Christian Maeder
Henning Thielemann schrieb: in haskell-prime list there was a proposal to use '?' for such things: (1,2,?) only problem is what it's hard to define exactly where the lambda should arise: the placeholder '?' becomes part of a new implicit identifier (that exceeds Haskell's identifier

[Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Johan Holmquist
Yes, it would be possible to make ones own class and instantiate from that. I was just thinking Day and Month should be cyclic per default. from Henning Thielemann: Since the days are cycling, what is more natural about your result compared to my one? I would prefer the one without any

[Haskell-cafe] Re: Partial Tuple application

2006-07-14 Thread Henning Thielemann
On Fri, 14 Jul 2006, Christian Maeder wrote: Henning Thielemann schrieb: in haskell-prime list there was a proposal to use '?' for such things: (1,2,?) only problem is what it's hard to define exactly where the lambda should arise: the placeholder '?' becomes part of a new

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Henning Thielemann
On Fri, 14 Jul 2006, Johan Holmquist wrote: from Henning Thielemann: Since the days are cycling, what is more natural about your result compared to my one? I would prefer the one without any repetitions. I assume the Bounded instance exists in order to allow loops like liftM2 (,)

[Haskell-cafe] Re: Building Data.Time on WinXP GHC6.4.1

2006-07-14 Thread Simon Marlow
Alistair Bayley wrote: Has anyone built Ashley's Data.Time package on Windows? I ask because timestuff.c fails to compile for me because it refers to fields (tm_zone, tm_gmtoff) in struct tm which don't seem to exist on Windows (at least, mingw). Yes, I made it work on Windows recently. The

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread David Roundy
Interestingly, your Cyclic class idea may have practical purposes beyond enumeration. Integers modulo some number are also cyclical, and can come in very handy. In fact, raw unsigned ints are modulo 2^32 (or something like that), so they really ought (under one interpretation) to be members of

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread David House
On 14/07/06, David Roundy [EMAIL PROTECTED] wrote: Anyhow, just thought I'd mention that this isn't useful only for ordinary cyclic objects like dates. Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :) I think this would be a great class to have in the standard libs.

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread David House
On 14/07/06, Johan Holmquist [EMAIL PROTECTED] wrote: You mean [Monday, Tuesday ... Sunday, Monday] ? Actually not. No repetitions. That seems like a very bad idea. '..' normally means 'inclusive', breaking those semantics would be a very weird thing to do, and breaks the principle of least

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread Chris Kuklewicz
David House wrote: On 14/07/06, David Roundy [EMAIL PROTECTED] wrote: Anyhow, just thought I'd mention that this isn't useful only for ordinary cyclic objects like dates. Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :) And the new version takes everything to

Re: [Haskell-cafe] Re: Why is Day and Month bounded?

2006-07-14 Thread David Roundy
On Fri, Jul 14, 2006 at 02:28:20PM +0100, David House wrote: On 14/07/06, David Roundy [EMAIL PROTECTED] wrote: Anyhow, just thought I'd mention that this isn't useful only for ordinary cyclic objects like dates. Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :) Ah,

[Haskell-cafe] Re: Partial Tuple application

2006-07-14 Thread Christian Maeder
Henning Thielemann schrieb: I have seen $f(\cdot)$ instead of $f$ really often, as well as $f(\cdot-k)$ for \x - f(x-k). yes, but for first order functions only. Then parens can be seen as part of the identifier (as I showed for tuples before). Christian

[Haskell-cafe] The History of Haskell

2006-07-14 Thread Simon Peyton-Jones
Friends, Phil Wadler, John Hughes, Paul Hudak and I have been writing a paper about the The History of Haskell We've submitted an earlier draft to the History Of Programming Languages conference (HOPL'07), and it's been accepted. We have to submit a more-or-less final draft by 1

[Haskell-cafe] can't WashNGo (abstract tables)

2006-07-14 Thread Ferenc Wagner
Hi, trying to put WashNGo-2.9 to a nontrivial prototyping job gave some very compelling results so far, but also got me stumped on occasions. I'd be grateful for some guidance on the following points, concerning abstract tables mainly. * selectionDisplay: looks like displayFun (fourth arg)

Re: [Haskell-cafe] ldap-haskell questions

2006-07-14 Thread Donn Cave
On Thu, 13 Jul 2006, Ferenc Wagner wrote: ... Second, I find no trace of SSL/TLS routines. Is that really left out, or do I overlook something? OpenLDAP supports an option LDAP_OPT_X_TLS -- ldap_set_option Nothing LDAP_OPT_X_TLS LDAP_OPT_X_TLS_DEMAND ... ldapconnection -

Re: [Haskell-cafe] The History of Haskell

2006-07-14 Thread Bulat Ziganshin
Hello Simon, Friday, July 14, 2006, 7:21:26 PM, you wrote: The History of Haskell how about naming it Haskell: lazy programmer's language ? :) -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe

Re: [Haskell-cafe] Computing lazy and strict list operations at the same time

2006-07-14 Thread Andrew Pimlott
On Mon, Jun 19, 2006 at 05:50:13PM +0100, Duncan Coutts wrote: On Mon, 2006-06-19 at 17:03 +0100, Jon Fairbairn wrote: il [] = error foo il [x] = ([], x) il (x:xs) = cof x (il xs) where cof x ~(a,b) = (x:a, b) -- ! From a quick test, it looks like

[Haskell-cafe] Windows PowerShell Monad

2006-07-14 Thread Chad Scherrer
Yep, that's its codename. Now, I'm not much of a Windows person. Is the name just a weird coincidence, or does it have anything to do with monads as we know them? http://en.wikipedia.org/wiki/MSH_(shell) -- Chad Scherrer Time flies like an arrow; fruit flies like a banana -- Groucho Marx

Re: [Haskell-cafe] Type of a function?

2006-07-14 Thread Jared Updike
Did you try putting this in a file, say, t.hsand running ghci t.hs then typing :type func at the GHCi prompt? It should tell you the function type. Jared. On 7/14/06, Jenny678 [EMAIL PROTECTED] wrote: Hallo Can somebody tell me the type of the following function? func ::

Re: [Haskell-cafe] Type of a function?

2006-07-14 Thread Jared Updike
(leave off the line with func :: ??? and the compiler will figure it out for you, if possible---it works in this case) Jared. On 7/14/06, Jared Updike [EMAIL PROTECTED] wrote: Did you try putting this in a file, say, t.hsand running ghci t.hs then typing :type

Re: [Haskell-cafe] Comma in the front

2006-07-14 Thread Brian Hulley
Tim Docker wrote: These layouts feel a bit artificial to me. I am quite partial to python's list syntax - a trailing comma is optional. meaning you can write [ a, b, c, ] I'm surprised this approach isn't more widespread - Are there reasons why haskell syntax could

[Haskell-cafe] Re: XML transformation difficulties

2006-07-14 Thread Greg Fitzgerald
Adding some code to go along with my last post:main = do [tree] - runX (readDocument [(a_validate, 0)] text.xml) [fooDoc ] - runX (constA tree processChildren isFoo) [expanded] - runX (constA tree processTopDown (expandNode fooDoc `when` hasName bar)) [status] - runX (constA expanded