Re: [Haskell-cafe] Re: Generate 50 random coordinates

2006-12-04 Thread Ketil Malde
Henning Thielemann wrote: On Sat, 2 Dec 2006 [EMAIL PROTECTED] wrote: -- The IO -- Who rides so late through the bits and the bytes? It's Haskell with his child Hank; He has the boy type safe in his arm, He holds him pure, he holds him warm. I vote for an art/lyrics section on

[Haskell-cafe] RE: Safe forking question

2006-12-04 Thread Simon Marlow
[ duh, hit send by mistake, message continues... ] Chris Kuklewicz wrote: forkInheritIO :: IO () - IO ThreadId -- inherits parent's block or unblock status forkBlockedIO :: IO () - IO ThreadId -- starts the action in block mode. Must manually unblock Either of these is certainly

Re: [Haskell-cafe] Re: Draft MissingH Reorg Plan

2006-12-04 Thread Malcolm Wallace
John Goerzen [EMAIL PROTECTED] wrote: About Text.ParserCombinators.Parsec.RFC2234 and the like. ... ... you do not in fact define any new combinators for parsing. What you have there is a parser This module provides parsers for the grammar defined in RFC2234,

Re: [Haskell-cafe] RE: Safe forking question

2006-12-04 Thread David Roundy
On Mon, Dec 04, 2006 at 12:43:00PM +, Simon Marlow wrote: Chris Kuklewicz wrote: forkInheritIO :: IO () - IO ThreadId -- inherits parent's block or unblock status forkBlockedIO :: IO () - IO ThreadId -- starts the action in block mode. Must manually unblock Either of these is

Re: [Haskell-cafe] Re: help with threadDelay

2006-12-04 Thread Ian Lynagh
On Wed, Nov 29, 2006 at 10:57:52AM +, Neil Davies wrote: In order to get low jitter you have to deliberately wake up early and spin - hey what are all these extra cores for! - knowing the quantisation of the RTS is useful in calibration loop for how much to wake up early. Ah, I see.

Re: [Haskell-cafe] known, I know: class contexts and mutual recursion

2006-12-04 Thread Ian Lynagh
On Wed, Nov 29, 2006 at 06:14:56PM +, Conor McBride wrote: Mmm.lhs:15:1: Contexts differ in length When matching the contexts of the signatures for foo :: forall (m :: * - *). (Monad m) = Thing - m Int goo :: Thing - (Maybe Int - Int) - Int The signature contexts in a

[Haskell-cafe] Four Fours problem in Haskell

2006-12-04 Thread Joachim Breitner
Hi, This might be interesting for some of you (I hope): http://www.joachim-breitner.de/blog/archives/210-FourFours-in-Haskell.html Preview: An interesting programming puzzle appeard in the Blogosphere: To describe every integer from 1 to 100 as a calculation involving only and exactly four

Re: [Haskell-cafe] File locked unnecessarily

2006-12-04 Thread Ian Lynagh
On Sun, Dec 03, 2006 at 08:13:37PM +0100, Arie Peterson wrote: Does anyone know what could cause this locking and/or how to prevent it? Nothing else springs to mind. Are you able to send an example that shows the problem? (obviously the smaller the example, the better). Thanks Ian

Re: [Haskell-cafe] known, I know: class contexts and mutual recursion

2006-12-04 Thread Iavor Diatchki
Hello, I just tripped over the Contexts differ in length error message. I know it's not a new problem, but I thought I'd enquire as to its status. I have run into that a number of times. There aren't any technical issues with solving it, in fact, depending on how one implements the type

Re: [Haskell-cafe] known, I know: class contexts and mutual recursion

2006-12-04 Thread Ross Paterson
On Mon, Dec 04, 2006 at 05:21:15PM +, Ian Lynagh wrote: On Wed, Nov 29, 2006 at 06:14:56PM +, Conor McBride wrote: Mmm.lhs:15:1: Contexts differ in length When matching the contexts of the signatures for foo :: forall (m :: * - *). (Monad m) = Thing - m Int goo ::

Re: [Haskell-cafe] known, I know: class contexts and mutual recursion

2006-12-04 Thread Conor McBride
Hi Iavor Diatchki wrote: Hello, I just tripped over the Contexts differ in length error message. I know it's not a new problem, but I thought I'd enquire as to its status. I have run into that a number of times. There aren't any technical issues with solving it, in fact, depending on how

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread Taral
On 12/4/06, Joachim Breitner [EMAIL PROTECTED] wrote: \g - map (\n a - g a !! n) [1..] I think that's about as good as it gets. -- Taral [EMAIL PROTECTED] You can't prove anything. -- Gödel's Incompetence Theorem ___ Haskell-Cafe mailing

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread Nicolas Frisby
It seems there's an assumption about the range of the parameter function and the range of the entire function. That is, I think we're assuming that the length of the final result is the same as the length of the result of the first function? If I'm correct in presuming that constraint, then I

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread Joachim Breitner
Hi, Am Montag, den 04.12.2006, 13:12 -0600 schrieb Nicolas Frisby: It seems there's an assumption about the range of the parameter function and the range of the entire function. That is, I think we're assuming that the length of the final result is the same as the length of the result of the

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread David Roundy
On Mon, Dec 04, 2006 at 07:00:23PM +, Joachim Breitner wrote: I came up with: \g - map (\n a - g a !! n) [1..] which has the desired type and functionality, but it looks rather inelegant and messy. Any better ideas? I like sequence a2bs = (head . a2bs) : sequence (tail . a2bs)

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread Matthew Brecknell
Joachim Breitner: here I use that map (\n - l !!n ) [1..] == l. I hope that is valid map (\n - l !! n) [1..] is more like (tail l). Did you mean to use [0..]? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] (a - [b]) - [a - b] ?

2006-12-04 Thread Joachim Breitner
Hi, Am Dienstag, den 05.12.2006, 05:59 +1000 schrieb Matthew Brecknell: Joachim Breitner: here I use that map (\n - l !!n ) [1..] == l. I hope that is valid map (\n - l !! n) [1..] is more like (tail l). Did you mean to use [0..]? Probably. I hardly use (!!), so I did not remember if it

[Haskell-cafe] using greencard to write COM in haskell

2006-12-04 Thread Anatoly Yakovenko
One of the goals for greencard ( http://www.cs.york.ac.uk/fp/nhc13/greencard.html#SEC2 ) is: A convenient way to write COM software components in Haskell, and to call COM components from Haskell. Are there any examples of the first goal. I would like to be able to write COM components in

[Haskell-cafe] '+++' and 'interleave'

2006-12-04 Thread Greg Fitzgerald
Could ReadP's '+++' (symmetric choice) operator be implemented for all Monads with the 'interleave' function mentioned in Backtracking, Interleaving, and Terminating Monad Transformershttp://portal.acm.org/ft_gateway.cfm?id=1086390type=pdfcoll=GUIDEdl=GUIDECFID=5430836CFTOKEN=76321932? This paper

[Haskell-cafe] Re: Beginner: IORef constructor?

2006-12-04 Thread Benjamin Franksen
Bernie Pope wrote: If you want a global variable then you can use something like: import System.IO.Unsafe (unsafePerformIO) global = unsafePerformIO (newIORef []) But this is often regarded as bad programming style (depends who you talk to). Besides, isn't this example

Re: [Haskell-cafe] using greencard to write COM in haskell

2006-12-04 Thread Jason Dagit
On 12/4/06, Anatoly Yakovenko [EMAIL PROTECTED] wrote: So is there a way to start haskell form C? Ideally i would like something thats as easy to use as a dll, that the end use wouldn't be aware that they are using a component written in haskell. The things described at this URL have worked

[Haskell-cafe] SYB, ext1Q, and deriving custom Typeable and Data instances

2006-12-04 Thread Vyacheslav Akhmechet
Hi, I'm trying to use SYB to implement some basic relational persistance. I define a PKey datatype to represent primary keys like this: newtype PKey a = PKey a deriving (Show, Typeable, Data) I then define a sample data type like this: data User = User { id :: PKey Int,

Re: [Haskell-cafe] using greencard to write COM in haskell

2006-12-04 Thread Anatoly Yakovenko
Thanks, this is exactly what i was looking for. On 12/4/06, Jason Dagit [EMAIL PROTECTED] wrote: On 12/4/06, Anatoly Yakovenko [EMAIL PROTECTED] wrote: So is there a way to start haskell form C? Ideally i would like something thats as easy to use as a dll, that the end use wouldn't be