Re: The type of zip

2000-08-24 Thread Marcin 'Qrczak' Kowalczyk
26 Jul 2000 19:30:42 GMT, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] pisze: instance (ForeignArg fa ha, Call ff hf) = Call (fa - ff) (ha - hf) where callIO f = callIO . convertArg (\fa - f = return . ($fa)) BTW. I have not tested if it works nor thought how it would execute, but I

Re: The type of zip

2000-08-09 Thread Claus Reinke
[a while ago] From: Tom Pledger Claus Reinke writes: - one would think that () simply takes its role as a unit, so that (),a == a == a,() but if we know x::() does that imply that x,a == a ? x could be bottom, and the equations for the unit look strict in their unit

Re: The type of zip

2000-08-09 Thread Marcin 'Qrczak' Kowalczyk
Wed, 9 Aug 2000 20:27:14 +0100, Claus Reinke [EMAIL PROTECTED] pisze: In the language I had in mind, I would expect to be able to "retrieve" the () from any product, at any position I still prefer the list-like non-associative treatment of tuples. It needs not type system extensions. The

Re: The type of zip

2000-08-03 Thread Tom Pledger
Hi. Claus Reinke writes: - one would think that () simply takes its role as a unit, so that (),a == a == a,() but if we know x::() does that imply that x,a == a ? x could be bottom, and the equations for the unit look strict in their unit parameter, so probably not;

Re: The type of zip

2000-07-28 Thread Marcin 'Qrczak' Kowalczyk
Fri, 28 Jul 2000 08:23:52 -0700, Simon Marlow [EMAIL PROTECTED] pisze: It perhaps should be, but Int8 isn't a primitive type: it's implemented in terms of Int#. There should really be 8-bit, 16-bit and 32-bit primitive types in GHC It's not a problem: writeInt8OffAddr could take Int#. I

Re: The type of zip

2000-07-26 Thread Claus Reinke
Marcin 'Qrczak' Kowalczyk: Ah, I was once doing such overloading of IO functions. I tried but was not able to adapt it to "threaded" foreign calls. Help! Now it looks easier, but still I can't get it. You seem to like puzzles?-) I almost gave up on this one, and now it looks so simple...

Re: The type of zip

2000-07-26 Thread Marcin 'Qrczak' Kowalczyk
Wed, 26 Jul 2000 15:46:16 +0100, Claus Reinke [EMAIL PROTECTED] pisze: class CallN sigF sig where callN :: IO sigF - sig AAA! Thank you, it works now! Having IO in the argument here, together with doing the work inside the argument of the recursive call, was The Lacking Idea.

Re: The type of zip

2000-07-25 Thread Lennart Augustsson
If you are happy with the isomorphism (T1 x T2 x ...) - (T1 x (T2 x (...))) But in Haskell these are not isomorphic. (a,b,c) is NOT isomorphic to (a,(b,c)), just think about bottom. -- -- Lennart

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
Mon, 24 Jul 2000 09:04:58 +0100, Chris Angus [EMAIL PROTECTED] pisze: i.e. rather than having a read / show method for each type we have a generic one which "asks" the type which type it actually is or requests a constructor by name. Ugh, IMHO it's bad. Such operations should be overridable

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
Tue, 25 Jul 2000 09:02:36 +0200, Lennart Augustsson [EMAIL PROTECTED] pisze: If you are happy with the isomorphism (T1 x T2 x ...) - (T1 x (T2 x (...))) But in Haskell these are not isomorphic. (a,b,c) is NOT isomorphic to (a,(b,c)), just think about bottom. data a :, b = a :, !b

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
Mon, 24 Jul 2000 22:19:36 +0100, Claus Reinke [EMAIL PROTECTED] pisze: I only had a quick look at QForeign.hs, so I'm not sure whether this will help (do you really need that odd chaining of conversion functions? Values of out parameters contribute to the result returned. Parameters may

RE: The type of zip

2000-07-25 Thread Chris Angus
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 25 July 2000 09:30 To: [EMAIL PROTECTED] Subject: Re: The type of zip Mon, 24 Jul 2000 09:04:58 +0100, Chris Angus [EMAIL PROTECTED] pisze: I dont agree. To me it seems simply like a logical

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
25 Jul 2000 08:56:09 GMT, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] pisze: and why do you pass what seem to be conversion functions as parameters, do they not follow from the types?), Not always, e.g. char * may be in, out, or in/out parameter. It will get hairy with Unicode. But

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
Tue, 25 Jul 2000 10:16:24 +0100, Chris Angus [EMAIL PROTECTED] pisze: eg. readDyn could have the signature String - Dynamic It's not possible. Which types are "registered" to be read that way? What if types have conflicting printed representations? around this area I'd be more interested

Re: The type of zip

2000-07-25 Thread Marcin 'Qrczak' Kowalczyk
25 Jul 2000 08:56:09 GMT, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] pisze: Ah, I was once doing such overloading of IO functions. I tried but was not able to adapt it to "threaded" foreign calls. Help! Now it looks easier, but still I can't get it. Assume we have: class Arg f h where

Re: The type of zip

2000-07-25 Thread Claus Reinke
Lennart Augustsson: If you are happy with the isomorphism (T1 x T2 x ...) - (T1 x (T2 x (...))) But in Haskell these are not isomorphic. (a,b,c) is NOT isomorphic to (a,(b,c)), just think about bottom. Right, thanks. I should have been more precise. On the right, "the" product is

RE: The type of zip

2000-07-24 Thread Chris Angus
es [mailto:[EMAIL PROTECTED]] Sent: 21 July 2000 17:29 To: 'Mark Tullsen'; Matt Harden Cc: [EMAIL PROTECTED] Subject: RE: The type of zip | No doubt. But seriously, I was thinking of a "built-in" Zippable | instance just like we have for Ord, Enum, Show, etc. | | That'

Re: The type of zip

2000-07-24 Thread Fergus Henderson
On 24-Jul-2000, Chris Angus [EMAIL PROTECTED] wrote: Has anyone ever thought of trying to use reflection in these cases. Yes, I've thought of it. That is how we implement the generic `read' and `print' in Mercury. Using reflection like this seems to be a quite powerful technique; I think that

Re: The type of zip

2000-07-24 Thread Johan Jeuring
At 06:33 PM 7/24/00 +1000, Fergus Henderson wrote: On 24-Jul-2000, Chris Angus [EMAIL PROTECTED] wrote: Has anyone ever thought of trying to use reflection in these cases. Yes, I've thought of it. That is how we implement the generic `read' and `print' in Mercury. Using reflection like this

Re: The type of zip

2000-07-24 Thread Claus Reinke
Marcin 'Qrczak' Kowalczyk: Also I was not able to unify callN series from http://qrczak.ids.net.pl/qforeign.tar.gz (QForeign.hs). I only had a quick look at QForeign.hs, so I'm not sure whether this will help (do you really need that odd chaining of conversion functions? and why do you pass

Re: The type of zip

2000-07-24 Thread Matt Harden
Claus Reinke wrote: The problem with tuples is that each length of tuple comes as a separate piece of *syntax* in Haskell, not built in a compositional way from tuples of smaller length. Type classes enable meta-programming based on types, but not based on syntax.. If you are happy with

Re: The type of zip

2000-07-23 Thread Marcin 'Qrczak' Kowalczyk
Fri, 21 Jul 2000 09:29:11 -0700, Simon Peyton-Jones [EMAIL PROTECTED] pisze: http://research.microsoft.com/~simonpj/#derive Ahhh! Looks like it covers the case of deriving for newtypes! Does every currently derivable class fit into this? I wonder if it's able to derive Dynamic, which

RE: The type of zip

2000-07-21 Thread Simon Peyton-Jones
| No doubt. But seriously, I was thinking of a "built-in" Zippable | instance just like we have for Ord, Enum, Show, etc. | | That's what I thought you meant. But since I have a pet peeve about | how Haskell implementations work ... Is your peeve related to the built-in "deriving"

Re: The type of zip

2000-07-20 Thread Mark Tullsen
Matt Harden wrote: It has always seemed to me that having multiple zip functions with different names (zip, zip3, zip4, etc..) was unfortunate, and a single zip that handled all possible tuples would be better. Now, with Multi-Parameter Type Classes and Functional Dependencies, we have an

Re: The type of zip

2000-07-20 Thread Matt Harden
Mark Tullsen wrote: Matt Harden wrote: o A Zippable class be created, defining zip and unzip for all tuple types (or at least the first few) For _all_ tuple types? That's a lot of instance declarations ;-)! No doubt. But seriously, I was thinking of a "built-in" Zippable instance

Re: The type of zip

2000-07-20 Thread Mark Tullsen
Matt Harden wrote: Mark Tullsen wrote: Matt Harden wrote: o A Zippable class be created, defining zip and unzip for all tuple types (or at least the first few) For _all_ tuple types? That's a lot of instance declarations ;-)! No doubt. But seriously, I was thinking of a

Re: The type of zip

2000-07-20 Thread Marcin 'Qrczak' Kowalczyk
Thu, 20 Jul 2000 15:59:36 -0500, Matt Harden [EMAIL PROTECTED] pisze: I was thinking of a "built-in" Zippable instance just like we have for Ord, Enum, Show, etc. What about zipWith, curry, uncurry, liftM, zipWithM? Also I was not able to unify callN series from

The type of zip

2000-07-19 Thread Matt Harden
Fellow Haskellers, Please forgive my lack of brevity here. It has always seemed to me that having multiple zip functions with different names (zip, zip3, zip4, etc..) was unfortunate, and a single zip that handled all possible tuples would be better. Now, with Multi-Parameter Type Classes and