RE: linker errors

2003-08-05 Thread Simon Peyton-Jones
| The code is hand-written and the maximum tuple-size | used is 4. It works fine in Hugs. It uses the Parsec | library (not the version in GHC's text package, but | from a local copy. The ParsecPrim.hs was replaced by | the version from Parsec's web-site -- it works as I | expected, but not the

RE: Polymorphic kinds

2003-08-05 Thread Simon Peyton-Jones
The real question is: why does GHC distinguish kind * from kind #? For example, Int has kind * Int# has kind # The main reason is this: a polymorphic function assumes that values of type 'a' are represented by a pointer. For example: const :: a - b - a const

bug(?) in unblockThread?

2003-08-05 Thread Hal Daume
I've implemented timeouts as described in: http://www.haskell.org/pipermail/glasgow-haskell-users/2001-April/001816 .html My implementation follows: timeout secs onTimeout action = do parent - myThreadId i - newUnique block $ do timeoutT - forkIO (timeoutThread secs parent i)

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: At 2003-08-04 20:00, Ben Rudiak-Gould wrote: This is a different lambda calculus, with a different beta rule. You can see the same effect in the type inference rules for implicit parameters: If f has type Int - String and ?x has type (?x :: Int) =

Solution to the monomorphism restriction/implicit parameter problem

2003-08-05 Thread Ben Rudiak-Gould
I just figured out why the monomorphism restriction interacts so weirdly with implicit parameters, and how to fix it. We all know that when the monomorphism restriction is turned on, the following doesn't work: let f = () in (f 1 2, f 'a' 'b') On the other hand, the following does work:

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ashley Yakeley
At 2003-08-04 18:19, Ben Rudiak-Gould wrote: ((\a - ((a,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2})) ([EMAIL PROTECTED] - @x),[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 1} ^^^ (([EMAIL PROTECTED] - @x,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] =

Re: *safe* coerce: four methods compared

2003-08-05 Thread oleg
This message illustrates how safe casting with multiple universes can be extended to new user-defined, polymorphic datatypes. We show a _portable_ mapping of polymorphic types to integers. Different instances of a polymorphic type map to different integers. Phantom types can be either disregarded

Re: literate scripts.

2003-08-05 Thread Malcolm Wallace
Immanuel Litzroth [EMAIL PROTECTED] writes: I have a small question relating to literate haskell programs that use the \begin{code} \end{code} style. Am I correct to assume that \end{code} inside a string should be recognized as being inside a string. The report seems to say this, but the

RE: Solution to the monomorphism restriction/implicit parameter problem

2003-08-05 Thread Simon Peyton-Jones
| I just figured out why the monomorphism restriction interacts so weirdly | with implicit parameters, and how to fix it. I'm afraid that I have not read all of the recent exciting flood of messages carefully, but I do remember that the interaction of the monomorphism restriction with implicit

literate scripts.

2003-08-05 Thread Immanuel Litzroth
I have a small question relating to literate haskell programs that use the \begin{code} \end{code} style. Am I correct to assume that \end{code} inside a string should be recognized as being inside a string. The report seems to say this, but the unlit that is distributed with ghc doesn't grok

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: At 2003-08-04 22:33, Ben Rudiak-Gould wrote: This illustrates what you pointed out earlier, that the program's semantics can be changed by adding explicit type signatures which include implicitly-parameterized parameters. But wasn't avoiding this

RE: Text I/O library proposal, first draft

2003-08-05 Thread Hal Daume
this is true; however, it is likely that it would be much faster for me to read in word8s and parse them to Ints myself than to read in Chars (using the old libraries) and parse those to ints (I've done some experiments and the overhead for reading haskell Chars is very non-negligible). i'd like

Re: Another typing question

2003-08-05 Thread Nick Name
On Tue, 5 Aug 2003 12:23:06 +0200 Konrad Hinsen [EMAIL PROTECTED] wrote: 3 Is there any way to parametrize a type by a value, rather than another type? What I would like to do is to define list of length 3 and list of length 4 as separate parametrization of the same type, such that I

Re: Another typing question

2003-08-05 Thread Alastair Reid
A better solution might be: data EmptyList element = EmptyList data TrueList list element = TrueList element (list element) A list of four Ints for example would be represented by a value of type TrueList (TrueList (TrueList (TrueList EmptyList))) Int. Isn't that just the

Re: Another typing question

2003-08-05 Thread oleg
Is there any way to parametrize a type by a value, rather than another type? I believe the following web page answers your question: http://pobox.com/~oleg/ftp/Haskell/number-parameterized-types.html It uses parameterization by decimal numbers -- which seem more natural to read.

Re: Another typing question

2003-08-05 Thread Nick Name
On Tue, 5 Aug 2003 15:23:09 +0200 Wolfgang Jeltsch [EMAIL PROTECTED] wrote: You could define different types for different natural numbers: data Zero = Zero data Succ number = Succ number This resembles http://www.brics.dk/RS/01/10/ V.