Re: [Haskell-cafe] ANN: datapacker 1.0.1

2008-09-25 Thread Don Stewart
jgoerzen: > Hi everyone, > > I'm finding Haskell to be a really handy language for writing programs > designed to be used from shell scripts of late. hpodder, twidge, and > datapacker are al on Hackage. > > I released dataacker 1.0.1 recently. It's about one fifth the size of > a close competi

[Haskell-cafe] Re: Random question

2008-09-25 Thread Achim Schneider
"Ariel J. Birnbaum" <[EMAIL PROTECTED]> wrote: > > And the one liner: > > (rand 1 10) >>= return . (\v -> take v [1..10]) > > What about: > take <$> rand 1 10 <*> pure [1..10] > The reason why this doesn't work by default is the occurrence distribution of tutorials about warm, fuzzy things an

[Haskell-cafe] ANN: datapacker 1.0.1

2008-09-25 Thread John Goerzen
Hi everyone, I'm finding Haskell to be a really handy language for writing programs designed to be used from shell scripts of late. hpodder, twidge, and datapacker are al on Hackage. I released dataacker 1.0.1 recently. It's about one fifth the size of a close competitor written in another lan

Re: [Haskell-cafe] Red-Blue Stack

2008-09-25 Thread Derek Elkins
On Thu, 2008-09-25 at 00:11 -0400, Matthew Eastman wrote: > Hey guys, > > This is probably more of a question about functional programming than > it is about Haskell, but hopefully you can help me out. I'm new to > thinking about things in a functional way so I'm not sure what the > best way

Re: [Haskell-cafe] Random question

2008-09-25 Thread wren ng thornton
Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: > For one approach, check > out 'replicate' to make copies of something, and then 'sequence' to > run them and return a list. > Thanks, I haven't found anything that explains 'sequence' well yet, but I'll keep looking. Yet

Re: [Haskell-cafe] Re: Red-Blue Stack

2008-09-25 Thread Jamie Brandon
> I am afraid, but this does not give constant amortized time. sendEmail :: ProperlyThoughtOut Idea -> IO () Clearly my brain lacks a type checker. Jamie ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/has

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Graham Fawcett
On Thu, Sep 25, 2008 at 5:09 PM, Manlio Perillo <[EMAIL PROTECTED]> wrote: > Graham Fawcett ha scritto: >> If you're on Intel/Itanium, I believe there's a CMPXCHG instruction >> that will do atomic compare-and-set on a memory address, and I'm not >> sure you could get much faster than that. :-) > >

Re: [Haskell-cafe] Red-Blue Stack

2008-09-25 Thread Matthew Brecknell
Matthew Eastman said: > i.e. popping Blue in [Red, Red, Blue, Red, Blue] would give [Red, Red, > Blue] Hmm, did you mean [Red,Blue] or [Red,Red,Red,Blue]? Judging by your implementation of remUseless, I'm guessing the latter. Here is a more straightforward approach than apfelmus'. I store colou

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Manlio Perillo
Graham Fawcett ha scritto: On Wed, Sep 24, 2008 at 5:17 PM, Manlio Perillo <[EMAIL PROTECTED]> wrote: Hi. I need a simple, concurrent safe, database, written in Haskell. A database with the interface of Data.Map would be great, since what I need to to is atomically increment some integer values

Re: [Haskell-cafe] Problem with existential quantification

2008-09-25 Thread Henning Thielemann
On Thu, 25 Sep 2008, David Menendez wrote: That looks like it should work. I'm guessing you enabled ExistentialQuantification, but not Rank2Types or RankNTypes. The former allows you to use the forall keyword in data declarations, but you need one of the others to allow universal quantification

Re: [Haskell-cafe] Problem with existential quantification

2008-09-25 Thread David Menendez
On Thu, Sep 25, 2008 at 1:15 PM, Eric <[EMAIL PROTECTED]> wrote: > Dear all, > > I've written a function with the following type: > > build :: Bifunctor s => (forall b. (s a b -> b) -> b) -> Fix s a > > When I try to compile I get the following error: > > Illegal polymorphic or qualified type:

Re: [Haskell-cafe] if - then - else layout

2008-09-25 Thread Henning Thielemann
On Wed, 24 Sep 2008, leledumbo wrote: consider this partial program: if n>5 then putStrLn "big" else putStrLn "small" this works fine in hugs, but in ghc I must change it to: if n>5 then putStrLn "big" else putStrLn "small" maybe related http://www.haskell.org/haskellwiki/If-then

Re: [Haskell-cafe] Random question

2008-09-25 Thread Ariel J. Birnbaum
> And the one liner: > (rand 1 10) >>= return . (\v -> take v [1..10]) What about: take <$> rand 1 10 <*> pure [1..10] (more readable IMHO). One could even define: f <%> x = f <*> pure x and have take <$> rand 1 10 <%> [1..10] Also, why not using getRandomR(1,10) instead? take <$

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Graham Fawcett
On Wed, Sep 24, 2008 at 5:17 PM, Manlio Perillo <[EMAIL PROTECTED]> wrote: > Hi. > > I need a simple, concurrent safe, database, written in Haskell. > A database with the interface of Data.Map would be great, since what I need > to to is atomically increment some integer values, and I would like to

[Haskell-cafe] Re: pure Haskell database

2008-09-25 Thread Achim Schneider
Anton van Straaten <[EMAIL PROTECTED]> wrote: > Achim Schneider wrote: > > "Rich Neswold" <[EMAIL PROTECTED]> wrote: > > > >> On Thu, Sep 25, 2008 at 11:09 AM, Manlio Perillo > >> <[EMAIL PROTECTED]>wrote: > ... > >>> But this works only if the database is used by only one process. > >>> > >> Ah.

[Haskell-cafe] Re: Red-Blue Stack

2008-09-25 Thread apfelmus
Jamie Brandon wrote: > Try writing > > data RBStack = RBS [RBSItem] [RBSItem] > > where the first list are all the same colour and the start of the second list > is a different colour. The rest should follow naturally and you will get > amortised O(1) push and pop (you occasionally have to juggle

[Haskell-cafe] Re: Microsoft's Craig Mundie outlines the future of computing

2008-09-25 Thread Achim Schneider
"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> wrote: > > On Sep 25, 2008, at 13:50 , Achim Schneider wrote: > > > "Lihn, Steve" <[EMAIL PROTECTED]> wrote: > > > >> Notice: This e-mail message, together with any attachments, > >> contains information of Merck & Co., Inc. (One Merck Drive, > >>

Re: [Haskell-cafe] Re: pure Haskell database

2008-09-25 Thread Anton van Straaten
Achim Schneider wrote: "Rich Neswold" <[EMAIL PROTECTED]> wrote: On Thu, Sep 25, 2008 at 11:09 AM, Manlio Perillo <[EMAIL PROTECTED]>wrote: ... But this works only if the database is used by only one process. Ah. When you said "concurrent safe", I thought you meant within the application. Y

Re: [Haskell-cafe] Re: Microsoft's Craig Mundie outlines the future of computing

2008-09-25 Thread Brandon S. Allbery KF8NH
On Sep 25, 2008, at 13:50 , Achim Schneider wrote: "Lihn, Steve" <[EMAIL PROTECTED]> wrote: Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, Just curious: What'd happen if I forward this message t

[Haskell-cafe] Re: pure Haskell database

2008-09-25 Thread Achim Schneider
"Rich Neswold" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 25, 2008 at 11:09 AM, Manlio Perillo > <[EMAIL PROTECTED]>wrote: > > > Rich Neswold ha scritto: > > > >> On Wed, Sep 24, 2008 at 4:17 PM, Manlio Perillo > >> <[EMAIL PROTECTED]> wrote: > >> > >>I need a simple, concurrent safe, database,

Re: [Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Anthony LODI
On Thu, Sep 25, 2008 at 10:34 AM, Henning Thielemann <[EMAIL PROTECTED]> wrote: > Instead of rewriting from scratch, you can also define > > newtype StateWriter l s a = StateWriter (StateT s (Writer l) a) Thanks for the tip! I knew there must be a way to reuse some of the existing machinery. I'

[Haskell-cafe] Re: Microsoft's Craig Mundie outlines the future of computing

2008-09-25 Thread Achim Schneider
"Lihn, Steve" <[EMAIL PROTECTED]> wrote: > Notice: This e-mail message, together with any attachments, contains > information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, > New Jersey, USA 08889), and/or its affiliates (which may be known > outside the United States as Merck Frosst,

Re: [Haskell-cafe] Building DLLs

2008-09-25 Thread Andrew Coppin
Andrew Coppin wrote: OK, so a GHC question: Apparently at some point, GHC used to support DLLs. And then it stopped working. And then it may or may not have been brought back again... Does anybody know exactly what the status of this is? Is it currently working or broken? If it's working, what

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Anatoly Yakovenko
>> I have not been following the details, but would you consider writing up >> your example on the GHC user guide Wiki? >>http://haskell.org/haskellwiki/GHC/Using_the_FFI >> >> It's a very good way to share your experience with others. > > I got that example from Claude Heiland-Allen. Unl

Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-25 Thread Bulat Ziganshin
Hello Ketil, Thursday, September 25, 2008, 8:57:05 PM, you wrote: > "John Van Enk" <[EMAIL PROTECTED]> writes: >> I'm going to have to agree with David... even if you ignore the >> multi-threaded >> projects, why couldn't the C programs just implement very specific version of >> the third party

Re: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Anatoly Yakovenko
> I have not been following the details, but would you consider writing up your > example on the GHC user guide Wiki? >http://haskell.org/haskellwiki/GHC/Using_the_FFI > > It's a very good way to share your experience with others. I got that example from Claude Heiland-Allen. Unless he h

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Rich Neswold
On Thu, Sep 25, 2008 at 11:09 AM, Manlio Perillo <[EMAIL PROTECTED]>wrote: > Rich Neswold ha scritto: > >> On Wed, Sep 24, 2008 at 4:17 PM, Manlio Perillo <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> >>I need a simple, concurrent safe, database, written in Haskell. >>A database with t

[Haskell-cafe] Problem with existential quantification

2008-09-25 Thread Eric
Dear all, I've written a function with the following type: build :: Bifunctor s => (forall b. (s a b -> b) -> b) -> Fix s a When I try to compile I get the following error: Illegal polymorphic or qualified type: forall b. (s a b -> b) -> b In the type signature for `build': build :: (Bifu

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-25 Thread Ketil Malde
"John Van Enk" <[EMAIL PROTECTED]> writes: > I'm going to have to agree with David... even if you ignore the multi-threaded > projects, why couldn't the C programs just implement very specific version of > the third party library inside their code? Or they could just FFI to the Haskell libraries

[Haskell-cafe] GHC 6.10, OS X, Fink and CPPFLAGS

2008-09-25 Thread Svein Ove Aas
While trying to test 6.10, I ran into the issue that a number of the libraries it wants are not installed by default, and are most conveniently added via Fink. This includes gmp, binutils, readline, etc. /sw/ is not in the default gcc path, of course, so the usual solution is to add -I/sw/include,

[Haskell-cafe] Microsoft's Craig Mundie outlines the future of computing

2008-09-25 Thread Lihn, Steve
http://news.cnet.com/8301-13953_3-10050826-80.html?part=rss&subj=news&ta g=2547-1_3-0-5 "We have to see a paradigm change in the way we write applications." He also said that software development hasn't graduated to become a formal engineering discipline. "The resilience of systems is not up to t

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Manlio Perillo
Rich Neswold ha scritto: On Wed, Sep 24, 2008 at 4:17 PM, Manlio Perillo <[EMAIL PROTECTED] > wrote: I need a simple, concurrent safe, database, written in Haskell. A database with the interface of Data.Map would be great, since what I need to to is atomica

Re: [Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
2008/9/25 Bit Connor <[EMAIL PROTECTED]>: > withMatrix doesn't seem to have anything to do with glLoadMatrix. > > You are right that you can do glLoadMatrix with loadIdentity and multMatrix. > > To directly load a matrix, use the function "matrix" (with a Nothing > argument). This will internally c

[Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread Achim Schneider
"minh thu" <[EMAIL PROTECTED]> wrote: > Anyway, the bindings are not that much functionnal, even with things > like withMatrix. > http://thread.gmane.org/gmane.comp.lang.haskell.cafe/35444/focus=35713 Mind you: regarding 3d, I barely manage to code up camera movements. That is, I don't use it muc

Re: [Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread Bit Connor
withMatrix doesn't seem to have anything to do with glLoadMatrix. You are right that you can do glLoadMatrix with loadIdentity and multMatrix. To directly load a matrix, use the function "matrix" (with a Nothing argument). This will internally call the loadMatrix function that Krzysztof mentioned

Re: [Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Henning Thielemann
On Thu, 25 Sep 2008, Anthony LODI wrote: Hello haskell-cafe, In my application I have a complex state threaded through long computation chains, and I need a way to log all state changes (so that the evolving state can be animated/replayed somewhere else). Initially I tried combining State and

[Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Anthony LODI
Hello haskell-cafe, In my application I have a complex state threaded through long computation chains, and I need a way to log all state changes (so that the evolving state can be animated/replayed somewhere else). Initially I tried combining State and Writer monads but this allows for the possibi

Re: [Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
2008/9/25 Achim Schneider <[EMAIL PROTECTED]>: > "minh thu" <[EMAIL PROTECTED]> wrote: > >> I can't find the loadMatrix function in >> http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html >> >> Should I use loadIdentity then multMatrix inst

[Haskell-cafe] Re: Where is OpenGL loadMatrix ?

2008-09-25 Thread Achim Schneider
"minh thu" <[EMAIL PROTECTED]> wrote: > I can't find the loadMatrix function in > http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html > > Should I use loadIdentity then multMatrix instead ? > You're supposed to use withMatrix and regard

Re: [Haskell-cafe] Where is OpenGL loadMatrix ?

2008-09-25 Thread Krzysztof Skrzętnicki
On Thu, Sep 25, 2008 at 15:39, minh thu <[EMAIL PROTECTED]> wrote: > > Hi, > > I can't find the loadMatrix function in > http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html > > Should I use loadIdentity then multMatrix instead ? > > Thank

[Haskell-cafe] Where is OpenGL loadMatrix ?

2008-09-25 Thread minh thu
Hi, I can't find the loadMatrix function in http://hackage.haskell.org/packages/archive/OpenGL/latest/doc/html/Graphics-Rendering-OpenGL-GL-CoordTrans.html Should I use loadIdentity then multMatrix instead ? Thank you, Thu ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Google Android

2008-09-25 Thread Maarten Hazewinkel
On 25 Sep 2008, at 13:33, Adam Langley wrote: A Google search for "haskell java" turns up at least one good candidate[1], but if you manage to get that working well, binding the APIs is a rather trivial task ;) [1] http://www.cse.unsw.edu.au/~pls/thesis-topics/ghcjava.html That's actually jus

Re: [Haskell-cafe] Google Android

2008-09-25 Thread Adam Langley
2008/9/24 Galchin, Vasili <[EMAIL PROTECTED]>: > Do there currently (or in the works) exist FFI bindings for Google's > Android API? The Android API is obviously a Java API, additionally Android will only execute DEX bytecode programs, so you would first need a way to compile Haskell to Java,

Re[2]: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Bulat Ziganshin
Hello jean-christophe, Thursday, September 25, 2008, 1:52:26 PM, you wrote: > columns = [ ("trackId", conT ''Int ) > It looks like a not ended string literal unless I still have sth to learn > about Haskell. it's TemplateHaskell, look for Reification in http://www.haskell.org/bz/thdoc.htm

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Marc Weber
On Thu, Sep 25, 2008 at 11:52:26AM +0200, jean-christophe mincke wrote: >Marc > >What is this strange syntax > >columns = [ ("trackId", conT ''Int ) Hi J-C, I'ts part of template haskell and tells ghc to use the type referenced by Int. There are some getting started guides on haskel

[Haskell-cafe] Re: pure Haskell database

2008-09-25 Thread Achim Schneider
"jean-christophe mincke" <[EMAIL PROTECTED]> wrote: > What is this strange syntax > > columns = [ ("trackId", conT *''Int* ) > > It looks like a not ended string literal unless I still have sth to > learn about Haskell. > ' isn't special in Haskell, it's idiomatic: you often see things like fo

Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread jean-christophe mincke
Marc What is this strange syntax columns = [ ("trackId", conT *''Int* ) It looks like a not ended string literal unless I still have sth to learn about Haskell. Thank you J-C On Thu, Sep 25, 2008 at 12:03 AM, Marc Weber <[EMAIL PROTECTED]> wrote: > On Wed, Sep 24, 2008 at 11:17:01PM +0200,

[Haskell-cafe] announcing darcs 2.1.0pre2

2008-09-25 Thread Eric Kow
Hi everybody, The second pre-release of darcs 2.1 (formerly known as 2.0.3) is now available at http://darcs.net/darcs-2.1.0pre2.tar.gz We have increased the version number since the last pre-release because we are adopting an important new behaviour: The darcs initialize command now creates d

[Haskell-cafe] Re: if - then - else layout

2008-09-25 Thread Achim Schneider
Achim Schneider <[EMAIL PROTECTED]> wrote: > if i knew how to do it Sorry, apparent mistake, besides confusing b (bool) with p (predicate): if p _ c = do (_, _, a) <- get put (p, c, a) mzero -- (c) this sig last receiving data processing entity. Inspect headers for copy

[Haskell-cafe] Re: if - then - else layout

2008-09-25 Thread Achim Schneider
Jules Bean <[EMAIL PROTECTED]> wrote: > do >if n>5 then > putStrLn "big" >else > putStrLn "small" > > this is shorthand for > > do { if n > 5 then putStrLn "big" ; else putStrLn "small" } > > which is a syntax error. A statement in a do block cannot begin with > the keyword "e

[Haskell-cafe] Re: Distributing Haskell binaries as OSX App Bundles

2008-09-25 Thread Christian Maeder
Stephen wrote: > I wrote a command-line program recently for a friend in haskell. > However, he's far away and not particularly computer literate. I sent > him the raw binaries, but they came up with errors about not being able > to find libgmp stuff. So then I thought I should probably be able

[Haskell-cafe] Re: if - then - else layout

2008-09-25 Thread Achim Schneider
"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> wrote: > I think Hugs is violating the Haskell98 layout rules. > One could argue that GHC should, too. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, perfo

Re: [Haskell-cafe] if - then - else layout

2008-09-25 Thread Jules Bean
leledumbo wrote: consider this partial program: if n>5 then putStrLn "big" else putStrLn "small" this works fine in hugs, but in ghc I must change it to: if n>5 then putStrLn "big" else putStrLn "small" Actually both of those are valid expressions. And they both work in hugs a

[Haskell-cafe] Re: Am I doing it right?

2008-09-25 Thread Achim Schneider
Daniel Fischer <[EMAIL PROTECTED]> wrote: > The fast searching function on ByteStrings has already been written > for you :) > That's in ghc 6.8.3, which is not in gentoo but only in the haskell overlay, which means that all blame goes to the gentoo maintainers for being utterly out of date. The

Re: [Haskell-cafe] Haskell board game

2008-09-25 Thread Ryan Ingram
Bertram has put together a peg solitaire game using gtk2hs with Prompt for control: http://int-e.home.tlink.de/haskell/solitaire.tar.gz It's a good read and probably a good starting point for other board games. -- ryan On Wed, Sep 24, 2008 at 7:04 PM, Rafael C. de Almeida <[EMAIL PROTECTED

RE: [Haskell-cafe] Injecting Haskell into C

2008-09-25 Thread Simon Peyton-Jones
Anatoly I have not been following the details, but would you consider writing up your example on the GHC user guide Wiki? http://haskell.org/haskellwiki/GHC/Using_the_FFI It's a very good way to share your experience with others. Simon | -Original Message- | From: [EMAIL PROTEC