Re: [Haskell-cafe] Theoretical question: are side effects necessary?
Ryan Ingram ryani.s...@gmail.com writes: You can emulate mutation with at most O(log(n)) penalty using a map. Given that memory is of fixed size, log2(n) = 64, so for real-world programs this becomes O(1). I'm not sure assuming fixed size memory is a good idea for a theoretical discussion - your computer is no longer Turing complete, and one type of implementation will likely be able to fit a different set of programs in the given memory than the oher. Another nit: this is O(log(n)) of working set, not input/problem size. But I guess any algorithm must be at least O(working set size), so it's still a log factor (or less) of the algorithmic complexity. -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] We *have* been accepted into the Google Summer of Code
Edward Kmett wrote: Just to clarify, since I've been getting a ton of emails on the topic, we *have* been accepted to the Google Summer of Code this year. The list on their site is still updating, and we should appear there shortly. Just for reference, here the direct link that is now online: http://www.google-melange.com/gsoc/org/google/gsoc2012/haskell Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Regular Expression with PCRE
On Fri, Mar 16, 2012 at 20:17, Carter Tazio Schonwald carter.schonw...@gmail.com wrote: Basically this applies in your case because recognizing if a sequence of characters is in a comment block or not for HTML is likely not expressible using regexes. There may be a way for a very controlled restricted subset of HTML, but it might require some complex regexes. Comments in particular are one of the places where SGML said one thing, the HTML spec which was loosely derived from SGML said a different thing, and most browsers did (occasionally mutually incompatible) something not quite either, with the result that they can be *very* difficult to get right in the general case. HTML is not at all easy to deal with. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Theoretical question: are side effects necessary?
Quoth Jeff Shaw shawj...@msu.edu, ... I'm thinking that side effects are really only necessary because Haskell programs expect to mutate the state of a computer outside of the haskell program. I'm not a computer scientist, but in English, side effect is an effect that accompanies some other effect. E.g., you may take an antihistamine to relieve hay fever, and experience a side effect of drowsiness. Let's call the first an `intended effect'? Then in the matter of the computer outside the Haskell program - which is intended effect, and which is side effect? I'd have said, side effects would be like memory paging, deferred resource access for other processes, etc.? Some programs might leave behind temporary files ... I hope the answer is not that in computer science we regard all effects as side effects because the ideal computer program simply exists without consequence. Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Prettier pretty-printing of data types?
Hi all, I've got a question that pertains to any of these identify-region, parse, make-expandable approaches. The main use I'd like to use the trick for (esp. Chris's Emacs version) is to deal with large intermediate compiler ASTs. But if a compiler produces a long stream of output to stdout, with certain Show-produced ASTs embedded in it, what's the most expedient way to identify those regions that can be collapsed in the buffer and interactively expanded? - The user could define heuristics for identifying those regions in a particular stream of output - If the source is available, the compiler could be tweaked to obey a protocol, putting delimiters around collapsable output (possibly non-printing control sequences??) Or is there another hack I'm not thinking of? What's easiest? -Ryan On Wed, Mar 14, 2012 at 5:01 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Christopher Done wrote: Maybe an Emacs script to expand the nodes nicely: http://www.youtube.com/watch?**v=6ofEZQ7XoEAhttp://www.youtube.com/watch?v=6ofEZQ7XoEAI don't find mere pretty printing that useful compared to the “expanding” paradigm I'm used to in Chrome and Firebug. Great demo video. My recent GSoC project suggestions aims to make that available to non-Emacsers, via the web browser. http://hackage.haskell.org/**trac/summer-of-code/ticket/**1609http://hackage.haskell.org/trac/summer-of-code/ticket/1609 Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com __**_ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://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] Prettier pretty-printing of data types?
On Sat, Mar 17, 2012 at 08:55, Ryan Newton rrnew...@gmail.com wrote: - If the source is available, the compiler could be tweaked to obey a protocol, putting delimiters around collapsable output (possibly non-printing control sequences??) I believe both emacs and vim have folding submodes which operate based on comments containing {{{ / }}} to bracket foldable regions. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Theoretical question: are side effects necessary?
On Sat, Mar 17, 2012 at 5:41 AM, Donn Cave d...@avvanta.com wrote: I hope the answer is not that in computer science we regard all effects as side effects because the ideal computer program simply exists without consequence. The answer is that side effects has become something of a figure of speech, and now has a specialized meaning in programming languages. When we're talking about different uses of the word function in programming languages, side effects refer to any effect other than evaluating to some result when applied to some argument. For example, in languages like C, printf takes some arguments, and returns an int. When viewed as just a function, that's all there is to it; functions exist to take arguments and produce return values. But C extends the definition of a function to include additional effects, like making Hello world appear on a nearby computer screen. Because those effects are aside from the taking of arguments and returning of values that functions exist to do, they are side effects... even though in the specific case of printf, the effect is the main goal and everyone ignores the return value, still for functions in general, any effects outside of producing a resulting value from its arguments are side effects. I suppose Haskell doesn't have side effects in that sense, since its effectful actions aren't confused with functions. (Well, except from silly examples like the CPU gives off heat or FFI/unsafe stuff like unsafePerformIO.) So maybe we should ideally call them just effects. But since so many other languages use functions to describe effectful actions, the term has stuck. So pretty much when someone talks about side effects, even in Haskell, they means stateful interaction with the world. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Prettier pretty-printing of data types?
Ah, great! I gave it one very brief try with this mode: http://www.emacswiki.org/emacs/FoldingMode (folding-add-to-marks-list 'shell-mode #{{{ #}}} nil t) But I just got not on a fold. Maybe it doesn't compose with shell mode? It might be easier just to add similar functionality to a wrapper function around Chris's folder/expander. -Ryan On Sat, Mar 17, 2012 at 9:10 AM, Brandon Allbery allber...@gmail.comwrote: On Sat, Mar 17, 2012 at 08:55, Ryan Newton rrnew...@gmail.com wrote: - If the source is available, the compiler could be tweaked to obey a protocol, putting delimiters around collapsable output (possibly non-printing control sequences??) I believe both emacs and vim have folding submodes which operate based on comments containing {{{ / }}} to bracket foldable regions. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Open-source projects for beginning Haskell students?
Brent Yorgey wrote: I am currently teaching a half-credit introductory Haskell class for undergraduates. This is the second time I've taught it. The last time, for their final project I gave them the option of contributing to an open-source project; a couple groups took me up on it and I think it ended up being a modest success. So I'd like to do it again this time around, and am looking for particular projects I can suggest to them. Do you have an open-source project with a few well-specified tasks that a relative beginner (see below) could reasonably make a contribution towards in the space of about four weeks? I'm aware that most tasks don't fit that profile, but even complex projects usually have a few simple-ish tasks that haven't yet been done just because no one has gotten around to it yet. Finding a suitable project seems tricky to me as most real-world projects usually involve at least one nasty corner like interfacing with a C library, which is usually too hard for someone who just became comfortable with the traditional list origami. With that caveat, I do have a small task that may be suitable and that is useful to me in the context of my reactive-banana library and my yet undisclosed tomato-rubato project. The task is to implement a small audio synthesizer in Haskell. Of course, implementing high-performance audio synthesis is too challenging a task for a Haskell beginner, but there is one particular approach that I would like to see performance measurements of. More specifically, the idea is the following: 1a. Implement a handful of combinators for generating audio as a lazy list of samples type Audio = [Sample] 1b. Get it out of the speakers. (I can find a library for that.) This will be slooow. 2. Implement the same handful of combinators for a different representation, namely a lazy list of memory blocks with 64 samples each type Block = Data.Vector.Vector -- 64 samples type Audio = [Block] In other words, each block is filled in an aggressively optimized inner loop while the blocks are shuffled around with ordinary Haskell functions. 3. Do performance measurements on 2 and test whether it can be run in real-time. So, the task does involve an external library and some knowledge about GHC's optimization, but hopefully nothing too fancy. How is this task useful for me? If the performance is good enough, I can replace the lazy lists with Event / Behavior from reactive-banana , giving a real-time audio synthesizer in the style of functional reactive programming. If it doesn't work out, then the students had a fun project to work on, which is just as well. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A GSoC Proposal
I have a proposal for a GSoC project that I wish to undertake. Is this a good place for me to begin discussing it? -- KitB ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A GSoC Proposal
On Sat, Mar 17, 2012 at 8:21 AM, Kit Barnes k...@ninjalith.com wrote: I have a proposal for a GSoC project that I wish to undertake. Is this a good place for me to begin discussing it? Yes! -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Open-source projects for beginning Haskell students?
On Sat, Mar 17, 2012 at 11:01 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: The task is to implement a small audio synthesizer in Haskell. seriously?!?! i'm not in his class, but i'm game! i learn better when i'm working on something interesting, and i want to make my (currently pretty pathetic) haskell better and i *LOOOE* audio! a haskell-based synth (or series of synths) would be really spiffy! what do i have to know / learn / do? justin -- * The wise man said: Never argue with an idiot. They bring you down to their level and beat you with experience. * As a programmer, it is your job to put yourself out of business. What you do today can be automated tomorrow. ~Doug McIlroy No snowflake in an avalanche ever feels responsible. --- CFO: “What happens if we train people and they leave?” CTO: “What if we don’t and they stay?” ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Prettier pretty-printing of data types?
On 17 March 2012 14:10, Brandon Allbery allber...@gmail.com wrote: On Sat, Mar 17, 2012 at 08:55, Ryan Newton rrnew...@gmail.com wrote: If the source is available, the compiler could be tweaked to obey a protocol, putting delimiters around collapsable output (possibly non-printing control sequences??) I believe both emacs and vim have folding submodes which operate based on comments containing {{{ / }}} to bracket foldable regions. It's also easy in vim (and probably emacs too) to create folds from syntax, which would work well with pretty-show's output. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Theoretical question: are side effects necessary?
Apparently on such solid ground that you hinder their critical thinking skills by answering for them. On Fri, Mar 16, 2012 at 9:24 PM, Donn Cave d...@avvanta.com wrote: Quoth KC kc1...@gmail.com, On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. Or software engineers might be thinking of purity in the same way. I personally hope I think of purity in a way that's of some practical use in terms of Haskell programs, and I would hope software engineers in general would do likewise. From that perspective, it seems to me that M. Karczmarczuk is on pretty solid ground. Donn -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] In Haskell, because of the fine layers of abstraction that are possible, it pays to hone one's critical thinking skills.
-- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] In an imperative language, commands fulling memory cells is easy, but gives the false impression that S/W engineering is easy.
-- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] In Haskell, because of the fine layers of abstraction that are possible, it pays to hone one's critical thinking skills.
Are you creating these posts by accident or what's the point of them? They are completely devoid of a message body. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Theoretical question: are side effects necessary?
KC comments the posting of Donn Cave referring to the soundness of some potential approach of software engineers: Apparently on such solid ground that you hinder their critical thinking skills by answering for them Monsieur KC, do you want to discuss, or just to be cute? In both cases, begin by signing your posts. I will not discuss with an anonymous, and concerning your question about referential transparency, I permit myself to send you to some standard literature. Over. == Chris Smith: When we're talking about different uses of the word function in programming languages, side effects refer to any effect other than evaluating to some result when applied to some argument. For example, in languages like C, printf takes some arguments, and returns an int. When viewed as just a function, that's all there is to it; functions exist to take arguments and produce return values. But C extends the definition of a function to include additional effects, like making Hello world appear on a nearby computer screen. ... And here I disagree. If printf, or whatever explodes an atomic bomb, this is not a side effect. If a procedure executes such a statement: x = x+1, or a[1]=a[2], it IS. And even that, not always ! In Clean, which is as pure as Haskell, there are unique access variables, and it is possible to write (+/-...) # myFile = write myFile Hello World And the point is that WHATEVER happens to the outer world, and the computer file system in particular, there are no side effects within the program. The # construction is a temporal, sequential part of a purely functional expression, exactly as a monadic chain in Haskell, disguised as a do block. There are two distinct file objects, the previous, and the next one, which happen to share the same name, because *the type system* prevents that a computing block refers to both. Either the old, or the new. This is my philosophy. If somebody disagrees, that's alright. Jerzy Karczmarczuk ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Theoretical question: are side effects necessary?
Quoth Chris Smith cdsm...@gmail.com, ... The answer is that side effects has become something of a figure of speech, and now has a specialized meaning in programming languages. When we're talking about different uses of the word function in programming languages, side effects refer to any effect other than evaluating to some result when applied to some argument. For example, in languages like C, printf takes some arguments, and returns an int. When viewed as just a function, that's all there is to it; functions exist to take arguments and produce return values. I'm surprised by the use of function as a unit. I would have expected expression or something, but maybe that isn't semantically interesting as long as one can't exist independent of the other. ... But C extends the definition of a function to include additional effects, like making Hello world appear on a nearby computer screen. Because those effects are aside from the taking of arguments and returning of values that functions exist to do, they are side effects... even though in the specific case of printf, the effect is the main goal and everyone ignores the return value, still for functions in general, any effects outside of producing a resulting value from its arguments are side effects. If that's so, it's unfortunate. It would have been more profitable to confine the application of this term (side effect) to the context of the program, where it 1) makes sense in English, and 2) applies to a programming device that has always been of some interest. I have a little trouble defending this point of view because there's some overlap, inasmuch as the program may also retrieve values via external I/O. And Haskell provides writeIORef/readIORef as a convenient way to demonstrate that as a technical side effect without resorting to actual I/O. Still, the use of I/O and similar techniques to create a side effect are interesting as such, and my point is that if we call every I/O a side effect, the term loses its value as a way to describe this programming feature. Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] We *have* been accepted into the Google Summer of Code
Heinrich Apfelmus apfel...@quantentunnel.de wrote: Just for reference, here the direct link that is now online: http://www.google-melange.com/gsoc/org/google/gsoc2012/haskell How up-to-date/relevant are the projects in the ideas page? http://hackage.haskell.org/trac/summer-of-code/report/1 (For example, I believe build multiple Cabal packages in parallel is a successful project from last year's summer of code.) Also, why is Mentor: not-accepted for many (all?) of them? -- the lyf so short, the craft so long to lerne. -- Chaucer. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] In Haskell, because of the fine layers of abstraction that are possible, it pays to hone one's critical thinking skills.
On Sat, Mar 17, 2012 at 05:40:56PM +0100, Christopher Done wrote: Are you creating these posts by accident or what's the point of them? They are completely devoid of a message body. KC: It's not customary to have any information in the subject that is not present in elaborated form in the message body. This sort of posting is more common on forums, where misguided individuals ask full questions in thread titles with empty bodies or n/t markings. It's in my eyes very bad form to try to inflict a foreign style onto a medium that has some deeply ingrained and _working_ guidelines (no top posting, replies in-line, body contains all information). -- Lars Viklund | z...@acc.umu.se ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] In an imperative language, commands fulling memory cells is easy, but gives the false impression that S/W engineering is easy.
This mailing list is not Twitter. Please stop sending emails without meaningful content. On Mar 17, 2012 12:42 PM, KC kc1...@gmail.com wrote: -- -- Regards, KC ___ 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] In Haskell, because of the fine layers of abstraction that are possible, it pays to hone one's critical thinking skills.
On Sat, Mar 17, 2012 at 16:30, Lars Viklund z...@acc.umu.se wrote: On Sat, Mar 17, 2012 at 05:40:56PM +0100, Christopher Done wrote: Are you creating these posts by accident or what's the point of them? They are completely devoid of a message body. KC: It's not customary to have any information in the subject that is not present in elaborated form in the message body. I think KC is simply unfamiliar with mail clients, and is putting what is intended to be the body in the subject line. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] In Haskell, because of the fine layers of abstraction that are possible, it pays to hone one's critical thinking skills.
On 17 March 2012 22:09, Brandon Allbery allber...@gmail.com wrote: I think KC is simply unfamiliar with mail clients, and is putting what is intended to be the body in the subject line. Possibly. If that's the case I'm sorry KC if any offense was caused with my blunt words. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] In an imperative language, commands fulling memory cells is easy, but gives the false impression that S/W engineering is easy.
The messages are replies to messages on this list; I think it's just a simple smartphone subject/message mixup Tom On Mar 17, 2012 4:44 PM, Jake McArthur jake.mcart...@gmail.com wrote: This mailing list is not Twitter. Please stop sending emails without meaningful content. On Mar 17, 2012 12:42 PM, KC kc1...@gmail.com wrote: -- -- Regards, KC ___ 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] cabal-install problem with alex dependency in bytestring-lexing
On Mar 16, 2012 3:12 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 17 March 2012 09:02, Erik de Castro Lopo mle...@mega-nerd.com wrote: Ivan Lazar Miljenovic wrote: One trivial solution is to assume ~/.cabal/bin is on the PATH and to ignore system-wide packages, which I think is even *more* sub-optimal (why install a new version of alex when it's already available?). The tool should only install alex in ~/.cabal/bin if alex is not already available. So how does it know whether the *correct version* is available? Add --version parsers for every single possible build-tool to cabal-install? That is (probably) how it knows that the necessary version of alex is not available. There actually is a standard format for checking version numbers of the core haskell build tools: --numeric-version produces output that is easily parsed (and matches the default parser for cabal Program values). I'm not at a computer to check alex specifically right now, but I'm fairly certain it is one of the builtin Programs that cabal can check. (you can also write your own, and put them in setup.hs if you need a special build tool.) There is, of course, nothing that says ask the build tools are going to be available on hackage (or even in haskell). I'm not sure how to fix this, really. We could make the build tools section produce more detailed instructions for installing missing tools in the case that cabal can't install them. -Rogan -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com http://IvanMiljenovic.wordpress.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