Re: update of ghc-6.0 rpms for Red Hat Linux 9

2003-06-05 Thread Martin Norbäck
tor 2003-06-05 klockan 08.18 skrev Jens Petersen: ps If you wish to have the prof libs too next time I build, please let me know. I use them so rarely myself that I didn't bother to build them, but I don't mind doing so if there is demand. I think there may be a demand. I use profiling

Re: Collecting values from Functors?

2003-06-05 Thread Ralf Laemmel
Ralf Hinze wrote: What happens if the tree contains additional integers to record, say, balancing information. The information a functor provides is vital here. Take as the simplest example newtype Weighted a = WithWeight (Int, a) Without the functor definition there is no way to

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-05 Thread Ross Paterson
On Thu, Jun 05, 2003 at 09:25:11AM +0200, John Hughes wrote: On Wed, 4 Jun 2003, Ross Paterson wrote: + \item[unsafePerformIO ::\ IO a - a] + Return the value resulting from executing the \code{IO} action. + This value should be independent of the environment; + otherwise, the system

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-05 Thread Alastair Reid
That is, document unsafePerformIO enough to serve the FFI, but stipulate limits to preserve equational reasoning. I think this is very hard to do. When we use unsafePerformIO in the ffi, we are using the IO monad to sequence [un]marshalling side-effects. For example, peeking and poking

Re: Collecting values from Functors?

2003-06-05 Thread Tomasz Zielonka
On Thu, Jun 05, 2003 at 09:08:03AM +1200, Tom Pledger wrote: | I am sorry, I misunderstood the problem. You're too modest. :-) There *is* a solution in that direction. Yes, I knew I could use a State monad or a Writer monad, but I thought that it would be an overkill. Fold is more

Re: forall quantifier

2003-06-05 Thread Andreas Rossberg
Ketil Z. Malde wrote: I have a function declared as: anova2 :: (Fractional c, Ord b) = [a-b] - (a-c) - [a] - [Anova1 c] where the first parameter is a list of classifiers. I could simplify it, I guess, to something like classify :: Eq b = [a-b] - [a] - [[[a]]]

Re: forall quantifier

2003-06-05 Thread Graham Klyne
I don't properly understand this either, but as it happens I was looking at this in the GHC user guide only yesterday... [[ : MkFoo :: forall a. a - (a - Bool) - Foo Nil :: Foo Notice that the type variable a in the type of MkFoo does not appear in the data type itself, which is plain

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-05 Thread Manuel M T Chakravarty
Ross Paterson [EMAIL PROTECTED] wrote, On Fri, May 23, 2003 at 07:33:05AM +1000, Manuel M T Chakravarty wrote: Dear Haskell Folks, Release Candidate 10 of the H98 FFI Addendum 1.0 is now available from http://www.cse.unsw.edu.au/~chak/haskell/ffi/ I have an ideological

Re: labelled fields

2003-06-05 Thread George Russell
Steffen wrote I need something like data Type = TCon String {lmtc::Maybe String} ... but this does not seem to be possible. Instead I have to waste identifiers: data Type = TCon {senseless::String,lmtc::Maybe String} ... Why? Are there any formal reasons against the above declaration?

Re: forall quantifier

2003-06-05 Thread Tomasz Zielonka
On Wed, Jun 04, 2003 at 02:46:59PM +0200, [EMAIL PROTECTED] wrote: Now I want to print part of the record. What I would like to do is the following putStrLn $ concatMap show [a,c,d] !!! bang !!! So what I actually do is putStrLn $ concat [show a, show c, show d] Works, but a

RE: forall quantifier

2003-06-05 Thread Markus . Schnell
Yes, this would work, thanks. But let me extent my question: what if all the types would be in a class FakeClass which has function specialID :: a - ID and I would like to do foo $ map specialID [a,b,c,d] ? ___ Haskell mailing list [EMAIL PROTECTED]

Re: forall quantifier

2003-06-05 Thread Tomasz Zielonka
On Wed, Jun 04, 2003 at 04:43:10PM +0200, [EMAIL PROTECTED] wrote: Yes, this would work, thanks. But let me extent my question: what if all the types would be in a class FakeClass which has function specialID :: a - ID and I would like to do foo $ map specialID [a,b,c,d] ? Well, in

Collecting values from Functors?

2003-06-05 Thread Graham Klyne
I'm trying to figure if there's any way I can use (say) monads to collect values from a Functor. For example, suppose I have a tree of some values that supports fmap, is there any way I can use the fmap function to collect a list of all the node values? #g --- Graham Klyne

RE: Haddock module description

2003-06-05 Thread Graham Klyne
At 14:58 04/06/03 +0100, Simon Marlow wrote: Haddock understands the style of module header that we're using for the hierarchical libraries. The module header is described in this document (see the section Reference Libraries-Coding Style-Module Header):

Re: Typesafe MRef with a regular monad

2003-06-05 Thread Tim Sweeney
Conjecture: It's impossible to implement RefMonad directly in Haskell without making use of built-in ST or IO functionality and without unsafe or potentially diverging code (such as unsafeCoerce). Any takers? If this is true or suspected to be true, any thoughts on whether a structure besides

Re: Typesafe MRef with a regular monad

2003-06-05 Thread Derek Elkins
On Wed, 04 Jun 2003 15:19:53 -0700 Ashley Yakeley [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Ashley Yakeley wrote: ] ] Is it possible to actually implement a working instance of RefMonad in ] ] Haskell, without making use of a built-in monad like

Re: Typesafe MRef with a regular monad

2003-06-05 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Derek Elkins [EMAIL PROTECTED] wrote: M = (forall s.ST s) R = STRef s e.g. runST :: (forall s.ST s a) - a you can use the same trick for your own RefMonad. I'm not sure if this will work with RefMonad exactly. If ST/STRef can be made an instance of

ExtractableFunctors and Some HScheme Internals Explained

2003-06-05 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Tom Pledger [EMAIL PROTECTED] wrote: Here's my version of fmapM, which was inspired by something in Tim Sheard's paper Generic Unification via Two-Level Types and Parameterized Modules. Gosh well I came across something very similar completely independently:

Re: Collecting values from Functors?

2003-06-05 Thread Ralf Hinze
Rather than using fmap, why not use gmap in GHC. Using an appropriate generic traversal scheme, say listify, all the code you write is the following expression: listify (const True) mytree :: [Int] if you are looking for all the Ints in mytree = Fork (Leaf 42) (Fork (Leaf 88) (Leaf 37))

[tim@epicgames.com: Fw: Typesafe MRef with a regular monad]

2003-06-05 Thread Andrew J Bromage
G'day all. On Wed, Jun 04, 2003 at 07:31:03PM -0500, Tim Sweeney wrote: Conjecture: It's impossible to implement RefMonad directly in Haskell without making use of built-in ST or IO functionality and without unsafe or potentially diverging code (such as unsafeCoerce). Any takers? WARNING:

Re: Safe and sound STRef [Was Implementing RefMonads in Haskell without ST,IO]

2003-06-05 Thread Tim Sweeney
Oleg, This is a very neat solution to providing coercion-free references in a local environment. I'm trying to generalize this to some sort of Monad-like typeclass, where there is a nice mapping from Monad's to this new and more powerful typeclass, so that one can combine typed references, IO,

update of ghc-6.0 rpms for Red Hat Linux 9

2003-06-05 Thread Jens Petersen
20030602()1145 Jens Petersen : I have built rpms of ghc-6.0 on Red Hat Linux 9. I didn't build the libraries with profiling this time, however the package includes the docs, the xlib binding from hslibs and hence green-card from cvs too (a number of patches/hacks were needed for this and they

[ ghc-Bugs-748490 ] -odir bug

2003-06-05 Thread SourceForge.net
Bugs item #748490, was opened at 2003-06-03 22:16 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=108032aid=748490group_id=8032 Category: Compiler Group: 6.0 Status: Closed Resolution: Fixed Priority: 5

[ ghc-Bugs-742220 ] readFile problems

2003-06-05 Thread SourceForge.net
Bugs item #742220, was opened at 2003-05-23 09:22 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=108032aid=742220group_id=8032 Category: None Group: None Status: Closed Resolution: None Priority: 5

[ ghc-Bugs-668705 ] hsc2hs broken under Win32

2003-06-05 Thread SourceForge.net
Bugs item #668705, was opened at 2003-01-15 20:12 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=108032aid=668705group_id=8032 Category: None Group: 5.04.2 Status: Closed Resolution: Fixed Priority: 8

[ ghc-Bugs-721511 ] Non-exhaustive patterns in ParseMonad.hs

2003-06-05 Thread SourceForge.net
Bugs item #721511, was opened at 2003-04-15 00:40 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=108032aid=721511group_id=8032 Category: hslibs/hssource Group: 5.04.3 Status: Closed Resolution: Fixed

Re: Haddock module description

2003-06-05 Thread Christian Maeder
Simon Marlow wrote: Haddock understands the style of module header that we're using for the hierarchical libraries. The module header is described in this document (see the section Reference Libraries-Coding Style-Module Header):

Incorrect Mime Type for Mac OS Package

2003-06-05 Thread Wolfgang Thaller
Hi, The Haskell Web Server claims that the .dmg file for the MacOS Package is of type text/plain; some browsers on MacOS (IE and Netscape) therefore try to display it as plain text instead of downloading it. Is anyone able to fix that somehow? Cheers, Wolfgang

update of ghc-6.0 rpms for Red Hat Linux 9

2003-06-05 Thread Jens Petersen
20030602()1145 Jens Petersen : I have built rpms of ghc-6.0 on Red Hat Linux 9. I didn't build the libraries with profiling this time, however the package includes the docs, the xlib binding from hslibs and hence green-card from cvs too (a number of patches/hacks were needed for this and they

Re: powerset

2003-06-05 Thread Liyang HU
Hi Graham, On Wed, Jun 04, 2003 at 12:08:38PM +0100, Graham Klyne wrote: I thought this may be a useful exercise to see how well I'm picking up on functional programming idioms, so I offer the following for comment: foldl (++) [] [ combinations n as | n - intRange 1 (length as) ] By

Re: powerset

2003-06-05 Thread Graham Klyne
At 15:08 04/06/03 +0100, Liyang HU wrote: A key point is to try and think of how you can relate one case of the problem to a simpler instance of the same problem, rather than tackling it head on. I think that's a good idea to hang on to. Sometimes easier to say than to do, it seems. Thanks, #g

Re: powerset

2003-06-05 Thread Graham Klyne
At 14:00 04/06/03 +0100, Keith Wansbrough wrote: Looks fine, but you're right - the use of combinations is inefficient. It's better to iterate over the elements, rather than the length. Then as you add each element, you consider all the sets you have so far, and either add the new element to

Re: FFI Help

2003-06-05 Thread Glynn Clements
Malcolm Wallace wrote: foreign import ccall math.h signgam signgamC :: IO Int signgam is an int variable, but this assumes that it is a function of type int signgam(void). Write a C wrapper int get_signgam(void) { return signgam; } and import that. Or alternatively, foreign

Re: powerset

2003-06-05 Thread Andrew J Bromage
G'day all. On Wed, Jun 04, 2003 at 02:00:08PM +0100, Keith Wansbrough wrote: This formulation is particularly nice because in memory, you *share* all of the lists from the previous iteration, rather than making copies. [...] Notice all the sharing - this is a very efficient representation!