Re: [Haskell-cafe] Is Harper right that Haskell cannot model the natural numbers?

2011-05-03 Thread Emilio Jesús Gallego Arias
Richard O'Keefe o...@cs.otago.ac.nz writes: In one of his blog posts, Robert Harper claims that the natural numbers are not definable in Haskell. SML datatype nat = ZERO | SUCC of nat Haskell data Nat = Zero | Succ Nat differ in that the SML version has strict constructors, and so

[Haskell-cafe] Re: Monad explanation

2009-02-09 Thread Emilio Jesús Gallego Arias
Gregg Reynolds d...@mobileink.com writes: But it can't be a function, since it is non-deterministic. IMHO, if you assume IO a = World - (World, a), then getChar is indeed a function and deterministic. It is, there are not w :: World such that getChar w != getChar. The fact that World is too

[Haskell-cafe] Re: Monad explanation

2009-02-09 Thread Emilio Jesús Gallego Arias
egall...@babel.ls.fi.upm.es (Emilio Jesús Gallego Arias) writes: IMHO, if you assume IO a = World - (World, a), then getChar is indeed a function and deterministic. It is, there are not w :: World such that getChar w != getChar. Sorry I meant: There is not w :: World such that getChar w

[Haskell-cafe] Re: type versus data declarations

2007-06-08 Thread Emilio Jesús Gallego Arias
Hi Alfonso! Alfonso Acosta [EMAIL PROTECTED] writes: type FSet a = Show a = (a - Double) type only works for redefinitions (i.e. adding the |Show a| constraint makes FSet a different type to (a - Double)). Yes, I know. What I mean, if type is a type macro, why cannot it expand type

[Haskell-cafe] type versus data declarations

2007-06-07 Thread Emilio Jesús Gallego Arias
Hello, I'm wondering why you can write data FSet a = Show a = M (a - Double) a :: FSet Double a = M $ \x - 0 and it works, but type FSet a = Show a = (a - Double) a :: FSet Double a _ = 0 fails with All of the type variables in the constraint `Show a' are already in scope (at

Network Exception

2005-10-14 Thread Arias
Hi, I've a problem, I'm using this code on GHC compiler version 6.4.1: --- BEGIN --- module Main where import System.IO import Network main = withSocketsDo $ do handle - connectTo localhost ( PortNumber 8080 ) hSetBuffering handle LineBuffering hClose handle --- END --- The problems is that

Re: Network Exception

2005-10-14 Thread Arias
why your /etc/protocols doesn't contain an entry for 'tcp'. The error message in said function has now been fixed; thanks for the report. --sigbjorn - Original Message - From: Arias [EMAIL PROTECTED] To: glasgow-haskell-users@haskell.org Sent: Friday, October 14, 2005 06:47 Subject

[Haskell] Network Exception

2005-10-13 Thread Arias
Hi, My name Iván Arias, I'm trying to connect to a server using the Network library, the code that I'm using is something like this: --- BEGIN --- module Main where import System.IO import Network main = withSocketsDo $ do handle - connectTo localhost ( PortNumber 8080 ) hClose handle

Re: [Haskell] Re: Network Exception

2005-10-13 Thread Arias
) Stephane Bortzmeyer escribió: On Wed, Oct 12, 2005 at 07:34:33PM +0200, Arias [EMAIL PROTECTED] wrote a message of 25 lines which said: It compiles correctly, but when I try to run this code, it throws an exception at connectTo. The exception's message is: Which compiler? I get a does

[Haskell] Re: Network Exception

2005-10-13 Thread Arias
I've tryed to connect using the telnet and it connects properly, I've try also with another servers/ports and it allways throws the exception On Thu, Oct 13, 2005 at 12:18:44PM +0200, Arias [EMAIL PROTECTED] wrote a message of 35 lines which said: In the port 8080 I have apache