[Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Bulat Ziganshin
Hello haskell-cafe, now i'm reading Haskell' proposals and found that these two things considered as different: http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification http://hackage.haskell.org/trac/haskell-prime/wiki/PolymorphicComponents can you please explain me what is

[Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Albert Lai
As requested, I continue here the thread on the proposal for a web forum. You will soon enough find out what I think of web forums. Let me first show you what this mailing list looks like to me using software of my choice: ! [ 192: Mark Carroll] [Haskell-cafe] Card trick ! [ 37:

Re: [Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Ross Paterson
[apologies to Bulat for the repeat posting] On Thu, Sep 21, 2006 at 12:05:23PM +0400, Bulat Ziganshin wrote: now i'm reading Haskell' proposals and found that these two things considered as different: http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification

Re: [Haskell-cafe] [newbie] How to test this function?

2006-09-21 Thread Bulat Ziganshin
Hello Bruno, Thursday, September 21, 2006, 8:28:23 AM, you wrote: First, how do I fix the identation of the if then else? http://haskell.org/haskellwiki/IO_inside contains a lot of information about using IO monad Second, I want to test this function, without hitting the filesystem. In C++

Re: [Haskell-cafe] Trouble with simple embedding of shell in haskell

2006-09-21 Thread Bulat Ziganshin
Hello George, Thursday, September 21, 2006, 7:44:22 AM, you wrote: sh :: String - String - IO String sh cmd = \input - do (stdin, stdout, _, pid) - runInteractiveCommand cmd forkIO $ hPutStr stdin input hClose stdin -- get exit status to prevent zombie

Re[2]: [Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Bulat Ziganshin
Hello Ross, Thursday, September 21, 2006, 12:55:40 PM, you wrote: data Ex = forall a. Num a = Ex a and data Po = Po (forall a. Num a = a) Consider the types of the constructors: Ex :: forall a. (Num a) = a - Ex Po :: (forall a. (Num a) = a) - Po sorry, Ross, can you give me a more

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Gour
On Thu, 2006-09-21 at 04:55 -0400, Albert Lai wrote: As requested, I continue here the thread on the proposal for a web forum. You will soon enough find out what I think of web forums. [snip] I don't understand one thing: it looks like web-forums should exclude mailing lists and vice

Re: [Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Bruno Oliveira
Hello Bullat, now i'm reading Haskell' proposals and found that these two things considered as different: http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification http://hackage.haskell.org/trac/haskell-prime/wiki/PolymorphicComponents can you please explain me

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Kurt Hutchinson
On 9/21/06, Gour [EMAIL PROTECTED] wrote: So, why the two cannot co-exist and let users decide which one to use? Gentoo community is nice example of it. I was just about to ask the same thing. Clearly, some prefer email and some prefer web forums. This is undoubtably true of new Haskell users

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Bill Wood
I have only recently started accessing some web fora, but I've noticed that some of those powered by phpBB are vulnerable to spamming, whereas the news groups seem to be less so. For example, the python-forum has nearly lost it's General forum to spammers. Maybe the experts know better engines,

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Alex Queiroz
Hallo, On 9/21/06, Bill Wood [EMAIL PROTECTED] wrote: I have only recently started accessing some web fora, but I've noticed that some of those powered by phpBB are vulnerable to spamming, whereas the news groups seem to be less so. For example, the python-forum has nearly lost it's General

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Misha Aizatulin
Kurt Hutchinson wrote: Let those interested in a web forum set one up and run it. Those interested in email can ignore the web forum. My concern about introducing a web forum would be that it is yet another place I have to search every time I need information (besides the haskell report,

Re: [Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Bruno Oliveira
Hello Bullat, also, ghc66 adds impredicative polymorphism. how it differs from unqualified existentials? I have not tried ghc66, but I think one of the things you should be able to do and that is perhaps helpful for understanding existencial is: myList :: [forall a . Num a = a]

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-21 Thread Bruno Martínez
On Thu, 21 Sep 2006 01:52:38 -0300, Donald Bruce Stewart [EMAIL PROTECTED] wrote: First, how do I fix the identation of the if then else? getList = find 5 where find 0 = return [] find n = do ch - getChar if ch `elem` ['a'..'e'] then do

[Haskell-cafe] Re: Re: [newbie] How to test this function?

2006-09-21 Thread Bruno Martínez
On Thu, 21 Sep 2006 11:20:33 -0300, Henning Thielemann [EMAIL PROTECTED] wrote: On Thu, 21 Sep 2006, Bruno Martínez wrote: getList :: IO [Char] getList = take5 `fmap` getContents -- a thin IO skin take5 :: [Char] - [Char] take5 = take 5 . filter (`elem` ['a'..'e']) --

Re: [Haskell-cafe] [newbie] How to test this function?

2006-09-21 Thread Bruno Martínez
On Thu, 21 Sep 2006 05:30:34 -0300, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Bruno, Thursday, September 21, 2006, 8:28:23 AM, you wrote: First, how do I fix the identation of the if then else? http://haskell.org/haskellwiki/IO_inside contains a lot of information about using IO monad

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread David House
On 21/09/06, Misha Aizatulin [EMAIL PROTECTED] wrote: My concern about introducing a web forum would be that it is yet another place I have to search every time I need information (besides the haskell report, compiler docs and tracker, 2 wikis and the mailing lists :) So let's have a single

[Haskell-cafe] Non-existant existential?

2006-09-21 Thread Jim Apple
Consider the following: data SimpExist a = SimpExist (forall x . x - a) f :: SimpExist Bool f = SimpExist (const True) g = SimpExist id What is the type of g? In a similar example, GHC tells me it is of type SimpExist c. Yet, I can't unify it with any other SimpExist c'. It seems to me that

Re: [Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-21 Thread David House
On 20/09/06, John Ky [EMAIL PROTECTED] wrote: So Monads don't actually eliminate laziness? Monads and laziness are completely orthagonal issues; they have nothing to do with one another. I think you're getting confused with purity. Monads can be used to encapsulate effects, to allow you to

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Kurt Hutchinson
On 9/21/06, Misha Aizatulin [EMAIL PROTECTED] wrote: My concern about introducing a web forum would be that it is yet another place I have to search every time I need information (besides the haskell report, compiler docs and tracker, 2 wikis and the mailing lists :) That probably speaks to

Re: [Haskell-cafe] Non-existant existential?

2006-09-21 Thread Bruno Oliveira
Hello, Consider the following: data SimpExist a = SimpExist (forall x . x - a) f :: SimpExist Bool f = SimpExist (const True) g = SimpExist id What is the type of g? In a similar example, GHC tells me it is of type SimpExist c. Yet, I can't unify it with any other SimpExist c'. Have you tried

[Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Aaron Denney
Moved to haskell-cafe from haskell-general. On 2006-09-20, Niklas Broberg [EMAIL PROTECTED] wrote: On 9/20/06, Aaron Denney [EMAIL PROTECTED] wrote: And I disagree with you. Web forums are usenet reinvented poorly. It's impossible to keep track of what's new, threading is either poor or

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-21 Thread Benjamin Franksen
Bruno Martínez wrote: On Thu, 21 Sep 2006 01:52:38 -0300, Donald Bruce Stewart [EMAIL PROTECTED] wrote: First, how do I fix the identation of the if then else? getList = find 5 where find 0 = return [] find n = do ch - getChar if ch `elem` ['a'..'e']

[Haskell-cafe] Re: Re: Haskell web forum

2006-09-21 Thread Rene de Visser
I'll just add myself onto the list of webforum haters. I find gmane over a news reader much more comfortable that any webforums I have used. Perhaps gmane can be used over a web interface? Then those that want to use a web forum have one, and I can continue to use my news reader. When I want

[Haskell-cafe] Re: Re[2]: what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Benjamin Franksen
Bulat Ziganshin wrote: Hello Ross, Thursday, September 21, 2006, 12:55:40 PM, you wrote: data Ex = forall a. Num a = Ex a and data Po = Po (forall a. Num a = a) Consider the types of the constructors: Ex :: forall a. (Num a) = a - Ex Po :: (forall a. (Num a) = a) - Po sorry,

Re: [Haskell-cafe] Re: Re: Haskell web forum

2006-09-21 Thread Sebastian Sylvan
On 9/21/06, Rene de Visser [EMAIL PROTECTED] wrote: I'll just add myself onto the list of webforum haters. I find gmane over a news reader much more comfortable that any webforums I have used. Just to be clear. Is it worth debating which is better? Some people prefer one over the other,

Re: [Haskell-cafe] Re: Re: Haskell web forum

2006-09-21 Thread David House
On 21/09/06, Sebastian Sylvan [EMAIL PROTECTED] wrote: I do think we should try to do better than the usual suspects that are available though. Maybe even write something in Haskell? This sounds like a good test of maturity for Haskell web platforms. I'd love to be involved in a collaboration

Re[2]: [Haskell-cafe] [newbie] How to test this function?

2006-09-21 Thread Bulat Ziganshin
Hello Bruno, Thursday, September 21, 2006, 6:16:49 PM, you wrote: Second, I want to test this function, without hitting the filesystem. In C++ I would use a istringstream. I couldn't find a function that returns a Handle from a String. http://haskell.org/haskellwiki/Library/Streams

Re: [Haskell-cafe] Re: [newbie] How to test this function?

2006-09-21 Thread David House
On 21/09/06, Benjamin Franksen [EMAIL PROTECTED] wrote: Emacs is evil! I'll ignore the throwaway flaimbait there ;) It also inserts random tab characters into your code just to save a few space bytes. Tends to completely trash indentation e.g. when pasting code into mails etc. Not once

Re: [Haskell-cafe] Trouble with simple embedding of shell in haskell

2006-09-21 Thread Donn Cave
On Thu, 21 Sep 2006, George Brewster wrote: I'm just tried writing a function to allow convenient embedding of shell commands, but I'm running into behavior I don't really understand somewhere at the intersection of lazy evaluation, IO, and threading. You may also find some unwelcome

Re: [Haskell-cafe] Non-existant existential?

2006-09-21 Thread Jim Apple
On 9/21/06, Bruno Oliveira [EMAIL PROTECTED] wrote: Have you tried to type check this example (the g)? No. Please excuse me, as I wasn't by my GHC at the time. Let's try: data SimpExist a = Base a | SimpExist (SimpExist (forall x . x - a)) g :: SimpExist (forall a . a - a) g =

[Haskell-cafe] Polymorphism/monomorphism (and the restriction)

2006-09-21 Thread Aaron McDaid
Hi, I think the following might help a little in understanding the monomorphic restriction (which I don't fully understand myself). I'm a bit of a newbie so apologies in advance if I've made a mistake or if my description isn't as useful to others as it seems to me. I've been following a

Re: [Haskell-cafe] Non-existant existential?

2006-09-21 Thread Jim Apple
When I look at the generated core, I see that both h and same = Base undefined have the same type: %forall a . main:Fonly.SimpExist a I'm using GHC 6.5.20060819. If this is a bug, I actually find it kind of useful, for reasons I can elaborate later. Jim

[Haskell-cafe] Re: Trouble with simple embedding of shell in haskell

2006-09-21 Thread George Brewster
Donn Cave wrote: On Thu, 21 Sep 2006, George Brewster wrote: I'm just tried writing a function to allow convenient embedding of shell commands, but I'm running into behavior I don't really understand somewhere at the intersection of lazy evaluation, IO, and threading. You may also find

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-21 Thread Bruno Martínez
On Thu, 21 Sep 2006 15:12:07 -0300, Benjamin Franksen [EMAIL PROTECTED] wrote: OK. Thanks. I didn't find that one because it's not offered as an identation option in emacs haskell mode. Emacs is evil! I'm open to alternatives. I use Windows, so went out of the way to have emacs.

Re: [Haskell-cafe] Re: Trouble with simple embedding of shell in haskell

2006-09-21 Thread Donn Cave
On Thu, 21 Sep 2006, George Brewster wrote: ... Yup, I'm on linux. My goal is to have a function which gives me a lazy string which is the output of a shell command, and takes a string as input. In particular, I'd like the shell command to behave lazily (read only as much input as is