Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-09-30 Thread Martin Hofmann
Thanks a lot. You ought to be able to add a Control.Monad.CatchIO.catch clause to your interpreter to catch this kind of errors, if you want. I forgot to mention that this didn't work for me either. Thanks for the report! You are welcome. If you come up with a work around or a fix, I

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Ketil Malde
Curt Sampson c...@starling-software.com writes: Java is part of the Java platform, that brought OS independence and interoperability at the right time. .Download-execution on the client was also a reason for the initial success of Java in the Internet era. This may be somewhat anecdotal

Re: [Haskell-cafe] Problem with result-type context restrictions in typeclasses.

2009-09-30 Thread Miguel Mitrofanov
class Cls c where type Ret c :: (Bar *) = * -- or a better name foo :: c - Ret c which isn't legal Haskell. OK, that's exactly the same thing I've met when developing compose-trans. I needed guarantees that something is a Monad. My way of doing that was to make Bar (Monad in my case)

Re: Re: [Haskell-cafe] Problem with result-type context restrictions in typeclasses.

2009-09-30 Thread Ryan Ingram
You can require the associated type to have a particular instance, like this: class (Bar (Ret c)) = Cls c where type Ret c foo :: c - Ret c Another option is to use existential types: data HasBar = forall a. Bar a = HasBar a class Cls c where foo :: c - HasBar You then have to wrap

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Andrew Coppin
Casey Hawthorne wrote: I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language. If this is true, it needs to be pushed. And if by changing a few lines of source code one can develop a whole

[Haskell-cafe] [Haskell-beginners] Better way to retrieve data strucures from sql-db?

2009-09-30 Thread Paolo Losi
Hi Roman,    Template Haskell should be the preferred way to cope with these boilerplate code problems. Template Haskell: http://www.haskell.org/haskellwiki/Template_Haskell Note: I'm a beginner myself so please wait for a more informed response. Paolo 2009/9/28 Roman Naumann

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Deniz Dogan
2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular. Sounds more like Mr C++ fundamentally thinks in an imperative way because that's what he is used

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Peter Verswyvelen
Yep, LINQ makes C# more enjoyable :-) Scala and haXe also look nice, a bit of a mix between OCaml/F#, C#/Java and Haskell. Besides the fact that hacking in Haskell is a great deal of fun, the main reason I see for learning Haskell: it makes you a better programmer. After a couple of years of

Re: [Haskell-cafe] Type synonyms vs standard types

2009-09-30 Thread Olex P
True. But anyway newtype creates a new type which is not what I'm looking for. In this case instead of passing a string myAttrName user should pass constructor as well. And the next step of such simplification will be a smart constructor attrName? :) And that's all just to show user of that

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Andrew Coppin
Deniz Dogan wrote: 2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular. Sounds more like Mr C++ fundamentally thinks in an imperative way

[Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Paul . Brauner
Hello, I haven't found a function in hackage or in the standard library that takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans or 0s and 1s) and outputs a Word8 or Word32. I have written one which seems very inefficient : toWord8 :: [Bool] - Word8 toWord8 bs = go 0 0 bs

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Andrew Coppin
paul.brau...@loria.fr wrote: (If it helps, i'm writting a toy compression algorithm, which outputs binary as lists of booleans, and I'd like to output that in a file). By a strange coincidence, I did the self same thing a while back. There is Data.Binary which supports efficient reading

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Salvatore Insalaco
On Wed, Sep 30, 2009 at 9:32 AM, Andrew Coppin andrewcop...@btinternet.com wrote: I might also point out that 90% of all desktop computers run Windows, and yet every single C library binding on Hackage fails to compile on Windows. That really needs to be fixed. (Not to mention some of the

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Roel van Dijk
I wrote a few variants for fun. Probably equally inefficient. I suggest you look at Data.Binary as Andrew suggested. -- Your original function, but with a more generic type signature. encodeBits :: Bits n = [Bool] - n encodeBits bs = go 0 0 bs where go n r [] = r go n r

[Haskell-cafe] Any working example of using genericserialize?

2009-09-30 Thread Dimitry Golubovsky
Hi, I am trying to use the genericserialize package (http://hackage.haskell.org/package/genericserialize) but cannot get things working. While buildList (sexpSerialize [1, 2, 3]) yields (1 2 3) as it might be expected, I cannot deserialize it back: *Main (withList sexpDeserialize $ buildList

Re: [Haskell-cafe] i am missing something really trivial with parsec

2009-09-30 Thread Brent Yorgey
On Tue, Sep 29, 2009 at 12:54:21AM -0700, Anatoly Yakovenko wrote: number = do { num - natural ; return $ num } main = do txt - hGetContents stdin print $ parse number stdin txt why doesn't that work? Could you be a little more specific? What are you

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Aai
Here's another approach for Bool lists with msb leftmost: bitsToInt :: [Bool] - Integer bitsToInt = foldr((.(flip shiftL 1)).(+)) 0. map (fromIntegral.fromEnum) Hallo paul.brau...@loria.fr, je schreef op 30-09-09 11:18: Hello, I haven't found a function in hackage or in the standard library

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Aai
Sorry, msb rigthmost Here's another approach for Bool lists with msb leftmost: bitsToInt :: [Bool] - Integer bitsToInt = foldr((.(flip shiftL 1)).(+)) 0. map (fromIntegral.fromEnum) Hallo paul.brau...@loria.fr, je schreef op 30-09-09 11:18: Hello, I haven't found a function in

Re: [Haskell-cafe] suggestion for hslogger

2009-09-30 Thread Duncan Coutts
On Tue, 2009-09-29 at 14:31 -0400, Sean McLaughlin wrote: Hello, I have a program that does a lot of unicode manipulation. I'd like to use hslogger to log various operations. However, since hslogger uses System.IO.putX, the unicode comes out mangled. I hacked the source to use

Fwd: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Alberto G. Corona
Curt, 2009/9/29 Curt Sampson c...@starling-software.com On 2009-09-29 13:18 +0200 (Tue), Alberto G. Corona wrote: Java is part of the Java platform, that brought OS independence and interoperability at the right time. .Download-execution on the client was also a reason for the initial

Re: [Haskell-cafe] Any working example of using genericserialize?

2009-09-30 Thread Jason Dagit
On Wed, Sep 30, 2009 at 3:37 AM, Dimitry Golubovsky golubov...@gmail.comwrote: Hi, I am trying to use the genericserialize package (http://hackage.haskell.org/package/genericserialize) but cannot get things working. While buildList (sexpSerialize [1, 2, 3]) yields (1 2 3) as it

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Jochem Berndsen
Deniz Dogan wrote: 2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular. Sounds more like Mr C++ fundamentally thinks in an imperative way because

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread John A. De Goes
The cross-platform features have been extremely important to the success of Java, because they have greatly expanded the number of libraries available to developers. On Haskell Cafe, not a week goes by that Windows (and sometimes Mac) developers don't complain about not being able to use

Re: [Haskell-cafe] Any generic serializer to String? was: Any working example of using genericserialize?

2009-09-30 Thread Dimitry Golubovsky
Hi, On 9/30/09, Jason Dagit da...@codersbase.com wrote: [skip] Seems like using withList is wrong or the deserializer is simply buggy. It certainly doesn't work the way I would expect SExp reading to work. I also notice from reading the source on hackage that there may not be any tests

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Paul . Brauner
Thanks for the answers. I already had a look at Binary but, as said above, it doesn't support bit manipulation, only bytes. On Wed, Sep 30, 2009 at 11:18:03AM +0200, paul.brau...@loria.fr wrote: Hello, I haven't found a function in hackage or in the standard library that takes a list of

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Peter Verswyvelen
I really doubt people tend to think in either way. It's not even sure our thinking can be modeled with computing no? On Wed, Sep 30, 2009 at 1:58 PM, Jochem Berndsen joc...@functor.nl wrote: Deniz Dogan wrote: 2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo

Re: Fwd: [Haskell-cafe] suggestion for hslogger

2009-09-30 Thread John Goerzen
If you want to send me a patch that makes it an option (not mandatory), I would be happy to apply it. -- John Antoine Latter wrote: Forwarding on to the maintainer, in case he's not on the list. -- Forwarded message -- From: Sean McLaughlin sean...@gmail.com Date: Tue,

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Bulat Ziganshin
Hello Paul, Wednesday, September 30, 2009, 1:18:03 PM, you wrote: I haven't found a function in hackage or in the standard library that takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans or 0s and 1s) and outputs a Word8 or Word32. sum . zipWith (*) (map (2^) [0..])

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Jochem Berndsen
Bulat Ziganshin wrote: Hello Paul, Wednesday, September 30, 2009, 1:18:03 PM, you wrote: I haven't found a function in hackage or in the standard library that takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans or 0s and 1s) and outputs a Word8 or Word32. sum .

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Eugene Kirpichov
...Or let's fuse it. sum . zipWith ((*).(2^)) [0..] 2009/9/30 Jochem Berndsen joc...@functor.nl: Bulat Ziganshin wrote: Hello Paul, Wednesday, September 30, 2009, 1:18:03 PM, you wrote: I haven't found a function in hackage or in the standard library that takes a list of booleans (or a

Re: [Haskell-cafe] Any generic serializer to String? was: Any working example of using genericserialize?

2009-09-30 Thread Max Bolingbroke
FWIW, writing your own is not hard. I wrote a serializer for GHC using Data in less than 150 (simple) LOC. It produces [Word8], but producing strings instead would be easy. You can check out the code here: http://darcs.haskell.org/ghc/compiler/utils/Serialized.hs Cheers, Max 2009/9/30 Dimitry

Re: Re: [Haskell-cafe] Problem with result-type context restrictions in typeclasses.

2009-09-30 Thread Alexander Dunlap
I think instance Bar (Ret c) = Foo c where ... will do what you are asking. Alex On Tue, Sep 29, 2009 at 10:25 PM, DNM dnme...@gmail.com wrote: Dan, thanks again for the response. I changed my code to use type families to let each Cls instance (actually a more complicated instance in my

[Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2009-09-30 Thread Peter Verswyvelen
The newest package seems to require using GLdouble/GLfloat. What is the most efficient way to convert Double/Float to GLdouble/GLfloat? I'm currently using realToFrac. But essentially the operation should be a nop on my machine. I haven't looked at the core code yet (on Windows, last time I

RE: [Haskell-cafe] I read somewhere that for 90% of a wide classof computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Kalani Thielen
As one C++ expert I know is fond of telling me, Haskell will only become popular when obscure mathematics becomes popular. That might be true, but the calculus and even arithmetic were once considered obscure. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] I read somewhere that for 90% of a wide classof computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Peter Verswyvelen
Mmm, to the average student calculus is still very obscure ;-) On Wed, Sep 30, 2009 at 3:56 PM, Kalani Thielen kthie...@lab49.com wrote: As one C++ expert I know is fond of telling me, Haskell will only become popular when obscure mathematics becomes popular. That might be true, but the

Re[2]: [Haskell-cafe] Any generic serializer to String? was: Any working example of using genericserialize?

2009-09-30 Thread Bulat Ziganshin
Hello Max, Wednesday, September 30, 2009, 5:53:37 PM, you wrote: afaik, SYB just provides gshow/gread functions what serialize any Data instance to String FWIW, writing your own is not hard. I wrote a serializer for GHC using Data in less than 150 (simple) LOC. It produces [Word8], but

Re: Re[2]: [Haskell-cafe] Any generic serializer to String? was: Any working example of using genericserialize?

2009-09-30 Thread Dimitry Golubovsky
Bulat, OK, gread/gshow seem to be like the basis primitives. If they work properly, then it is what is needed. Thanks. On 9/30/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Max, Wednesday, September 30, 2009, 5:53:37 PM, you wrote: afaik, SYB just provides gshow/gread

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Aai
Very fast for long boolean lists by using a strict foldl and reversing the input: bsToInt :: [Bool] - Integer bsToInt = foldl' ((.fromIntegral.fromEnum).(+).join(+)) 0. reverse Try this: (1) $ bsToInt $ take 10 $ cycle [True,True,False,True,True,False,True] bitsToInt :: [Bool] - Integer

Re: [Haskell-cafe] Fwd: frag game-compiling error

2009-09-30 Thread Gwern Branwen
On Mon, Sep 28, 2009 at 11:36 AM, selahaddin selahattin.ger...@gmail.com wrote: Lyndon Maydwell wrote: src/Quaternion.hs:22:27 This would probably be the place to start. Ok,I managed to get past the error like this: newMatrix ColumnMajor [realToFrac r00,realToFrac r01,realToFrac

[Haskell-cafe] Re: I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Stefan Monnier
I might also point out that 90% of all desktop computers run Windows, and yet every single C library binding on Hackage fails to compile on Windows. That really needs to be fixed. Luckily, this is being fixed ... by the Free Software movement. Stefan

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Andrew Coppin
Peter Verswyvelen wrote: I really doubt people tend to think in either way. It's not even sure our thinking can be modeled with computing no? Well, try this: Go ask a random person how you add up a list of numbers. Most of them will say something about adding the first two together, adding

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread David Leimbach
On Wed, Sep 30, 2009 at 12:32 AM, Andrew Coppin andrewcop...@btinternet.com wrote: Casey Hawthorne wrote: I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language. If this is true, it

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Robert Wills
fwiw I found it difficult getting a Haskell installation onto Windows. Packages that would 'cabal install' just fine on Linux were much more of a pain on Windows. Eventually, I actually found it easiest to cross compile to Windows using wine: wine HaskellPlatform-2009.2.0.2-setup.exe wine

Re: [Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2009-09-30 Thread Roel van Dijk
If you are *really* sure that the runtime representation is the same you could use usafeCoerce. You could use a small test function for profiling, something like: convertGLfloat :: GLfloat - Float convertGLFloat = realToFrac -- convertGLFloat = unsafeCoerce and toggle between the two (assuming

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Peter Verswyvelen
Sure, but it doesn't mean that because someone uses an imperative way of counting, that it means people's brains work imperatively all the way. People tend to talk and communicate a lot in a declarative way no? For example ask someone that doesn't know programming how he we would make a paddleball

Re: [Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2009-09-30 Thread Peter Verswyvelen
I don't want to use the GL types directly since the OpenGL renderer is not exposes in the rest of the API. I was hoping that realToFrac would be a nop in case it would be identical to an unsafeCoerce. I guess one could make rules for that, but this tickets makes me wander if that really works:

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Daniel Fischer
Am Mittwoch 30 September 2009 09:32:08 schrieb Andrew Coppin: I might also point out that 90% of all desktop computers run Windows, and yet every single C library binding on Hackage fails to compile on Windows. That really needs to be fixed. Contribute your share, switch to Linux or BSD 8-)

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Justin Bailey
On Wed, Sep 30, 2009 at 7:54 AM, Robert Wills wrwi...@gmail.com wrote: fwiw I found it difficult getting a Haskell installation onto Windows.  Packages that would 'cabal install' just fine on Linux were much more of a pain on Windows.  Eventually, I actually found it easiest to cross compile

Re: [Haskell-cafe] Fwd: frag game-compiling error

2009-09-30 Thread Don Stewart
gwern0: On Mon, Sep 28, 2009 at 11:36 AM, selahaddin selahattin.ger...@gmail.com wrote: Lyndon Maydwell wrote: src/Quaternion.hs:22:27 This would probably be the place to start. Ok,I managed to get past the error like this: newMatrix ColumnMajor [realToFrac

[Haskell-cafe] Splitting data and function declarations over multiple files

2009-09-30 Thread Peter Verswyvelen
I guess this is related to the expression problem. Suppose I have a datatype *data Actor = Ball ... | Paddle ... | Wall ...* and a function *move (Ball ...) = * *move (Paddle ...) = * *move (Wall ...) = * in Haskell one must put *Actor* and *move* into a single file. This is rather cumbersome

Re: [Haskell-cafe] Splitting data and function declarations over multiple files

2009-09-30 Thread Niklas Broberg
Hi Peter, sounds to me you want to have a look at Open Data Types and Open Functions by Andres Löh and Ralf Hinze: http://people.cs.uu.nl/andres/OpenDatatypes.pdf Cheers, /Niklas On Wed, Sep 30, 2009 at 5:54 PM, Peter Verswyvelen bugf...@gmail.com wrote: I guess this is related to the

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread namekuseijin
On Mon, Sep 28, 2009 at 11:50 PM, Hong Yang hyang...@gmail.com wrote: learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. The Perl call is spot on. Specially because

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Michael Snoyman
On Wed, Sep 30, 2009 at 6:45 PM, namekuseijin namekusei...@gmail.comwrote: On Mon, Sep 28, 2009 at 11:50 PM, Hong Yang hyang...@gmail.com wrote: learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this

Re: [Haskell-cafe] Splitting data and function declarations over multiple files

2009-09-30 Thread Ryan Ingram
On Wed, Sep 30, 2009 at 8:54 AM, Peter Verswyvelen bugf...@gmail.comwrote: I guess this is related to the expression problem. Actually, this is exactly the expression problem :) Suppose I have a datatype *data Actor = Ball ... | Paddle ... | Wall ...* and a function *move (Ball ...) =

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Tom Tobin
On Wed, Sep 30, 2009 at 11:45 AM, namekuseijin namekusei...@gmail.com wrote: I've not been following Haskell too much and am completely lost when reading code like that.  I understand (+1), : and ! but what the hell are . and $ for? Function composition and lowest-precedence function

[Haskell-cafe] Haskell for Physicists

2009-09-30 Thread edgar
Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about the use of Haskell to substitute C or Fortran in a lot of tasks, and how

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Alex Queiroz
Hallo, On 9/30/09, ed...@ymonad.com ed...@ymonad.com wrote: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about the

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Ted Nyman
Some ideas of highly variable quality: Getting Functional with Physics Bosons, Fermions, and Monads? Haskell for Physicists Purer Programming for Physicists Use Haskell for Physics, and Say 'C'-You-Later - ted On Wed, Sep 30, 2009 at 10:42 AM, ed...@ymonad.com wrote: Hi, I will give a

[Haskell-cafe] Fwd: Uniplate + strict fields = fail. Why?

2009-09-30 Thread Dmitry Astapov
Hi, I've been playing with generics in general (pardon the pun) and Uniplate in particular, and found out that strict data fields somehow derail Uniplate. Observe: === code === {-# LANGUAGE DeriveDataTypeable #-} module Test where import Data.Generics (Data(..),Typeable(..)) import

Re: [Haskell-cafe] I read somewhere that for 90% of a wide classof computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 18:05:28 Peter Verswyvelen написал: On Wed, Sep 30, 2009 at 3:56 PM, Kalani Thielen kthie...@lab49.com wrote: That might be true, but the calculus and even arithmetic were once considered obscure. Mmm, to the average student calculus is still very obscure

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 15:58:40 Jochem Berndsen написал: Deniz Dogan wrote: 2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular.

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Eduard Sergeev
Bulat Ziganshin-2 wrote: sum . zipWith (*) (map (2^) [0..]) foldr1 $ \b - (+b) . (*2) -- View this message in context: http://www.nabble.com/convert-a-list-of-booleans-into-Word*-tp25677589p25686400.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Jochem Berndsen
Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions?

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 22:37:52 вы написали: Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title,

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Ted Nyman
reminds me of a well-known story, told to me some years back at cornell: richard feynman was set to deliver a series of lectures in brazil, and he spent a good deal of time learning spanish in preparation; that was until a visting professor from brazil told him he might want to try portuguese

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Jack Norton
Khudyakov Alexey wrote: В сообщении от Среда 30 сентября 2009 22:25:14 вы написали: Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and

Re: [Haskell-cafe] Splitting data and function declarations over multiple files

2009-09-30 Thread Luke Palmer
On Wed, Sep 30, 2009 at 9:54 AM, Peter Verswyvelen bugf...@gmail.com wrote: I guess this is related to the expression problem. Suppose I have a datatype data Actor = Ball ... | Paddle ... | Wall ... and a function move (Ball ...) = move (Paddle ...) = move (Wall ...) = in Haskell one must

Fwd: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Alberto G. Corona
Again, i missed to forward the message to the list: I experince also the drug effect. Evolutionary psychologists would say that, because it was vital for our survival, since the stone age, we appreciate any tool powerful enough to solve many problems while at the same time remain simple. So

Fwd: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Alberto G. Corona
I´m a physicist, so I think they would be attracted by something like Haskell: high level physics modelling at Fortran speeds Haskell: mathematics beyond numerical calculus 2009/9/30 ed...@ymonad.com Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil)

Fwd: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Alberto G. Corona
I would say that pure knowledge is pure and functional. but human planning and problem solving is imperative because implies sequencing of operations based on this pure knowledge. haskell express both nicely. 2009/9/30 Andrew Coppin andrewcop...@btinternet.com Peter Verswyvelen wrote: I

Fwd: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Alberto G. Corona
forwarded to the list: Curt, Rubi and Pyton came into existencie without their internet libraries, but they would´nt be popular without them. Although I conffess I don´t know the history in detail. Academics is not mainstream. 2009/9/29 Curt Sampson c...@starling-software.com On 2009-09-29

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Max Rabkin
On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona agocor...@gmail.com wrote: Haskell: mathematics beyond numerical calculus I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they might not know much about is *computation* beyond numerical calculus.

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Alberto G. Corona
This reminds me of the whole agent thing -- pretty much dominated by Java (e.g., Jade, Jason, Jack) nowadays --, for which I would bet lots things are done more straigthforward using Haskell -- especially those parts the Java coders are usually proud of... Let's maybe speak of *second

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 23:08:02 вы написали: Yep, sure did. I just hit `reply' assuming haskell-cafe was in the reply-to. I do that more often than not it seems. Going back to the OP, what area of physics, and how on earth are you going to convert years of fortran users to

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 23:29:32 Max Rabkin написал: On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona agocor...@gmail.com wrote: Haskell: mathematics beyond numerical calculus I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they

Re: Fwd: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Casey Hawthorne
On Wed, 30 Sep 2009 21:24:11 +0200, you wrote: I?m a physicist, so I think they would be attracted by something like Haskell: high level physics modelling at Fortran speeds Haskell: mathematics beyond numerical calculus And, easier to make use of multi-core machines than threaded Fortran.

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Jack Norton
Khudyakov Alexey wrote: В сообщении от Среда 30 сентября 2009 23:08:02 вы написали: Yep, sure did. I just hit `reply' assuming haskell-cafe was in the reply-to. I do that more often than not it seems. Going back to the OP, what area of physics, and how on earth are you going to convert

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Max Rabkin
I am *not* a physicist, but I imagine many physicists know at least something of functional analysis, algebra, Lie algebras, etc. However, when physicists write programs (this is my inference from the widespread use of Fortran and the computational assignments given to undergraduate students)

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread edgar
Good ones! Specially the second, since I will show a real example where I used Haskell to model a boson condensate. Thanks for the suggestions. Edgar On Wed, 30/Sep/2009 at 10:52 -0700, Ted Nyman wrote: Some ideas of highly variable quality: Getting Functional with Physics Bosons, Fermions,

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread edgar
On Wed, 30/Sep/2009 at 22:27 +0200, Max Rabkin wrote: I am *not* a physicist, but I imagine many physicists know at least something of functional analysis, algebra, Lie algebras, etc. However, when physicists write programs (this is my inference from the widespread use of Fortran and the

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread edgar
On Wed, 30/Sep/2009 at 22:21 +0400, Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread edgar
On Wed, 30/Sep/2009 at 22:21 +0400, Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Sebastian Sylvan
On Wed, Sep 30, 2009 at 8:32 AM, Andrew Coppin andrewcop...@btinternet.comwrote: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular. We shall see...) You could use the same argument against, say,

Re: Fwd: [Haskell-cafe] suggestion for hslogger

2009-09-30 Thread Duncan Coutts
On Wed, 2009-09-30 at 08:36 -0500, John Goerzen wrote: If you want to send me a patch that makes it an option (not mandatory), I would be happy to apply it. When reviewing it do consider the new Unicode IO library.

Re: Fwd: [Haskell-cafe] suggestion for hslogger

2009-09-30 Thread John Goerzen
Duncan Coutts wrote: On Wed, 2009-09-30 at 08:36 -0500, John Goerzen wrote: If you want to send me a patch that makes it an option (not mandatory), I would be happy to apply it. When reviewing it do consider the new Unicode IO library.

Re: [Haskell-cafe] river crossing puzzle

2009-09-30 Thread Eduard Sergeev
pat browne-2 wrote: Hi, Does anyone know where there are any Haskell implementations of the the River Crossing puzzle (AKA Farmer/Fox/Goose/Grain). Here is an implementation of the similar problem with good explanation (see PDF): http://web.engr.oregonstate.edu/~erwig/zurg/ It isn't

Re: [Haskell-cafe] type class question

2009-09-30 Thread Henning Thielemann
Ben schrieb: dear haskellers -- i'm trying this question again, in haskell-cafe. i got some responses in haskell-beginners but am looking for more guidance. also, i understand this functionality is encapsulated in the Workflow module in hackage, but i'd like to understand this myself.

[Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Hong Yang
Hi, I got an error if one of lines reads --++ bla bla bla where I tried to comment, but -- ++ bla bla bla (notice the space after --) is OK. Do you think this revealed a tiny bug in the GHC compiler (I am using Windows Haskell Platform 2009.2.0.2)? Thanks, Hong

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Daniel Peebles
I don't think it's a bug. --++ is a valid operator, whereas -- introduces a comment. In GHCI: Prelude let (--++) = (+) in 5 --++ 6 11 Hope this helps, Dan On Wed, Sep 30, 2009 at 7:52 PM, Hong Yang hyang...@gmail.com wrote: Hi, I got an error if one of lines reads --++ bla bla bla where I

Re: [Haskell-cafe] convert a list of booleans into Word*

2009-09-30 Thread Henning Thielemann
On Wed, 30 Sep 2009, Jochem Berndsen wrote: Bulat Ziganshin wrote: Hello Paul, Wednesday, September 30, 2009, 1:18:03 PM, you wrote: I haven't found a function in hackage or in the standard library that takes a list of booleans (or a list of 0s and 1s, or a tuple of booleans or 0s and 1s)

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Sebastian Sylvan
On Thu, Oct 1, 2009 at 12:52 AM, Hong Yang hyang...@gmail.com wrote: Hi, I got an error if one of lines reads --++ bla bla bla where I tried to comment, but -- ++ bla bla bla (notice the space after --) is OK. Do you think this revealed a tiny bug in the GHC compiler (I am using Windows

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Curt Sampson
On 2009-09-29 13:28 -0700 (Tue), Don Stewart wrote: I'd welcome input on how to best present all this -- the Haskell Platform gives us a chance to package up the docs in a better format for consumption. Part of the issue is that the Haskell libraries are so different in many ways that there's

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Curt Sampson
On 2009-09-30 13:45 -0300 (Wed), namekuseijin wrote: The Perl call is spot on. Specially because Haskell has been incorporating so much syntatic sugar that it's almost looking Perlish noise already: [examples deleted] No, I disagree with your particular examples; they're bog-standard Haskell

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Tony Morris
There is a significant difference between: * A $ function without a type system * A statically checked $ function * A $ keyword without static checking Curt Sampson wrote: On 2009-09-30 13:45 -0300 (Wed), namekuseijin wrote: The Perl call is spot on. Specially because Haskell has been

[Haskell-cafe] Portability of libraries.

2009-09-30 Thread Curt Sampson
On 2009-09-30 07:16 -0600 (Wed), John A. De Goes wrote: The cross-platform features have been extremely important to the success of Java Moreover, the importance of cross-platform libraries on the Java platform is evinced by the fact that developers of major native libraries

[Haskell-cafe] Re: combinatorial search with running bound

2009-09-30 Thread Chung-chieh Shan
I wish I had enough of your code to type-check my code and perhaps even try running it! Michael Mossey m...@alumni.caltech.edu wrote in article 3942.75.50.175.130.1253997756.squir...@mail.alumni.caltech.edu in gmane.comp.lang.haskell.cafe: -- This is state used in the state monad. data

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Curt Sampson
On 2009-10-01 11:42 +1000 (Thu), Tony Morris wrote: There is a significant difference between: * A $ function without a type system * A statically checked $ function * A $ keyword without static checking Sure, but I'm not not clear on the point you're trying to make, since we all know

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Felipe Lessa
On Wed, Sep 30, 2009 at 03:43:12PM +0100, Andrew Coppin wrote: Well, try this: Go ask a random person how you add up a list of numbers. Most of them will say something about adding the first two together, adding the third to that total, and so forth. In other words, the step by step

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Hong Yang
But in my program, I did not define --++. Also in GHCI, Prelude :t (--++) No in scope: '--++' Prelude :t (+) (+) :: (Num a) = a - a - a Thanks, Hong On Wed, Sep 30, 2009 at 7:05 PM, Daniel Peebles pumpkin...@gmail.comwrote: I don't think it's a bug. --++ is a valid operator, whereas --

  1   2   >