Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread ajb
G'day all. I asked: But more to the point: Can it send email? Quoting John Dorsey [EMAIL PROTECTED]: Can you give an example of a use case? I don't need one. It's not maximally flexible until it can send email. Cheers, Andrew Bromage ___

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread ajb
G'day all. Quoting Lennart Augustsson [EMAIL PROTECTED]: But I called it One. That's a _terrible_ name. One, surely is (), just as Zero is Void. While I'm at it, I really don't like the lexical syntax of comments. Someone should fix that. Cheers, Andrew Bromage

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Jason Dusek
Jason Dagit [EMAIL PROTECTED] wrote: Jason Dusek [EMAIL PROTECTED] wrote: John Dorsey [EMAIL PROTECTED] wrote: Now you can: * Solve any of the software problems that cannot be solved without the singleton tuple ! What would those be? I'm still trying to figure out how a

RE: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Mitchell, Neil
Quoting Lennart Augustsson [EMAIL PROTECTED]: But I called it One. I did a similar one for Yhc, and I think I called it Box. My guess was that boxing/unboxing wasn't an overloaded enough term :-) Thanks Neil ==

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Lennart Augustsson
Let me pick one example. Let's make a class that can convert between tuples and lists. Of course there are restriction when this works, but it can still be useful. class TupleList t l | t - l where tupleToList :: t - l listToTuple :: l - t instance TupleList () [a] where tupleToList

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Jason Dusek
Lennart Augustsson [EMAIL PROTECTED] wrote: Let me pick one example. Let's make a class that can convert between tuples and lists. -- XXX This doesn't work, and is just wrong. -- instance TupleList (a) [a] where --tupleToList (a) = [a] --listToTuple [a] = (a) It's not clear to me

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread David Menendez
On Fri, Oct 3, 2008 at 3:17 AM, Jason Dusek [EMAIL PROTECTED] wrote: Perhaps I am lacking in imagination, but I still can't see the value of one tuples. You can use them to defeat seq. undefined `seq` x == undefined OneTuple undefined `seq` x == x That might be useful if a polymorphic

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Lennart Augustsson
But (a) is not a lifted version of a, whereas (a,b) is a lifted version of the a b product. So it's not consistent, and thereby wrong. -- Lennart On Fri, Oct 3, 2008 at 6:07 PM, Jason Dusek [EMAIL PROTECTED] wrote: Lennart Augustsson [EMAIL PROTECTED] wrote: Let me pick one example. Let's

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Derek Elkins
On Fri, 2008-10-03 at 15:38 -0400, David Menendez wrote: On Fri, Oct 3, 2008 at 3:17 AM, Jason Dusek [EMAIL PROTECTED] wrote: Perhaps I am lacking in imagination, but I still can't see the value of one tuples. You can use them to defeat seq. undefined `seq` x == undefined OneTuple

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Don Stewart
derek.a.elkins: On Fri, 2008-10-03 at 15:38 -0400, David Menendez wrote: On Fri, Oct 3, 2008 at 3:17 AM, Jason Dusek [EMAIL PROTECTED] wrote: Perhaps I am lacking in imagination, but I still can't see the value of one tuples. You can use them to defeat seq. undefined `seq` x

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Jason Dusek
Lennart Augustsson [EMAIL PROTECTED] wrote: But (a) is not a lifted version of a, whereas (a,b) is a lifted version of the a b product. So it's not consistent, and thereby wrong. Well, we can't represent the unlifted product in Haskell, right? You have to use some constructor. So if we

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Tim Chevalier
On Fri, Oct 3, 2008 at 2:29 PM, Jason Dusek [EMAIL PROTECTED] wrote: Lennart Augustsson [EMAIL PROTECTED] wrote: But (a) is not a lifted version of a, whereas (a,b) is a lifted version of the a b product. So it's not consistent, and thereby wrong. Well, we can't represent the unlifted

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Luke Palmer
On Fri, Oct 3, 2008 at 7:26 PM, Tim Chevalier [EMAIL PROTECTED] wrote: On Fri, Oct 3, 2008 at 2:29 PM, Jason Dusek [EMAIL PROTECTED] wrote: Lennart Augustsson [EMAIL PROTECTED] wrote: But (a) is not a lifted version of a, whereas (a,b) is a lifted version of the a b product. So it's not

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Tim Chevalier
On Fri, Oct 3, 2008 at 7:24 PM, Luke Palmer [EMAIL PROTECTED] wrote: Well, unboxed tuples are not really lifted nor unlifed, since you can't even pass one to a function. It's true that unboxed tuples are not first-class. But what I mean by unlifted is that the type (# Int, Int #), when

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-03 Thread Luke Palmer
On Fri, Oct 3, 2008 at 8:32 PM, Tim Chevalier [EMAIL PROTECTED] wrote: On Fri, Oct 3, 2008 at 7:24 PM, Luke Palmer [EMAIL PROTECTED] wrote: Well, unboxed tuples are not really lifted nor unlifed, since you can't even pass one to a function. It's true that unboxed tuples are not first-class.

[Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread John Dorsey
Fellow Haskellers, Much attention has been paid over the years to the regrettable omission of singleton tuples from Haskell. I am pleased to announce OneTuple, a humble implementation of the singleton tuple for Haskell. Now you can: * Wrap a single value of any type in a OneTuple ! *

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread ajb
G'day all. Quoting John Dorsey [EMAIL PROTECTED]: Contributions are welcome. The project could use a tutorial, and a decent test suite. Strict singleton tuples are planned for the next version. I hope it has a Monad instance. But more to the point: Can it send email? Cheers, Andrew

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Simon Brenner
On 10/2/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day all. Quoting John Dorsey [EMAIL PROTECTED]: Contributions are welcome. The project could use a tutorial, and a decent test suite. Strict singleton tuples are planned for the next version. I hope it has a Monad

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Luke Palmer
On Thu, Oct 2, 2008 at 1:17 AM, Simon Brenner [EMAIL PROTECTED] wrote: On 10/2/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day all. Quoting John Dorsey [EMAIL PROTECTED]: Contributions are welcome. The project could use a tutorial, and a decent test suite. Strict singleton tuples

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Luke Palmer
Hmm, it looks like you forgot to write a Traversable instance. I don't believe: sequenceA (OneTuple [1,2,3,4]) = _|_ is correct. Here is my contribution! instance Traversable OneTuple where sequenceA (OneTuple x) = fmap OneTuple x Luke On Thu, Oct 2, 2008 at 12:56 AM, John Dorsey

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread John Dorsey
All, I'm bundling responses to save paper. [EMAIL PROTECTED] wrote: I hope it has a Monad instance. Naturally! But more to the point: Can it send email? Can you give an example of a use case? Do the Haskell-98 standard tuples have a correspondence feature? I wasn't able to find one with

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread John Goerzen
On Thu, Oct 02, 2008 at 03:58:12PM -0400, John Dorsey wrote: All, I'm bundling responses to save paper. [EMAIL PROTECTED] wrote: I hope it has a Monad instance. Naturally! But more to the point: Can it send email? Can you give an example of a use case? Do the Haskell-98

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread minh thu
2008/10/2 John Dorsey [EMAIL PROTECTED]: All, I'm bundling responses to save paper. [EMAIL PROTECTED] wrote: I hope it has a Monad instance. Naturally! But more to the point: Can it send email? Can you give an example of a use case? Do the Haskell-98 standard tuples have a

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Jason Dusek
John Dorsey [EMAIL PROTECTED] wrote: Now you can: * Solve any of the software problems that cannot be solved without the singleton tuple ! What would those be? I'm still trying to figure out how a singelton tuple is really distinct from a plain value. -- _jsn

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Jason Dagit
On Thu, Oct 2, 2008 at 2:46 PM, Jason Dusek [EMAIL PROTECTED] wrote: John Dorsey [EMAIL PROTECTED] wrote: Now you can: * Solve any of the software problems that cannot be solved without the singleton tuple ! What would those be? I'm still trying to figure out how a singelton

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Lennart Augustsson
Just FYI, at Credit Suisse I wrote a 1-tuple type a few years ago. It was the only way to get a consistent way of dealing with certain things. But I called it One. I think the OneTuple should be in the base library, I mean, ask an 8 year old what number is missing in this sequence

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Brandon S. Allbery KF8NH
On 2008 Oct 2, at 19:00, Jason Dagit wrote: On Thu, Oct 2, 2008 at 2:46 PM, Jason Dusek [EMAIL PROTECTED] wrote: John Dorsey [EMAIL PROTECTED] wrote: Now you can: * Solve any of the software problems that cannot be solved without the singleton tuple ! What would those be? I'm still