[Haskell-cafe] Re: malicious JS on haskell site
Popup advertising is still being hosted on haskell.org. What is the right way to deal with this? Is there a person or process to fix this? Deleting some nedstatbasic javascript at the bottom should fix the problem. I'm sorry for sending this to such a large list but I don't know who the is the right contact and it seems like a pretty bad way to start off with people who are trying to figure out what haskell offers. Thanks, Keith On Thu, Sep 9, 2010 at 5:30 PM, Keith Sheppard keiths...@gmail.com wrote: Hello cafe, Maybe malicious isn't the right word but there is a JS based web counter on http://www.haskell.org/complex/why_does_haskell_matter.html which likes to show pop up adverts. They must have switched over from counting visitors to showing adverts at some point since the web page was created. I'm sure this is something we want removed... It would probably be good to grep the whole server to make sure that this counter doesn't show up on some other page too. Sorry if this is a simple oversight on my part but I don't know who I should be contacting about this kind of thing. It would be great if there was some kind of webmas...@haskell.org address that was advertised or some form that we could submit for issues like this. -keith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] malicious JS on haskell site
Hello cafe, Maybe malicious isn't the right word but there is a JS based web counter on http://www.haskell.org/complex/why_does_haskell_matter.html which likes to show pop up adverts. They must have switched over from counting visitors to showing adverts at some point since the web page was created. I'm sure this is something we want removed... It would probably be good to grep the whole server to make sure that this counter doesn't show up on some other page too. Sorry if this is a simple oversight on my part but I don't know who I should be contacting about this kind of thing. It would be great if there was some kind of webmas...@haskell.org address that was advertised or some form that we could submit for issues like this. -keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Troubles Building LLVM (Fixed)
Hello, in case someone else hits this problem I was able to fix it by installing the latest haskell platform via macports. - I uninstalled ghc sudo /Library/Frameworks/GHC.framework/Tools/Uninstaller - deleted ~/.ghc and ~/.cabal - did a sudo port install haskell-platform (be prepared for this to take a couple of hours). ghc --version gives 6.10.4 - cabal install llvm I still don't know the root cause of the build error but now the llvm examples build and run with no errors. -Keith On Thu, Jun 17, 2010 at 10:46 PM, Keith Sheppard keiths...@gmail.com wrote: Hello All, I'm trying to get up and running with the very interesting llvm package[1] but I'm running into problems during the linking stage. ke...@sugarglider-2:~/projects/third-party/llvm-hs-bindings/examples/ make clean all rm -f HelloJIT Fibonacci BrainF Vector Array DotProd Arith Align Struct Varargs *.o *.hi *.s *.bc Fib *.exe *.exe.manifest *~ ghc -Wall -optl -w --make -o HelloJIT.exe -main-is HelloJIT.main HelloJIT.hs [1 of 1] Compiling HelloJIT ( HelloJIT.hs, HelloJIT.o ) Linking HelloJIT.exe ... Undefined symbols: _LLVMAddCondPropagationPass, referenced from: _ssCM_info in libHSllvm-0.7.1.1.a(Scalar.o) ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [HelloJIT.exe] Error 1 It's probably something very simple that I'm doing wrong since this is my first Haskell build linking against foreign libs. Do you know what I might be doing wrong? Here are the versions: Mac OS X 10.5.8 GHC 6.10.1 (waiting out a leopard installer bug [2]) llvm-2.7 installed to default location llvm package version 0.7.1.1 Thanks! BTW, the combination of this package plus the awesome Haskell parsers seem to make for a great compiler construction kit. I'm looking forward to playing around w/ llvm [1] http://hackage.haskell.org/package/llvm [2] http://trac.haskell.org/haskell-platform/ticket/110 -- keithsheppard.name -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Troubles Building LLVM
Hello All, I'm trying to get up and running with the very interesting llvm package[1] but I'm running into problems during the linking stage. ke...@sugarglider-2:~/projects/third-party/llvm-hs-bindings/examples/ make clean all rm -f HelloJIT Fibonacci BrainF Vector Array DotProd Arith Align Struct Varargs *.o *.hi *.s *.bc Fib *.exe *.exe.manifest *~ ghc -Wall -optl -w --make -o HelloJIT.exe -main-is HelloJIT.main HelloJIT.hs [1 of 1] Compiling HelloJIT ( HelloJIT.hs, HelloJIT.o ) Linking HelloJIT.exe ... Undefined symbols: _LLVMAddCondPropagationPass, referenced from: _ssCM_info in libHSllvm-0.7.1.1.a(Scalar.o) ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [HelloJIT.exe] Error 1 It's probably something very simple that I'm doing wrong since this is my first Haskell build linking against foreign libs. Do you know what I might be doing wrong? Here are the versions: Mac OS X 10.5.8 GHC 6.10.1 (waiting out a leopard installer bug [2]) llvm-2.7 installed to default location llvm package version 0.7.1.1 Thanks! BTW, the combination of this package plus the awesome Haskell parsers seem to make for a great compiler construction kit. I'm looking forward to playing around w/ llvm [1] http://hackage.haskell.org/package/llvm [2] http://trac.haskell.org/haskell-platform/ticket/110 -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The instability of Haskell libraries
1) The buildbot will catch dependencies with compile errors, but only after the package has been pushed, and there is no easy way for packagers to check that this won't happen An alternate solution that can be done completely outside the hackage loop: Set up a server to poll the Source-Repository head of every hackage package that includes one in it's cabal file, then rerun the build any time a change is detected. This may be a good excuse to implement a pluggable continuous integration server in haskell too along the lines of what Hudson is for java... maybe an idea for the next GSoC Best, Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The instability of Haskell libraries
Sorry, rerun the build means rebuild my package and all of my package's dependencies... On Fri, Apr 23, 2010 at 7:11 PM, Keith Sheppard keiths...@gmail.com wrote: 1) The buildbot will catch dependencies with compile errors, but only after the package has been pushed, and there is no easy way for packagers to check that this won't happen An alternate solution that can be done completely outside the hackage loop: Set up a server to poll the Source-Repository head of every hackage package that includes one in it's cabal file, then rerun the build any time a change is detected. This may be a good excuse to implement a pluggable continuous integration server in haskell too along the lines of what Hudson is for java... maybe an idea for the next GSoC Best, Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The instability of Haskell libraries
What Gwern said for 1) and 3) 2) Not all head repositories are kept stable/buildable at all times. Isn't it bad practice to not have a buildable repo? In any case package owners would be free to use or ignore the data as they like, but I'm pretty sure it would be useful to many. Best, Keith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] help with Haskell programming
Hello Mujtaba, I wonder is this homework? If that's the case there is nothing wrong with asking homework related questions but they should probably be marked as such. I think the most straight forward solution will use function composition (.) and the (not) function -keith On Sun, Apr 18, 2010 at 11:35 AM, Mujtaba Boori mujtaba.bo...@gmail.com wrote: Hello I am kinda newbie in Haskell you can help help me with some programming I am trying to make function like for example func :: (a - Bool) - (a - Bool) this function make calculation and return bool . I want to be able to make bool True when It is False and False when it is True while returning the a. Thank you -- Mujtaba Ali Alboori ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: help with Haskell programming
Using composition can be tricky with more than one arg. I just want to be sure you're not really looking for something like: func :: (a - Bool) - (b - Bool) - (a - b - Bool) keeping with your given type I think you're looking for something like: func f1 f2 x = (f1 x) || (f2 x) I'm sure there is a nice way to do this with function composition but I still find composition less intuitive than explicit args in cases like this. On Sun, Apr 18, 2010 at 1:00 PM, Mujtaba Boori mujtaba.bo...@gmail.com wrote: Thanks for helping me but I have another problem (sorry for asking) . I tried to figure it out . how about if I want to compare two kind with () (||) for func :: (a - Bool) - (a - Bool) - (a - Bool) I tried some thing like func = ((||) .) This is the annoying part about Haskell . I can not understand composition . On Sun, Apr 18, 2010 at 4:35 PM, Mujtaba Boori mujtaba.bo...@gmail.com wrote: Hello I am kinda newbie in Haskell you can help help me with some programming I am trying to make function like for example func :: (a - Bool) - (a - Bool) this function make calculation and return bool . I want to be able to make bool True when It is False and False when it is True while returning the a. Thank you -- Mujtaba Ali Alboori -- Mujtaba Ali Alboori ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] statistics build error
Hello, I ran into this error while trying to install statistics. Does this indicate that I need to upgrade my GHC before I can install? k...@catskill:~/projects/ cabal update Downloading the latest package list from hackage.haskell.org k...@catskill:~/projects/ cabal install statistics Resolving dependencies... Downloading erf-1.0.0.0... Configuring erf-1.0.0.0... Preprocessing library erf-1.0.0.0... Building erf-1.0.0.0... [1 of 1] Compiling Data.Number.Erf ( src/Data/Number/Erf.hs, dist/build/Data/Number/Erf.o ) ar: creating archive dist/build/libHSerf-1.0.0.0.a Installing library in /Users/kss/.cabal/lib/erf-1.0.0.0/ghc-6.10.1 Registering erf-1.0.0.0... Reading package info from dist/installed-pkg-config ... done. Writing new package config file... done. Downloading primitive-0.2.1... Configuring primitive-0.2.1... Preprocessing library primitive-0.2.1... Building primitive-0.2.1... [1 of 7] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist/build/Data/Primitive/MachDeps.o ) [2 of 7] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o ) [3 of 7] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, dist/build/Data/Primitive/Types.o ) [4 of 7] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist/build/Data/Primitive/Array.o ) [5 of 7] Compiling Data.Primitive.ByteArray ( Data/Primitive/ByteArray.hs, dist/build/Data/Primitive/ByteArray.o ) Data/Primitive/ByteArray.hs:57:27: Not in scope: `newAlignedPinnedByteArray#' cabal: Error: some packages failed to install: mwc-random-0.5.0.0 depends on primitive-0.2.1 which failed to install. primitive-0.2.1 failed during the building phase. The exception was: exit: ExitFailure 1 statistics-0.5.1.0 depends on primitive-0.2.1 which failed to install. vector-0.5 depends on primitive-0.2.1 which failed to install. vector-algorithms-0.3.1 depends on primitive-0.2.1 which failed to install. Thanks, Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: statistics build error
Sorry, I forgot to add my ghc version is 6.10.1 on OSX k...@catskill:~/projects/ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.1 On Fri, Apr 16, 2010 at 1:08 PM, Keith Sheppard keiths...@gmail.com wrote: Hello, I ran into this error while trying to install statistics. Does this indicate that I need to upgrade my GHC before I can install? k...@catskill:~/projects/ cabal update Downloading the latest package list from hackage.haskell.org k...@catskill:~/projects/ cabal install statistics Resolving dependencies... Downloading erf-1.0.0.0... Configuring erf-1.0.0.0... Preprocessing library erf-1.0.0.0... Building erf-1.0.0.0... [1 of 1] Compiling Data.Number.Erf ( src/Data/Number/Erf.hs, dist/build/Data/Number/Erf.o ) ar: creating archive dist/build/libHSerf-1.0.0.0.a Installing library in /Users/kss/.cabal/lib/erf-1.0.0.0/ghc-6.10.1 Registering erf-1.0.0.0... Reading package info from dist/installed-pkg-config ... done. Writing new package config file... done. Downloading primitive-0.2.1... Configuring primitive-0.2.1... Preprocessing library primitive-0.2.1... Building primitive-0.2.1... [1 of 7] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist/build/Data/Primitive/MachDeps.o ) [2 of 7] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o ) [3 of 7] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, dist/build/Data/Primitive/Types.o ) [4 of 7] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist/build/Data/Primitive/Array.o ) [5 of 7] Compiling Data.Primitive.ByteArray ( Data/Primitive/ByteArray.hs, dist/build/Data/Primitive/ByteArray.o ) Data/Primitive/ByteArray.hs:57:27: Not in scope: `newAlignedPinnedByteArray#' cabal: Error: some packages failed to install: mwc-random-0.5.0.0 depends on primitive-0.2.1 which failed to install. primitive-0.2.1 failed during the building phase. The exception was: exit: ExitFailure 1 statistics-0.5.1.0 depends on primitive-0.2.1 which failed to install. vector-0.5 depends on primitive-0.2.1 which failed to install. vector-algorithms-0.3.1 depends on primitive-0.2.1 which failed to install. Thanks, Keith -- keithsheppard.name -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Are there any gay haskelleres?
Hello, I am one. Best Keith 2010/3/28 Günther Schmidt gue.schm...@web.de: Hi guys, are there any gay haskellers? ... Since the first one was so much fun ;) Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Are there any web server framework ?
Hi, I think that Turbinado is no longer active since the author is leaving Haskell (unless someone will adopt it) http://www.alsonkemp.com/haskell/reflections-on-leaving-haskell/ -Keith On Wed, Mar 17, 2010 at 5:25 PM, Hugo Gomes mr.hugo.go...@gmail.com wrote: There is also turbinado. Im not sure about the current state of it. On 3/17/10, zaxis z_a...@163.com wrote: Erlang has yaws (http://yaws.hyber.org/) Scala has lift (http://liftweb.net/) Python has django (http://www.djangoproject.com/) Ruby has rails (http://rubyonrails.org/) How about haskell ? Is there any similar framework, which should be steady, powerful and easy to use, in haskell ? Sincerely! - fac n = let { f = foldr (*) 1 [1..n] } in f -- View this message in context: http://old.nabble.com/Are-there-any-web-server-framework---tp27926433p27926433.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] definition of sum
I asked a similar question a while ago on the cafe http://www.haskell.org/pipermail/haskell-cafe/2009-June/thread.html#62772 On Wed, Mar 10, 2010 at 5:33 PM, TeXitoi texi...@texitoi.eu wrote: After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl used by Data.List for sum? -- Guillaume Pinot http://www.irccyn.ec-nantes.fr/~pinot/ « Les grandes personnes ne comprennent jamais rien toutes seules, et c'est fatigant, pour les enfants, de toujours leur donner des explications... » -- Antoine de Saint-Exupéry, Le Petit Prince () ASCII ribbon campaign -- Against HTML e-mail /\ http://www.asciiribbon.org -- Against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] multMM :: Matrix - Matrix - Matrix --multiplies two matrices question (Homework)
I did a blog post on basic matrix ops which may be useful to you http://blog.keithsheppard.name/2009/06/bird-tracks-through-math-land-basic.html It uses a 2D list representation for matrices which you would not do for any performance critical work. best keith On Wed, Feb 3, 2010 at 1:38 AM, 조광래 kwangrae...@gmail.com wrote: hi i was trying to solve it but All i got is type Matrix=[[Double]] multMM :: Matrix - Matrix - Matrix --multiplies two matrices multMM m t = [[sum (zipWith (*) (head m)(a)) ] ]where a = [head a | a- t] Main multMM [[2,1,-6],[1,-3,2]] [[1,0,-3],[0,4,20],[-2,1,1]] [[14.0]] from this i could get only the first multiplication 14 that is by 2*1 + 1*0 + -6*-2 = 14 how can i make this go throw all rows and colums to get multiple of matrixs? Thank you~ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] imaging textbooks?
I have just started reading this so I don't know how good it is yet but the draft is freely available: http://research.microsoft.com/en-us/um/people/szeliski/Book/ Best Keith 2010/1/25 Dan Mead d.w.m...@gmail.com: Hey all Can anyone recommend a good textbook on computer vision or image processing? I don't care if it favors Haskell or not, I'm just trying to find a good text. -Dan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] hackage build errors
Hello Cafe, I noticed on my package's hackage page there is a build failure message: http://hackage.haskell.org/package/txt-sushi I don't know if these are real errors or not (I don't experience them on OS X and it's pure Haskell code) but I did poke around and noticed that some popular packages on hackage also have build failures: http://hackage.haskell.org/package/xmonad http://hackage.haskell.org/package/haddock http://hackage.haskell.org/package/pandoc http://hackage.haskell.org/package/alex http://hackage.haskell.org/package/hlint ... so what should I make of these errors? Are they useful in some way or just a problem with the build environment? (If that's the case I think they should probably be removed since they're confusing for potential users) Best Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Distinct types in a list
Hello, My impression is that using existential types where possible will result in more complete type checking than Data.Dynamic but I'm not sure since I haven't yet tried Data.Dynamic in my own code. Can someone confirm if this is right? Best Keith On Thu, Jan 7, 2010 at 2:02 PM, Christian Maeder christian.mae...@dfki.de wrote: You could cast your parser result a to Dynamic using Data.Dynamic.toDyn (and derive Typeable instances for all involved types). http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Data-Dynamic.html Using an existential types may be another alternative. Cheers Christian rodrigo.bonifacio schrieb: Hi all, I have a family of parsers that return either (Success t) or (Fail), using the following data type: data ParserResult a = Success a | Fail String deriving (Read, Show, Eq, Ord) isSuccess (Success _) = True isSuccess (Fail _) = False ... I want to add the results of different parsers to a list. Such as: m1 = parseFirstModel file1 -- it returns a ParserResult of t1 m2 = parseSecondModel file2 -- it returns a ParserResult of t2 ps = [m1, m2] In such a way that I could write something like: if and (map isSuccess ps) then process m1 m2 else ... Actually, in the real program I have to check more than two input models. However, since Lists do only hold elements of a same type, I couldn't proceed in this way. Which improvements to the ParserResult data type should I wrote in order to proceed as I want to. Best regards, Rodrigo. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: TxtSushi 0.5.0
Hello Cafe, I've uploaded a new version of TxtSushi to http://hackage.haskell.org/package/txt-sushi and announced the details here http://blog.keithsheppard.name/2009/12/txtsushi-050.html. TxtSushi is a set of command-line utilities for transforming CSV and tab-delimited files including an SQL based utility. Best Regards Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Haskell From a XSD
I don't think such a tool exists. I think it would be a great contribution if someone decides to create one. Best Keith On Wed, Dec 23, 2009 at 12:34 PM, jonathangfisch...@gmail.com wrote: I would like to generate Haskell data types and xml serialization code from xsd. I know of DtdToHaskell but unfortunately I yet to be able to generate a valid dtd from my xsd. Is there a way to generate Haskell from a xsd? -Jonathan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Haskell From a XSD
Yes I'm interested in helping too. It's hard for me to know how much time I'll have but my other side proj is starting to wind down now. Maybe a wiki planning page and a patch-tag (or any other repo site really) workspace is a good starting point? Sent from my iPhone On Dec 23, 2009, at 1:19 PM, Hector Guilarte hector...@gmail.com wrote: I'd like to help... I'm not an expert in Haskell, but I guess I could help somehow... Hector Guilarte -Original Message- From: jonathangfisch...@gmail.com Date: Wed, 23 Dec 2009 18:11:21 To: Keith Sheppardkeiths...@gmail.com; jonathangfisch...@gmail.com Cc: haskell-cafe@haskell.org Subject: Re: Re: [Haskell-cafe] Generating Haskell From a XSD ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] pointfree-trouble
Hello, I didn't try to understand what the function is doing, but just quickly noticed that reMatr a = Matr . (flip (.) unMatr) a can be written as reMatr a = Matr . ((flip (.) unMatr) a) but that reMatr = Matr . (flip (.) unMatr) can be written as reMatr a = (Matr . (flip (.) unMatr)) a so because of precedence rules a different function is being applied to 'a' in the 2 versions Best Keith On Tue, Dec 22, 2009 at 9:13 AM, slemi 0sle...@gmail.com wrote: thanks, that's a really neat syntactic sugar :) however, my original question was how to make the reMatr function pointfree, as reMatr = Matr . (flip (.) unMatr) is not working. any ideas/explanation why it doesnt work? Kim-Ee Yeoh wrote: Here's another way of writing it: data Matrix a = Matr {unMatr :: [[a]]} | Scalar a deriving (Show, Eq) -- RealFrac constraint removed reMatr :: RealFrac a = ([[a]] - [[a]]) - (Matrix a - Matrix a) reMatr f = Matr . f . unMatr -- this idiom occurs a lot, esp. with newtypes Affixing constraints to type constructors is typically deprecated. slemi wrote: i have trouble making a function pointfree: data RealFrac a = Matrix a = Matr [[a]] | Scalar a deriving (Show, Eq) unMatr :: RealFrac a = Matrix a - [[a]] unMatr = (\(Matr a) - a) reMatr :: RealFrac a = ([[a]] - [[a]]) - (Matrix a - Matrix a) reMatr a = Matr . (flip (.) unMatr) a this works fine, but if i leave the 'a' in the last function's definition like this: reMatr = Matr . (flip (.) unMatr) it gives an error. can anybody tell me why? (i'm using ghci) -- View this message in context: http://old.nabble.com/pointfree-trouble-tp26881661p26888978.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What about adding a wiki for each haskell project?
What about if during the Checking a Cabal package upload step there was a check to see if there was a homepage in the cabal file? If there is no homepage we could have something like: Your cabal file does not contain a link to a project homepage. You may want to add a haskell wiki link as your homepage by adding the following line to your cabal file... This would not force the wiki page on anyone but it would add a nudge to anyone who just didn't think about it. -Keith On Sat, Dec 12, 2009 at 12:09 PM, Marc Weber marco-owe...@gmx.de wrote: Hi Antoine. One of the main goals is to have a place to a put information when you're not the maintainer. Of course I can put everything into *my* cabal files. I don't want to do this for projects I don't maintain. I'd like to ask maintainers first. But while this question - reply cycle is in progress I'd like to add a link to my patches. About darcs: Sure. Nobody want's to duplicate the contents of the darcs web page. However you can add a link to it. I wonder which is the way to ask all maintainers how they like this idea or more important: Why they might dislike having a wiki page others may edit as well. Marc Weber ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is Haskell a Fanatic?
There is nothing wrong with constructive criticism and debate. We should welcome it and I think that the initial response did. But the OP's follow up of: It will be better for all of you to figure it out for yourselves and gain more experience about what is out there. Haskell isn't the world. Haskell would be the cutting edge if it didn't have competition. tells me that the post was not intended to be constructive Best -Keith On Fri, Dec 4, 2009 at 10:58 AM, David Leimbach leim...@gmail.com wrote: Hi Simon and others, Personally I don't see anything wrong with this guy's line of questioning. He wants some proof that Haskell can live up to some of the claims made about it. There's a lot of selling of languages like Clojure, Scala, and Haskell going on that have real world examples showing how code compares from one language to the next (sometimes unfairly I'll add, in that the code that one person writes in one language, does not illustrate the best of that language). I will admit I missed out on the optimization thread that people refer to. I guess I could read the archives, but the tone of this thread makes me think it's not worthwhile. I think what it boils down to is Haskell use is a choice that every person gets to make for their spare time projects and if you're lucky enough to have such a choice at your job, why not check it out and see for yourself? If one disagrees with the claims of the salesmen, perhaps a trial period will convince one otherwise, it's not like it costs anything but time. There's not even a 90 day money back guarantee to worry about. As for trolls on the mailing list, I personally do not have time to read every message that comes through haskell-cafe because the level of activity is higher than my available bandwidth for reading emails. As such, I often press this lovely button the people who made my computer and operating system so thoughtfully designed called delete. Man does that thing ever work wonders... Then people can refrain from increasing the magnitude of the denominator in the signal to noise ratio that has a nice value at the moment here in this community. Sadly I think I just did the opposite, but since this is a cafe, and I had something to say, and I said it, I don't feel so badly about it, and won't comment on it again. Just my 2 cents, which might be all I have left these days :-) Dave On Fri, Dec 4, 2009 at 1:34 AM, Simon Peyton-Jones simo...@microsoft.com wrote: Friends One of the absolutely best things about the Haskell community is that it is almost invariably respectful and usually friendly. People often remark on this when they join the community. Beginner questions are greeted with polite and helpful replies. Category theory and elementary type errors show up in successive messages. Etc. But thread is an exception. If you think someone is talking nonsense, I think the best policy is to ignore it or reply privately (not to the list); then the thread dies. I find derogatory discussion of a particular person quite discouraging. It is likely to be unjust, and it encourages more of the same. It's like littering your own house. Respect, guys, please. Simon | This troll was, apparently, invited by one of the Simons | onto the Haskell' list, then asked to move his spiels here. | | I am informed that the invitation I was referring to was actually | about his being invited *out*, not in, so his origin is still a | mystery and troll is likely appropriate. (I can't say he's | demonstrated much of a mathematical basis for his trollery; only a | propensity for pompous declarations, and deflection when challenged on | them. Put up or shut up, troll.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] hoogle down
hoogle is down for me: Internal Server Error Thanks Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Problems with Haskell
Hello Philippos I received a lot of furious and offensive private emails for suggesting the Clean programmer to stick with Clean. I don't get why some people think it's OK to be disrespectful just because they're on the internet... Regarding the code, I find it hard to follow without some high level comments explaining the flow. I haven't used mutable arrays yet so I won't be any help there, but here are some minor things I noticed in your do blocks: Where you write code like: do ... a - return exp1 b - return exp2 i think it's better to write do ... let a = exp1 b = exp2 also else do writeArray v i g could be else writeArray v i g since you don't need the implicit that do gives you Could you highlight the line(s) of code that are different in the 2 versions of mutate? -Keith On Sun, Oct 18, 2009 at 11:07 PM, Philippos Apolinarius phi50...@yahoo.ca wrote: Before anything else, I want to point out that I have no intention to confront your community, or denigrate Haskell. A few days ago I answered an email from a Clean programmer on something related to Clean. He was worried that Clean team could give up its good work, and Clean could disappear; therefore, he was thinking about switching to Haskell. Since I thought that my email could be of interest for the Clean community, I posted it in the -- small-- Clean list :-(Clean is not as popular as Haskell). I received a lot of furious and offensive private emails for suggesting the Clean programmer to stick with Clean. However, I also received a very polite, humorous, and illuminating private email from a person who seems to work at Microsoft. His name is Simon Peyton-Jones. He urged me to post my comments on a Haskell cafe. He also filed one of my comments as a bug in a Haskell bug track. Here is a couple of snippets from his email: --- I think it's v bad that a straightforward program runs so slowly, and it's certainly true that this is an area we could pay more attention to. --- Meanwhile, I'm curious: are the arrays in Philippos's program strict? Or lazy? If strict, that's a pretty big difference. Therefore, here are my comments, with a lot of code. A few months ago I came accross an unpublished article about a novel genetic programming system. The system was coded in Larceny Scheme. I translated it to Clean and to Haskell. Unhappily, I cannot post the program here because it is very large, and the authors of the original Lisp program don't want me to divulge it before they see in in a printed page of a Journal. Therefore, I wrote an empty genetic programming framework, just to compare languages. Comparing Clean and Haskell, I noticed: 1 -- Clean compiler almost never let me do very stupid things, like trying to unbox a tree, or to write in a closed file (I will post an example of this in a near future). For instance, Clean compiler would never swallow something like the code below: import Control.Monad.ST import Data.Array.ST import Data.Array.Base import System.Random data Op = AND | OR | NOT; data Tree= L Double | T Op [Tree] main = print $ runST (do arr - newArray (1,200) (L 0.0) :: ST s (STArray s Int Tree) go arr 200 0.0 ) go :: STArray s Int Tree - Int - Double - ST s Double go a i acc | i 1 = return acc | otherwise=do b - unsafeRead a i {- readArray a i -} writeArray a i (setDouble ((getDouble b)+3.0)) c - readArray a i go a (i-1) (acc+ (getDouble c)) -- What I really need is a random index in Haskell. getDouble (L r)= r getDouble _ = 0.0 setDouble r= L r 2 -- Safety does not cost much in Clean. For instance, removing array boundary check does not seem to affect Clean. I believe that it does not affect Haskell either, but I have not verified this point. 3 -- Haskell seems to loop more often than Clean. For instance, Haskell may loop if I change function mutate to mutate e (L i) xs = (e, xs) mutate e t (y:ys) = ins t (rnLen t y, ys) where ins (T p (L i:xs)) (0, st)=(T p (e:xs), st) ins (T p (t:xs)) (n,(r1:rs)) | n 0= let (T p mt, s2)= ins (T p xs)(n-1, rs) in (T p (t:mt), s2) ins (T p (t:xs)) (n,(r1:rs)) | rn 2 r1== 0= (T p (e:xs), rs) | rn 2 r1== 1= let (xpr, st)= mutate e t rs in (T p (xpr:xs), st) This might be a bug in my implementation of show Tree. It would be great if you people could show me what I did wrong. 4 -- On the plus side, there are libraries in Haskell that seem to behave better than the Clean equivalent libraries. This could be explained by the fact that there are a lot of people coding Haskell libraries, while Clean team seems to be reluctant in accepting libraries from outsiders. For instance, lethevert made a very important improvement in ObjectIO (changing fonts in edit text field), but it was never
Re: [Haskell-cafe] I/O Haskell question
I have to nominate I'm lying here, but for a good cause as a quote of the week. -Keith On Mon, Oct 5, 2009 at 10:06 AM, Deniz Dogan deniz.a.m.do...@gmail.com wrote: 2009/10/5 Maria Boghiu maria.bog...@gmail.com: I get an error saying I am mismatching types IO [String] and [String]. Something of the type IO [String] is a computation which does some IO (reading files, launching nukes, etc.) and then returns a list of strings. Something of the type [String] is merely a list of strings. It is impossible (I'm lying here, but for a good cause) to convert something on the form IO a to just a. Try something like this: main = do fileContent - readFile /path/to/file xmonad $ defaultConfig { ... workspaces = lines fileContent, ... } ... -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] killer app sought
IMO google web toolkit has done this for Java and I haven't tried it but maybe http://www.haskell.org/haskellwiki/Haskell_in_web_browser does or will do this for Haskell. I still think that there is a place for web applications that are smart on the server side though. Best -Keith On Sun, Oct 4, 2009 at 5:55 PM, Alberto G. Corona agocor...@gmail.com wrote: Yes, Maybe The piece of the web that desperately need a boost in performance, declarativeness, safety, static typing threading, modularity etc etc etc is the Web Browser. 2009/10/4 John A. De Goes j...@n-brain.net With few exceptions, no such thing as a killer server-side app. The Web 3.0 paradigm is simple: all work except sharing and persistence of data is done on the client. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net | 877-376-2724 x 101 On Oct 3, 2009, at 9:08 PM, Mark Wotton wrote: Hi, I've been writing a little binding from Ruby to Haskell called Hubris (http://github.com/mwotton/Hubris) which I think has some potential both for making Haskell web apps easier to write, and also for bringing the more adventurous Ruby programmers into the Haskell community. Code-wise it's coming along nicely, and once 6.12 is out it'll run without modifications at least on Linux (remains to be seen how long it'll take to get the Mac patches into shape). My real problem is marketing: I need a killer app that shows it's easy either to 1. wrap a kickarse Haskell library in a convenient Ruby web app shell 2. speed up a poorly performing Ruby web app I've been badgering the Ruby guys in Sydney that I know on the second point, but either none of them have performance problems, or none of them want to admit it. The first is entirely possible - if you only attack the subset of problems where your runtime is dominated by the database and network latency, language performance is moot. Conversely, if that's your worldview, the other problems that could be attacked won't ever come to mind (to monstrously abuse the Sapir-Whorf hypothesis). So, I'm asking you guys. What are some really nice Haskell libraries or apps that could benefit from being shown off in one of the plethora of slick, mature web frameworks that exist in Ruby? Manuel Chakravarty suggested something with vector operations in order to take advantage of his 'accelerate' library (once it gets a GPU backend, of course), and more generally, something taking advantage of Haskell's support for multicore would be cool. (The standard edition of Ruby is still unicore, I believe.) Parenthetically yours, Mark ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: TxtSushi 0.4.0
Hello Cafe, I've just uploaded TxtSushi 0.4.0 to hackage. TxtSushi is a collection of command line utilities for processing comma-separated and tab-delimited files. I posted details on my blog (along with an advertisement to see if others are interested in hacking TxtSushi): http://blog.keithsheppard.name/2009/10/txtsushi-040.html Best Regards Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] killer app sought
I think having access to the parsec library would be a major plus that you can show off. Eg: you can have a RoR based email web app that uses parsec parsing to figure out which sections of an email thread belong to which author... Best -Keith On Sat, Oct 3, 2009 at 11:08 PM, Mark Wotton mwot...@gmail.com wrote: Hi, I've been writing a little binding from Ruby to Haskell called Hubris (http://github.com/mwotton/Hubris) which I think has some potential both for making Haskell web apps easier to write, and also for bringing the more adventurous Ruby programmers into the Haskell community. Code-wise it's coming along nicely, and once 6.12 is out it'll run without modifications at least on Linux (remains to be seen how long it'll take to get the Mac patches into shape). My real problem is marketing: I need a killer app that shows it's easy either to 1. wrap a kickarse Haskell library in a convenient Ruby web app shell 2. speed up a poorly performing Ruby web app I've been badgering the Ruby guys in Sydney that I know on the second point, but either none of them have performance problems, or none of them want to admit it. The first is entirely possible - if you only attack the subset of problems where your runtime is dominated by the database and network latency, language performance is moot. Conversely, if that's your worldview, the other problems that could be attacked won't ever come to mind (to monstrously abuse the Sapir-Whorf hypothesis). So, I'm asking you guys. What are some really nice Haskell libraries or apps that could benefit from being shown off in one of the plethora of slick, mature web frameworks that exist in Ruby? Manuel Chakravarty suggested something with vector operations in order to take advantage of his 'accelerate' library (once it gets a GPU backend, of course), and more generally, something taking advantage of Haskell's support for multicore would be cool. (The standard edition of Ruby is still unicore, I believe.) Parenthetically yours, Mark ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Examples
This seems to me like the kind of thing hackage maintainers should be giving guidance on (maybe they do already?) so that there is consistency. Sorry if this seems too off base, but here I go anyway... I have used apache IVY for packaging/dependency management in java and I really like the way it works. They have spent a lot of effort figuring out how to deal with complex project dependencies. For example they have organization (eg. com.sun) and project (eg javaSDK) concepts that help to keep the namespace clean. They also have different profiles like test or dist that you can depend on. Maybe it would be worthwhile to poke around ivy's docs and see if we want to pull any of these concepts into cabal/hackage On Mon, Aug 10, 2009 at 10:04 AM, Wolfgang Jeltschg9ks1...@acme.softbase.org wrote: Am Samstag, 8. August 2009 13:29 schrieb Andrew Coppin: As some of you may remember, I recently released a couple of packages on Hackage. I'd like to also release some example programs using these packages, but I'm not sure of the best way to do this. Do I make the example programs part of the package itself? Do I release a seperate package which just contains the example code? Something else entirely? What's the recommendation here? I had to make this decision for Grapefruit, and I decided to put the examples into a separate package named grapefruit-examples. Note that the rest of Grapefruit was already split into several packages with names of the form grapefruit-*. Best wishes, Wolfgang ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell2Xml
Hello Dmitry, I too was looking for something like this and came up empty. I proposed something similar on the haskell_proposals reddit... http://www.reddit.com/r/haskell_proposals/comments/8zhkx/haxb_and_haxws/ ... but I was left with the impression that there isn't much interest. -Keith On Wed, Aug 5, 2009 at 3:49 PM, Dmitry Olshanskyolshansk...@gmail.com wrote: Hello all, I need a convenient tool to generate Haskell types from XML W3C Schema Definition (xsd) and vice versa - generate instances for Haskell ADT's to make corresponding XML. It is just the same that HaXml do with DTD. I need - using XSD - support for unicode - using xml-attributes as far as elements are very desirable - by my opinion TemplateHaskell for generate instances is prefferable than using DrIFT (which used in HaXml) - both possibilities is great of course - generation of xsd by Haskell type is a good feature also and so on... Does this tool exist? Do some articles / thoughts / standards / recomendations about correspondence between XML and Haskell ADT's exist? Best wishes, Dmitry ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] get cabal info for self?
That's perfect. Thanks! On Sat, Jul 11, 2009 at 12:10 AM, Gwern Branwengwe...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Jul 10, 2009 at 11:46 PM, Keith Sheppard wrote: Is there a way for a cabalized program to get its own info. I'm specifically interested in version info. Thanks Keith Sure, via the Paths_* mechanism. For your reference, here's what it looks like for xmonad: module Paths_xmonad ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import Data.Version (Version(..)) import System.Environment (getEnv) version :: Version version = Version {versionBranch = [0,8,1], versionTags = []} bindir, libdir, datadir, libexecdir :: FilePath bindir = /home/gwern/bin/bin libdir = /home/gwern/bin/lib/xmonad-0.8.1/ghc-6.10.2 datadir = /home/gwern/bin/share/xmonad-0.8.1 libexecdir = /home/gwern/bin/libexec getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath getBinDir = catch (getEnv xmonad_bindir) (\_ - return bindir) getLibDir = catch (getEnv xmonad_libdir) (\_ - return libdir) getDataDir = catch (getEnv xmonad_datadir) (\_ - return datadir) getLibexecDir = catch (getEnv xmonad_libexecdir) (\_ - return libexecdir) getDataFileName :: FilePath - IO FilePath getDataFileName name = do dir - getDataDir return (dir ++ / ++ name) So if you wanted the version number 081, you could do something like 'concatMap show $ versionBranch $ version' - -- gwern -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkpYD98ACgkQvpDo5Pfl1oI6gACZATzqwtJgBFhAl/qo0ZPauqhg zBcAnRdHtv5nFzNAo2Z9ulHdW1DxiJBE =XyEM -END PGP SIGNATURE- -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] get cabal info for self?
Is there a way for a cabalized program to get its own info. I'm specifically interested in version info. Thanks Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] On the parallel between java annotations and monads
I see some parallels between Inversion of Control/Dependency Injection frameworks and monads. I would say annotations are tools that are sometimes used for those frameworks, but they are also used for other unrelated things (warning suppression, overriding functions ...) so it may be more clear to focus on IoC and DI instead of annotations. -Keith 2009/7/3 Rafael Almeida almeida...@gmail.com: Hello, After an extensive search (5 minutes googling) I could not find any comparison between Java annotations (or Python annotations for that matter) and Monads. I think they are similar in various aspects and I want to discuss them here. I'm sure several of you have experience with Java programming and its annotation system. At first they seem like an extension to the typing system, by using annotations a single variable or method may have more than one type: the real type and all the annotations types. The way you declare them is not important for this discussion, but assume that you've created the annotations GreaterThanFive and LessThanTwenty, you could annotate a method like this (let's forget about all the class verbosity for a while): �...@greaterthanfive @LessThanTwenty int doYourThing(); You could than use reflection to read those annotations and you could check if the returned integer is in the correct range. You could even make the compiler generate code that will do that checking automatically for you. Even though that was my first impression of them, that's not really how they are used in practice (at least the practice that I have experimented). People use them to implement Monad-like features to the language. Actually, you can forget monad and think of computation containers. On an EJB environment there's something called a container and it will do all sorts of computations when you call an annotated method or when you create a new annotated class. For instance, if, inside of an entity bean, you annotate a variable like this: �...@column(name = NAME) private String name; then, when you create a method like so: public String getName() { return name; } that name is actually something retrieved from the database, even though, it looks just like something in memory. As far as I know the interaction with monads for handling databases is not very different. There are other annotations which allows the container to inject some object on a variable, such as: �...@persistencecontext private EntityManager entityManager; now you won't even create an EntityManager instance, but will use the object living inside the container. I compare that to getting a value from an State Monad. Like there, you'll do some computations using entityManager, but it will ultimately be returned to the container. While each computational container in Haskell is very rigid and well defined, in java there's nothing rigorous about the annotation. However, quite often the annotations in Java are used in a manner similar to the implementation of a Monad in Java. []'s Rafael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] download, download-curl ...
Hello Cafe, I'm looking to make it possible for people to use urls directly in my haskell program (TxtSushi) and I'd like your suggestions if you have any. I really like the API's for download and download-curl, but I'm wondering what the practical differences are between the two? Is download-curl a replacement for download? Will it build OK on any platform or do I have to use something like the HTTP library if I want it to work for people with Windows? (I really like the fact that the download APIs support FTP too though) Thank You Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Slightly off-topic: Lambda calculus
forgot to cc the cafe :-) On Sun, Jun 21, 2009 at 1:08 PM, Keith Sheppardkeiths...@gmail.com wrote: hmm, it's been a while but... i think this infinite loop with a free variable would cause collision (\a . a a) (\b . b b d) On Sun, Jun 21, 2009 at 12:53 PM, Andrew Coppinandrewcop...@btinternet.com wrote: OK, so I'm guessing there might be one or two (!) people around here who know something about the Lambda calculus. I've written a simple interpretter that takes any valid Lambda expression and performs as many beta reductions as possible. When the input is first received, all the variables are renamed to be unique. Question: Does this guarantee that the reduction sequence will never contain name collisions? I have a sinking feeling that it does not. However, I can find no counter-example as yet. If somebody here can provide either a proof or a counter-example, that would be helpful. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Slightly off-topic: Lambda calculus
scratch that... it's completely wrong On Sun, Jun 21, 2009 at 1:09 PM, Keith Sheppardkeiths...@gmail.com wrote: forgot to cc the cafe :-) On Sun, Jun 21, 2009 at 1:08 PM, Keith Sheppardkeiths...@gmail.com wrote: hmm, it's been a while but... i think this infinite loop with a free variable would cause collision (\a . a a) (\b . b b d) On Sun, Jun 21, 2009 at 12:53 PM, Andrew Coppinandrewcop...@btinternet.com wrote: OK, so I'm guessing there might be one or two (!) people around here who know something about the Lambda calculus. I've written a simple interpretter that takes any valid Lambda expression and performs as many beta reductions as possible. When the input is first received, all the variables are renamed to be unique. Question: Does this guarantee that the reduction sequence will never contain name collisions? I have a sinking feeling that it does not. However, I can find no counter-example as yet. If somebody here can provide either a proof or a counter-example, that would be helpful. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name -- keithsheppard.name -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
OK, I think I went off on a tangent that isn't very useful anyway thanks -Keith On Wed, Jun 17, 2009 at 6:32 PM, Lennart Augustssonlenn...@augustsson.net wrote: The creators of Haskell didn't pick any particular representation for numbers. (Well, literals are kind of In..tegers.) You can pick what types you make instances of Num. Some of them are lazy, some of them are strict. On Wed, Jun 17, 2009 at 11:05 PM, Keith Sheppardkeiths...@gmail.com wrote: In lambda calculus numbers are just functions and you evaluate them just like any other function. Haskell could have chosen the same representation for numbers and all evaluation on numbers would be lazy (assuming normal order evaluation). I think that would have been the Purist Lazy way to go. That is not the way the creators of Haskell designed language though... am i missing something? On Wed, Jun 17, 2009 at 4:05 PM, Lennart Augustssonlenn...@augustsson.net wrote: What do you mean by literals are strict? Strictness is a semantic property of functions, and while literals can be overloaded to be functions I don't know what you mean. On Wed, Jun 17, 2009 at 9:50 PM, Keith Sheppardkeiths...@gmail.com wrote: Haskell's numeric literals are strict. You wouldn't want that to change right? It seems to me that having sum and product be strict is consistent with this. -Keith On Wed, Jun 17, 2009 at 11:15 AM, Thomas Davietom.da...@gmail.com wrote: On 17 Jun 2009, at 13:32, Yitzchak Gale wrote: Henk-Jan van Tuyl wrote: reverse maximum minimum Oh yes, please fix those also! import Prelude.Strict? Honestly, these functions are ones that I've *deffinately* used lazy versions of, in fact, in the cases of minimum/maximum I've even used ones that are super-lazy and parallel using unamb. It would be extremely odd to randomly decide most people would want this to be strict based on no knowledge of what they're actually doing. Instead, why don't we stand by the fact that haskell is a lazy language, and that the functions we get by default are lazy, and then write a strict prelude as I suggest above to complement the lazy version. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
I don't think anyone is calling it useless at this point. I could not see a use for it initially and it was quickly pointed out that there are in fact some infrequent use cases where a lazy sum is the best option. I think this is more a discussion about principle of least surprise or which use case is most frequent. I am pretty new to haskell so I may just be missing something basic (I welcome an explaination for why I am looking at this the wrong way), but if your argument is on consistency then doesn't it follow that number litterals should be defined using a church encoding or some equivalent? -Keith On Thu, Jun 18, 2009 at 7:53 AM, Thomas Davietom.da...@gmail.com wrote: No, I think it's extremely useful. It highlights that numbers can both be lazy and strict, and that the so called useless lazy sum, is in fact, useful. Bob On 18 Jun 2009, at 13:29, Keith Sheppard wrote: OK, I think I went off on a tangent that isn't very useful anyway thanks -Keith On Wed, Jun 17, 2009 at 6:32 PM, Lennart Augustssonlenn...@augustsson.net wrote: The creators of Haskell didn't pick any particular representation for numbers. (Well, literals are kind of In..tegers.) You can pick what types you make instances of Num. Some of them are lazy, some of them are strict. On Wed, Jun 17, 2009 at 11:05 PM, Keith Sheppardkeiths...@gmail.com wrote: In lambda calculus numbers are just functions and you evaluate them just like any other function. Haskell could have chosen the same representation for numbers and all evaluation on numbers would be lazy (assuming normal order evaluation). I think that would have been the Purist Lazy way to go. That is not the way the creators of Haskell designed language though... am i missing something? On Wed, Jun 17, 2009 at 4:05 PM, Lennart Augustssonlenn...@augustsson.net wrote: What do you mean by literals are strict? Strictness is a semantic property of functions, and while literals can be overloaded to be functions I don't know what you mean. On Wed, Jun 17, 2009 at 9:50 PM, Keith Sheppardkeiths...@gmail.com wrote: Haskell's numeric literals are strict. You wouldn't want that to change right? It seems to me that having sum and product be strict is consistent with this. -Keith On Wed, Jun 17, 2009 at 11:15 AM, Thomas Davietom.da...@gmail.com wrote: On 17 Jun 2009, at 13:32, Yitzchak Gale wrote: Henk-Jan van Tuyl wrote: reverse maximum minimum Oh yes, please fix those also! import Prelude.Strict? Honestly, these functions are ones that I've *deffinately* used lazy versions of, in fact, in the cases of minimum/maximum I've even used ones that are super-lazy and parallel using unamb. It would be extremely odd to randomly decide most people would want this to be strict based on no knowledge of what they're actually doing. Instead, why don't we stand by the fact that haskell is a lazy language, and that the functions we get by default are lazy, and then write a strict prelude as I suggest above to complement the lazy version. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
Haskell's numeric literals are strict. You wouldn't want that to change right? It seems to me that having sum and product be strict is consistent with this. -Keith On Wed, Jun 17, 2009 at 11:15 AM, Thomas Davietom.da...@gmail.com wrote: On 17 Jun 2009, at 13:32, Yitzchak Gale wrote: Henk-Jan van Tuyl wrote: reverse maximum minimum Oh yes, please fix those also! import Prelude.Strict? Honestly, these functions are ones that I've *deffinately* used lazy versions of, in fact, in the cases of minimum/maximum I've even used ones that are super-lazy and parallel using unamb. It would be extremely odd to randomly decide most people would want this to be strict based on no knowledge of what they're actually doing. Instead, why don't we stand by the fact that haskell is a lazy language, and that the functions we get by default are lazy, and then write a strict prelude as I suggest above to complement the lazy version. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
In lambda calculus numbers are just functions and you evaluate them just like any other function. Haskell could have chosen the same representation for numbers and all evaluation on numbers would be lazy (assuming normal order evaluation). I think that would have been the Purist Lazy way to go. That is not the way the creators of Haskell designed language though... am i missing something? On Wed, Jun 17, 2009 at 4:05 PM, Lennart Augustssonlenn...@augustsson.net wrote: What do you mean by literals are strict? Strictness is a semantic property of functions, and while literals can be overloaded to be functions I don't know what you mean. On Wed, Jun 17, 2009 at 9:50 PM, Keith Sheppardkeiths...@gmail.com wrote: Haskell's numeric literals are strict. You wouldn't want that to change right? It seems to me that having sum and product be strict is consistent with this. -Keith On Wed, Jun 17, 2009 at 11:15 AM, Thomas Davietom.da...@gmail.com wrote: On 17 Jun 2009, at 13:32, Yitzchak Gale wrote: Henk-Jan van Tuyl wrote: reverse maximum minimum Oh yes, please fix those also! import Prelude.Strict? Honestly, these functions are ones that I've *deffinately* used lazy versions of, in fact, in the cases of minimum/maximum I've even used ones that are super-lazy and parallel using unamb. It would be extremely odd to randomly decide most people would want this to be strict based on no knowledge of what they're actually doing. Instead, why don't we stand by the fact that haskell is a lazy language, and that the functions we get by default are lazy, and then write a strict prelude as I suggest above to complement the lazy version. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
The answer is sometimes (only if you use an optimize flag): ke...@sugarglider:~/temp/ cat sumtest.hs main = putStrLn . show . sum $ [0 .. 100] ke...@sugarglider:~/temp/ ghc --make sumtest.hs [1 of 1] Compiling Main ( sumtest.hs, sumtest.o ) Linking sumtest ... ke...@sugarglider:~/temp/ ./sumtest Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize' to increase it. ke...@sugarglider:~/temp/ rm sumtest.hi sumtest.o sumtest ke...@sugarglider:~/temp/ ghc --make -O2 sumtest.hs [1 of 1] Compiling Main ( sumtest.hs, sumtest.o ) Linking sumtest ... ke...@sugarglider:~/temp/ ./sumtest 5050 ke...@sugarglider:~/temp/ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.1 But since hackage warns against using these flags when you upload packages I would think that most libraries would not be using a strict version of sum. On Mon, Jun 15, 2009 at 11:14 AM, Don Stewartd...@galois.com wrote: keithshep: Is there any reason that sum isn't strict? I can't think of any case where that is a good thing. Prelude sum [0 .. 100] *** Exception: stack overflow It is strict when subject to strictness analysis (try compiling it). -- Don -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
I just realized... that was a statement not a question :-) anyway, thanks Keith On Mon, Jun 15, 2009 at 11:14 AM, Don Stewartd...@galois.com wrote: keithshep: Is there any reason that sum isn't strict? I can't think of any case where that is a good thing. Prelude sum [0 .. 100] *** Exception: stack overflow It is strict when subject to strictness analysis (try compiling it). -- Don -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] curious about sum
Is there any reason that sum isn't strict? I can't think of any case where that is a good thing. Prelude sum [0 .. 100] *** Exception: stack overflow -Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
That's an interesting example. I guess a lazy number system like that would work nicely for Deniz's use case. On Sat, Jun 13, 2009 at 10:26 AM, Stephan Friedrichsdeduktionstheo...@web.de wrote: Jochem Berndsen wrote: Keith Sheppard wrote: Is there any reason that sum isn't strict? I can't think of any case where that is a good thing. Prelude sum [0 .. 100] *** Exception: stack overflow It is useful if the (+) is nonstrict; although I cannot think of any useful mathematical structure where (+) would be nonstrict. What about some numeric representations? type MyNum = [()] instance Num MyNum where (+) = (++) Regards, Stephan -- Früher hieß es ja: Ich denke, also bin ich. Heute weiß man: Es geht auch so. - Dieter Nuhr ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Change value of a variable
I guess the short answer is that it is not possible. 'x' is immutable and if you want a different value than 'x' that expression has to be given a different name like: let x=1 y=x+2 ... But I'm not sure if that helps you. Haskell does things very differently than the imperative languages and forces you to think differently about how to solve problems. When I started learning haskell I found that I had to think more about composing/decomposing expressions and less about sequencing actions and side effects like you do in most of the more popular languages (I really have come to prefer the Haskell way). I think we may be able to give a more helpful answer if give a more high level algorithm/use case... why do you want to change the value of x -Keith On Sun, Jun 7, 2009 at 1:41 PM, ptrashptr...@web.de wrote: Hi, how can I change the value of a variable. let x = 1 x = x + 2 First I set the value of x to 1. Then I want to increase it by 2. This way doesn't work, because I think it is a infinite expression. Is there a way to change the value? -- View this message in context: http://www.nabble.com/Change-value-of-a-variable-tp23913404p23913404.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: TxtSushi 0.1
Hello, I just released TxtSushi 0.2 with the following updates: 1) Improved type coercion. Some of the rules I was using before did not make sense. At some point I will document what the rules are. 2) Added some extra functions/operators including a regex matcher. Here is the full list: SUBSTRING, UPPER, LOWER, TRIM, *, /, +, - (binary and unary), =, (not equal test), , =, , =, AND, OR, || (string concatination), =~ (regex matching) I expect updates to be pretty frequent (at least pre-1.0) so in order to avoid spamming you all with my announcements I'll just announce major updates from now on and if you want to follow progress more closely I'll post all updates to this feed. http://blog.keithsheppard.name/feeds/posts/default/-/TxtSushi Thanks, Keith On Sun, May 17, 2009 at 11:07 AM, Keith Sheppard keiths...@gmail.com wrote: Hello Haskell Cafe I have released the first version of TxtSushi which is a collection of command line utils (written in haskell of course) for processing tab-delimited and CSV files. It includes a util for doing SQL SELECTs on flat files. This is my first haskell project and feedback of all kinds is appreciated. Home Page: http://www.keithsheppard.name/txt-sushi Darcs Repository: http://patch-tag.com/r/txt-sushi/home Issue Tracking: http://code.google.com/p/txt-sushi I would like to say thanks to the haskell-beginners contributors, the author of Learn you a Haskell and the author of the parsec library all of which were very helpful. Regards Keith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: TxtSushi 0.1
Hello Haskell Cafe I have released the first version of TxtSushi which is a collection of command line utils (written in haskell of course) for processing tab-delimited and CSV files. It includes a util for doing SQL SELECTs on flat files. This is my first haskell project and feedback of all kinds is appreciated. Home Page: http://www.keithsheppard.name/txt-sushi Darcs Repository: http://patch-tag.com/r/txt-sushi/home Issue Tracking: http://code.google.com/p/txt-sushi I would like to say thanks to the haskell-beginners contributors, the author of Learn you a Haskell and the author of the parsec library all of which were very helpful. Regards Keith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: TxtSushi 0.1
Thanks for the encouraging reply! By the way, I was part way through writing my own code for external sorting which I don't actually use yet except from some test executable (joincol.hs). I'm very glad to see that there is already a library that does this though, so in my next version I will dump the custom code and use the external sort package. Also I will look into making the switch to ByteStrings. Thanks Keith On Sun, May 17, 2009 at 11:53 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: By the way: As I see from the sources, your code uses external sort? But using String's much defeats the purpose of it, anyway, because their performance is so bad that if you feed your program a file that is larger than can be sorted in memory, sorting it externally using String's will anyway take much more time then you are likely to be comfortable waiting. You should consider switching to ByteString's, and beware memory leaks. 2009/5/17 Keith Sheppard keiths...@gmail.com: Hello Haskell Cafe I have released the first version of TxtSushi which is a collection of command line utils (written in haskell of course) for processing tab-delimited and CSV files. It includes a util for doing SQL SELECTs on flat files. This is my first haskell project and feedback of all kinds is appreciated. Home Page: http://www.keithsheppard.name/txt-sushi Darcs Repository: http://patch-tag.com/r/txt-sushi/home Issue Tracking: http://code.google.com/p/txt-sushi I would like to say thanks to the haskell-beginners contributors, the author of Learn you a Haskell and the author of the parsec library all of which were very helpful. Regards Keith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Eugene Kirpichov Web IR developer, market.yandex.ru ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: TxtSushi 0.1
Thanks! Good advice, I will do that. On Sun, May 17, 2009 at 11:49 AM, Jochem Berndsen joc...@functor.nl wrote: Keith Sheppard wrote: I have released the first version of TxtSushi which is a collection of command line utils (written in haskell of course) for processing tab-delimited and CSV files. It includes a util for doing SQL SELECTs on flat files. This is my first haskell project and feedback of all kinds is appreciated. Home Page: http://www.keithsheppard.name/txt-sushi Darcs Repository: http://patch-tag.com/r/txt-sushi/home Issue Tracking: http://code.google.com/p/txt-sushi Nice! Have you considered putting this on Hackage? That is most useful for users of your code. I saw you already cabalized the code, so it should suffice to upload it. Cheers -- Jochem Berndsen | joc...@functor.nl GPG: 0xE6FABFAB ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Incremental array updates
I'm still learning haskell, so I may be missing something pretty obvious, but isn't this the kind of thing that the diff array types were created for. http://en.wikibooks.org/wiki/Haskell/Hierarchical_libraries/Arrays#DiffArray_.28module_Data.Array.Diff.29 -Keith On Thu, Feb 26, 2009 at 06:45:27PM +, Ross Paterson wrote: Yes, bucketing problems like this are a common case that the standard functions cannot handle. Perhaps the libraries need a canned solution. Stratch that -- as Bulat points out, accumArray is such a canned solution. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe