-fallow-overlapping-instances Request

2002-05-17 Thread Ashley Yakeley
Currently -fallow-overlapping-instances only allows overlapping instances if one is a strict subset of the other. This is good (determinate), but sometimes you really need two instances that partially overlap. It would be nice if this could be disambiguated simply with another instance

Re: -fallow-overlapping-instances Request

2002-05-17 Thread Johannes Waldmann
Currently -fallow-overlapping-instances only allows overlapping instances if one is a strict subset of the other. This is good (determinate), but sometimes you really need two instances that partially overlap. From a type-theoretic viewpoint, instance declarations are relations between

RE: efficiency of UArray

2002-05-17 Thread Russell O'Connor
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 16 May 2002, Simon Peyton-Jones wrote: GHC doesn't remove intermediate lists down both branches of a zip, so yes, you'll get intermediate lists. Does deforestation not apply in this situation? - -- Russell O'Connor

Class Multiplicity

2002-05-17 Thread Ashley Yakeley
I have a curious Haskell design pattern. It's called one class per function. It's strange, but I find that as I need more and more generality, I end up with classes that look like this: class (Monad m) = MonadGettableReference m r where { get :: forall a. r a - m a;

Re: What does FP do well? (was How to get ...)

2002-05-17 Thread Jerzy Karczmarczuk
Bjorn Lisper: ...sometimes the length of a list being returned from a function can be a simple function of the function arguments (or the sizes of the arguments), think of map for instance. In such cases, a static program analysis can sometimes find the length function. If we know thee

Re: ASSIST ME

2002-05-17 Thread Jim Farrand
On Friday 17 May 2002 02:10, John Peterson wrote: We could go to member-only posting if that's what people want but it means that students asking their homework questions will have a harder time :-). Surely that's a good thing! Maybe they will go to the people who are paid to help them, or

Re: What does FP do well? (was How to get ...)

2002-05-17 Thread Bjorn Lisper
Jerzy: Me: ...sometimes the length of a list being returned from a function can be a simple function of the function arguments (or the sizes of the arguments), think of map for instance. In such cases, a static program analysis can sometimes find the length function. If we know thee functions

Positions Available

2002-05-17 Thread N Ghani
There are a number of people interested in FP at the University of Leicester, so maybe we can increase that number ... UNIVERSITY OF LEICESTER DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE The Department of Mathematics and

RE: Negative literals and the meaning of case -2 of -2 - True

2002-05-17 Thread Simon Marlow
To find out how Haskell implementations treat negated literals, I tested the following program: main = print (minusTwo,trueOrFalse) minusTwo = -2::N trueOrFalse = case minusTwo of -2 - True _ - False data N =

Call for papers for the SSGRR 2002s. Conference in L`Aquila near Rome,Italy (Jul 29 - Aug 4 2002.)

2002-05-17 Thread ssgrr2002s
Dear Dr. Haskell, I have been appointed to serve as the General Chair of the Summer 2002 edition of the SSGRR series of international conferences. The SSGRR-2002S (Summer) conference on Infrastructure for e-Business, e-Education, e-Science, and e-Medicine takes place in SSGRR (Scuola Superiore

Re: Dependent Types

2002-05-17 Thread dominic . j . steinitz
Robin, Thanks very much for this. My problem turned out to be tripping over the monomorphism restriction. When I looked at this it looked like a candidate for dependent types but as you point out you can solve this just as well in Haskell 98. You save a set of brackets with my approach!

Re: Class Multiplicity

2002-05-17 Thread Brian Huffman
On Thursday 16 May 2002 11:48 pm, Ashley Yakeley wrote: I have a curious Haskell design pattern. It's called one class per function. [...] I'm not sure if this is a good thing or a bad thing or what. You might want to take a look at the class system for the language Concurrent Clean. It

I need to know

2002-05-17 Thread matush23
Hi. Im a new haskell user, I know there are library about graphs, but i need to know all the info about, where I can download this library, and what can i do with it, and how can I use it. Thanks. __ Your favorite stores,

Re: convering Fds to Handles

2002-05-17 Thread Jens Petersen
Sebastien Carlier [EMAIL PROTECTED] writes: Specifically, I'd like to use pipe from the Posix library to create a pipe and then pass one end of it to runProcess as its stdin. You may want to take a look at POpen (available from hslibs cvs, or

Ò»Ìõ¿í´ø¾Í×ã¹»ÁË£¡

2002-05-17 Thread tony
ÄúºÃ£¬ÎÒÊDZ±¾©ÍòÀÊÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾Êг¡¿ª·¢²¿£¨Mario

Re: convering Fds to Handles

2002-05-17 Thread Sebastien Carlier
Hi, I have had problems with pipes and runProcess, now I am using forkProcess/executeFile/getProcessStatus and it works properly. Non-lazy IO presumably? Do you have an example you can show? Sure: ---_%--- cut here ---_%--- module Main where import IO import Posix import System main =

Re: convering Fds to Handles

2002-05-17 Thread Jens Petersen
Sebastien Carlier [EMAIL PROTECTED] writes: I have had problems with pipes and runProcess, now I am using forkProcess/executeFile/getProcessStatus and it works properly. Non-lazy IO presumably? Do you have an example you can show? Sure: ---_%--- cut here ---_%--- snip ---_%---

Re: convering Fds to Handles

2002-05-17 Thread Sebastien Carlier
I meant do you have an example of your working code. Sure. SubProcess.lhs Description: Binary data localhost% cat Main.hs module Main where import SubProcess main = do cs - subprocess /bin/cat [] (Just $ replicate 1 $ 'a') putStrLn $ show $ length cs localhost%

Re: convering Fds to Handles

2002-05-17 Thread Jerry, JiJie
* Sebastien Carlier [EMAIL PROTECTED] [020517 17:17]: I meant do you have an example of your working code. Sure. I'm sorry if this is a bit off-topic, but I got the following error when compiling Sebastien's code (with my ghc-5.02.3-2mdk): SubProcess.lhs:5: failed to load interface

Re: convering Fds to Handles

2002-05-17 Thread Sebastien Carlier
On Friday, May 17, 2002, at 11:58 AM, Jerry, JiJie wrote: SubProcess.lhs:5: failed to load interface for `Posix': Could not find interface file for `Posix' while my Posix library files found in /usr/lib/ghc-5.02.3/imports/posix/ and also my /usr/lib/ghc-5.02.3/package.conf

Simple Question Again

2002-05-17 Thread Jerry
Hi, I'm sorry to bother everyone again with this simple append' stuff -- below is my revised append' function 1) append' :: [[a]] - a - [[a]] 2) append' [] y = [[y]] 3) append' (x:xs) y = 4) case xs of [] - foldr (:) [y] x 5)(z:zs) - (init (x:xs)) ++ [(last xs)++[y]] -- to

Re: Simple Question Again

2002-05-17 Thread Jay Cox
On Fri, 17 May 2002, Jerry wrote: Hi, I'm sorry to bother everyone again with this simple append' stuff -- now this is something I _really_ don't understand: -- x is of type [a], [y] is of type [a], and isn't foldr (:) [a] [a] -- perfectly valid?! :type foldr forall a b. (a - b - b) - b -

Q: Resolving ambiguous type variable

2002-05-17 Thread tty
Hello, I am writing a function which returns an exception/error string should an unexpected parameter is passed in. Borrowing from the Maybe module I have the following: data Result a = Ex String | Value a deriving Show --

Re: Q: Resolving ambiguous type variable

2002-05-17 Thread Hal Daume III
In short, you cannot. What if your main were: main = getArgs = print . first_h The compiler doesn't know the difference and so it needs a type. Simple fix: main = print (first_h ([] :: [Char])) -- Hal Daume III Computer science is no more about computers| [EMAIL PROTECTED] than

Re: Q: Resolving ambiguous type variable

2002-05-17 Thread Hal Daume III
Erm, I think I said something stupid (or at least implied it). main = getArgs = print . first_h *will* work, because it knows that the result of a getArgs is a list of Strings. The problem you originally had was that when you say: first_h [] The [] could refer to a list of any type of

Re: Q: Resolving ambiguous type variable

2002-05-17 Thread Hal Daume III
The problem is that a is still ambiguous. For instance, look at the difference between: show ([] :: [Int])== [] show ([] :: [Char]) == because character lists are shown between quotes. so even though we know that this type variable a is an instance of show, we still