Re: [Haskell-cafe] [ANN] Cumino 0.2 - Now supports pretty indentation through stylish-haskell
On Wed, Sep 12, 2012 at 01:03:49PM +, Alfredo Di Napoli wrote: Hi everyone, in case you have missed it, I've released a Vim plugin called Cumino: http://adinapoli.github.com/cumino/ It does one simple thing: It allows communication between Vim and tmux, in particular to a ghci session. With Cumino you can fire-up Vim, load a ghci session and interact with it with only few keystrokes. The plugin also supports visual selection: you can select for example a function (even with all its signature!) and you can send it to ghci. The visual selection supports imports, custom types and typeclasses. It's a simple idea but so damn useful, imho. This release also adds the possibility to prettify the code using the excellent stylish-haskell: select a snippet, simply indent in the usual way ( = ) and voilà, now your code is indented! Feedback are highly appreciated, as well as contributions. There are still some issues with some terminals (for example urxvt does not work right now) but the plugin has been tested against gnome-terminal, xterm and mlterm. I'll post in reddit too for completeness! Nice bridge between vim and tmux! Would you mind add supporting for `urxvtc'? urxvtc's -e option is followed by a list of options instead of a string. urxvtc -e sh -c 'echo a' xterm -e echo a ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Analysing music
a somewhat random sample of work done in this direction: http://arts.ucsc.edu/faculty/cope/experiments.htm On Thu, 5 Jun 2008, Achim Schneider wrote: The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise naturally. The rationale is that if it's Bach, it's harmonious but not respecting any kind of usual chord progression. So far, I got (a bit confused around the edges): getMid mf = do mid - MidiLoad.fromFile mf return $ MidiRead.retrieveTracks mid toMelody :: MidiMusic.T - StdMelody.T toMelody = Music.mapNote f where f note = let body = MidiMusic.body note in Melody.Note StdMelody.na (MidiMusic.pitch body) main = do args - Env.getArgs let mf:[] = args m - getMid mf putStr $ Format.prettyMelody $ Optimise.all $ Music.chord $ map (\m - Music.line $ map toMelody m) m which results in chord [e 3 bn na, chord [b 2 wn na, line [hnr, d 3 wn na, hnr, cs 3 hn na, a 2 hn na, chord [cs 3 hn na, line [b 2 hn na, c 3 hn na] , for a set of random clicks in rosegarden's matrix editor. Right now, I'm desperately searching for functions that can help me analyse this beast, which afaict right now works best by having a multitude of transformations (e.g. one big top-level chord with maximum polyphony and a hell a lot of rests) that provide easy access to whatever information is needed. Does anyone of you know about previous work in this area? I don't want to break cultural imperatives by not being as lazy as possible. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited. ___ 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[2]: The programming language market (was Re: [Haskell-cafe] Why functional programming matters
Hello Jerzy and Bulat, Thanks for your perspectives. Bulat, I can understand that you find it shocking that the folks at Moscow University still study Lisp, but I wouldn't be so quick to condemn them for being dinosaurs. After all, they just stopped teaching the SICP course (using Scheme) at MIT, and I don't believe that they replaced it with an intro to CS course that uses (say) Haskell or ML! Nor has Berkeley, far as I know. ...ok, I looked, the MIT intro course is now taught in python. I'll let you decide if that's a step up from scheme. Which brings us back to the topic of the original thread - Simon's request for perspectives. The wonderfulness of advances in type theory these past 20 years, which are appreciated so readily here - they don't seem to have achieved universal acceptance in industry or in academia. What I mean by this is that if I look at the CS programs at Berkeley, MIT, CMU, I don't see a huge emphasis on PL. Looking now at the MIT opencourseware offerings in EECS, I see no undergrad course that suggests that you'd learn anything about modern type theory. Of course we know here of success stories involving modern fp languages. But there is no haskell or ml book that has had close to the influence of KR's C book. One might argue that adoption on that scale is not the goal of the haskell community (was it Kernighan, Ritchie, or Thompson's goal? I think not), but still, it's weird to me that: 1) we're clearly on to something, but still 2) many smart people who are interested walk away frustrated (not so easy to learn (is the hardness necessary? perhaps?), relative to KR, for example). 3) most of the canonical US universities for CS (MIT, Berkeley, Stanford, CMU, etc) basically don't teach haskell or ML, or even talk much about it, relative to how much they talk about, say, Java. It's one thing that companies don't move forward; yet another thing that Universities don't either. Why is that? Why, in 2008, is Java taught more than Haskell? On Sun, 27 Jan 2008, Bulat Ziganshin wrote: Hello Dipankar, Sunday, January 27, 2008, 12:16:38 AM, you wrote: Anyway, no we're older, and we realize that it would have helped our math understanding out quite a bit had we learned more physics, engineering, etc. Or had we learned 19th century mathematics well. The Russian program seems to do this, actually (at least for the sample set of kids that make it to the US). oh, yes, they are really still study 19th century physics, but not because of great mind, but due to age of university professors. i've studied at Moscow University in 89-91 and department of computer languages still studied Lisp at those times (!). a few months ago i have a conversation with today student and they still learn Lisp (!!!). it seems that they will switch to more modern FP languages no earlier that this concrete professor, head of PL department, which in 60s done interesting AI research, will dead, or at least go to the pension -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: The programming language market (was Re: [Haskell-cafe] Why functional programming matters
thanks for the correction - very informative! that'll teach me to just go to the opencourseware site at MIT only... On Sun, 27 Jan 2008, Dan Licata wrote: On Jan27, Dipankar Ray wrote: What I mean by this is that if I look at the CS programs at Berkeley, MIT, CMU, I don't see a huge emphasis on PL. Looking now at the MIT opencourseware offerings in EECS, I see no undergrad course that suggests that you'd learn anything about modern type theory. 3) most of the canonical US universities for CS (MIT, Berkeley, Stanford, CMU, etc) basically don't teach haskell or ML, or even talk much about it, relative to how much they talk about, say, Java. Not to dispute your general point, but CMU is an exception to this rule. There's a course, taught in SML, on basic functional programming, continuations, laziness, etc: http://www.cs.cmu.edu/~me/212/ This course is required for all CS majors and occurs fairly early in the sequence (freshman spring or sophomore fall). We also have a fairly hardcore introduction to type systems and operational semantics: http://www.cs.cmu.edu/~rwh/courses/ppl/ and a course on constructive logic: http://www.andrew.cmu.edu/course/15-317/ These electives are taken by ~30-40 students each, so I'd guess that somewhere between a third and a half of the undergrads go through one of them. And then there are electives, either mostly undergrad, like this course in typed compilation: http://www.cs.cmu.edu/~crary/hotc/ or mostly grad, like this course on logic programming (but there are always at least a handful of undergrads in the room): http://www.cs.cmu.edu/~fp/courses/lp/ And then there are two grad-level PL distribution-requirement courses (one on type systems, one on denotational semantics), which usually have a few interested undergrads. And many undergrads get involved in PL research as well. Maybe the real question is why so few universities have large groups of PL faculty to teach these courses? =) -Dan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: The programming language market (was Re: [Haskell-cafe] Why functional programming matters
Jerzy, this is a very interesting point you bring up, from my perspective. I should point out that certain US-trained mathematicans (myself included) are actually quite jealous of the Russian math education system - they produce mathematicians who tend to be excellent in depth and breadth, who are both great computationally and in terms of facility with abstract formalism. Kontsevich, Drinfel'd, Gromov, Givental, Beilinson, the whole Gelfan'd school - these people are incredible on all fronts. When I was an undergrad math major in the US, there was a clear culture of valueing proofs over computation. Integrals were sneered at; the more abstract the argument, the more representative of true mathematics it surely must be. Now that I'm older I recognize that this is a special case of the teenager's way of declaring himself special: I'm *better* than those idiot physicists who are so trivial as to care about integrals. Could be a recent convert to jazz talking about rock, or whatever. Anyway, no we're older, and we realize that it would have helped our math understanding out quite a bit had we learned more physics, engineering, etc. Or had we learned 19th century mathematics well. The Russian program seems to do this, actually (at least for the sample set of kids that make it to the US). What you're telling me below is that part of this emphasis on old-world mathematics might have come from an arrogance/bias against computers? Interesting - I'll have to think about this. I've often heard from my Eastern European colleagues that they learned almost nothing about computer science back home... On Sat, 26 Jan 2008, [EMAIL PROTECTED] wrote: You may perhaps remember (which you won't, because you are too young) the glorious times when computers became a reality even in Soviet Union. They had at that time plenty of really good mathematicians. But the totalitarian view of the science, plus the nationalistic proudness, made them (the rulers not the scientists...) think and say that with so many good people, there is no need to develop the programming automated tools. They neglected the programming languages. Russia and their satellites became a kind of desert here not only because of economical problems... Jerzy Karczmarczuk ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] About scandalous teaching
On Thu, 18 Oct 2007, [EMAIL PROTECTED] wrote: Dipankar Ray decided to invest himself after my last grumbling concerning the uselessnes of recalling that Haskell may be presented in schools in a very bad way. sadly, I'm neither the rabbi from minsk nor the one from pinsk. I just happened to be on the train... an innocent bystander, I swear! ;-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Do you trust Wikipedia?
PR: I think that an email to Tim Gowers would yield LaTeX source for the pdf articles in his Princeton Companion to Mathematics, in case it has articles on topics you care about: http://gowers.wordpress.com/category/princeton-companion-to-mathematics/ On Thu, 18 Oct 2007, Stefan O'Rear wrote: On Fri, Oct 19, 2007 at 02:45:45AM +0200, [EMAIL PROTECTED] wrote: PR Stanley writes: One of the reasons I'm interested in Wikipedia and Wikibook is because you're more likely to find Latex source code used for typesetting the maths. Latex is the one and only 100% tool right now. A lot of publishers use Latex but try to get anything from them in electronic form. I don't understand you. WHAT YOU WANT? 1. Many articles in Wikipedia typeset math formulae as *images*, you don't really see the LaTeX sources. Some formulae are typed through plain HTML. Don't forget that PR Stanley is blind. Latex page sources are infinitely superior to unadorned images of unknown providence. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] On the verge of ... giving up!
i fear that, at this point, this thread is a test: if I post a reply, it shows that I am a fool. ah well. JK, of course there are foolish teachers out there. I don't think Felipe was suggesting that this teacher had the right idea, nor that he himself was going to stop haskelling anytime soon. But when people in relative power say wrong things, it makes it harder for junior colleagues (or students) to establish credibility, with other colleagues and students. You may be of the opinion that such colleagues and students are fools, or beyond help. But I think none of us made it to the promised land of haskell in a vacuum - most were introduced by a friend or teacher. Seems to me that Felipe feels a little thwarted in his desire to pass on the favor to others. Your tone suggests that it's some kind of moral weakness to want others to get what we're talking about, what I'd call the what do you care what other people think? philosophy. Of course, such a mindset can be very valuable, and we should all cultivate self-confidence. Nevertheless, I think there's no shame in wanting other people to share in our joy - many of us are on this email list because we are mini-evangelists as well as lovers of haskell. on the whole, I think we evangelists can be a good thing for haskell, though of course we must be responsible scholars ourselves. It's not clear to me that Einstein slept so well (for myriad reasons), and one can easily point to people who were geniuses and visionaries, who were miserable for much of their life (Cantor, Godel, Turing, etc). Aren't we all, to some degree, interested in creating a world where our ideas get more support? You mention MS Research supporting the Simons - well, MSR does so in part because both of them (and their colleagues at MSR Cambridge) are tireless evangelists, who are fantastically generous with their time, ideas, and code. One way to go might be to code haskell in self-confident semi-secrecy, and demonstrate the wonderfulness of our ideas by the results it produces. This would be great. Another way to go is to teach others what is *already* known. I think we can all agree that today there is a vast gulf between what is considered good, professional programming, and what is the state of the art in CS (and specifically PL theory) today. Hence I suspect that the good fight can be fought on many fronts at the same time. On Thu, 18 Oct 2007, [EMAIL PROTECTED] wrote: Felipe Lessa writes: On 10/17/07, [EMAIL PROTECTED] We shall thus understand that a teacher who likes Fibonacci, is a representant of of the 100% of the human population. Sorry if I didn't understand very well the tone of your message or if I wasn't clear enough, however what I was trying to say is that he makes up the mind of most of his students with the idea that Haskell is a toy language with poor performance and strange limitations. My tone was obviously sarcastic, and the reason is that for ANY niche of human activity you may find lousy teachers. And - in my eyes - you shouldn't have agreed on such a pathological example that 100% of the human population consider Haskell a toy. Haskell is being taught in hundreds of places. That's all. We shouldn't advertize bad teachers. BTW., almost 100% of humanity don't care at all about the General Theory of Relativity. And *never did*. It didn't prevent Einstein from sleeping. Of course, this example is as silly as it is, but not more. J.K. ___ 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] Do you trust Wikipedia?
I like wikipedia for mathematics quite a lot. However, I thought I might direct attention to the in-progress Princeton Companion to Mathematics: http://gowers.wordpress.com/2007/09/06/hello-world/ On Wed, 17 Oct 2007, Dan Weston wrote: I find the mathematics is more accurate on http://www.conservapedia.com Their facts get checked by the Almighty Himself! ;) Dan Piponi wrote: The mathematics is probably the most reliable part of Wikipedia. -- Dan On 10/17/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Do you trust mathematical materials on Wikipedia? Paul ___ 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Re[2]: Why monad tutorials don't work
At this point I must mention that Tim Gowers has an excellent article on Tensor Products, entitled How to lose your fear of tensor products: http://www.dpmms.cam.ac.uk/~wtg10/tensors3.html Tim Gowers is a pretty ok mathematician - worth taking tips from, I'd say ;) http://en.wikipedia.org/wiki/William_Timothy_Gowers On Wed, 15 Aug 2007, Dan Piponi wrote: On 8/15/07, Dan Weston [EMAIL PROTECTED] wrote: You too could have invented Universal Algebra and Category Theory. I nominate Dan Piponi to write it and eagerly await its release! I've already started on it. Well, that's not the exact title and subject. And as an example I'll probably use the definition of tensor product that I linked to, not the even more compact and elegant one that you just gave. I'm a strong believer that lots of (but not all) tricky looking mathematics is just fancy language for intuitions that people already have. I suspect that most computer scientists already have much of the intuition behind the idea of a universal property, and that it is in fact easier to grasp for a computer scientist than a mathematician. :-) -- Dan ___ 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] [Math] Category theory research programs?
are you applying to computer science programs or math programs? for category theory, you might look at where the Ken Shans of the world went to grad school. for diff geo, there are a host of great places. and I don't know exactly what you mean by diff geo. You could be into gauge theory, in which case places like Imperial College, Cambridge, Oxford, Columbia, Duke, MIT come to mind (advisors like Donaldson, Hamilton, Morgan, Bryant, dozens I'm neglecting to mention). The other standard top US schools (Harvard, Princeton, Stanford, Berkeley, Chicago, Michigan) are all pretty strong in both algebra and geometry, of course (Yau, Givental, Eliashberg, etc, are at these schools). Other places like UT Austin, Northwestern, UIUC, UCLA, and even UW (University of Washington) come to mind. In Canada, UBC. Also, you may find that your interests are closer to (say) algebraic geometry, which is intimately connected to the kind of diff geo that's done in relation to physics these days. In which case you might want to consider Chicago and Northwestern strongly, as these schools have amazing alg geo groups these days. Of course Harvard is the historical leader here (some have left, but Mumford, Mazur, Yau, Griffiths, Harris, Siu, Richard Taylor, etc), and Princeton is also incredibly strong. Pretty much any of these schools will give you a plenty strong background in category theory to understand it for haskell, I'd say (perhaps this is overstatement, but (for example) algebraic geometers tend to become quite expert at category theory). On Fri, 13 Jul 2007, Creighton Hogg wrote: Hi Haskell, Sorry to contribute to the noise but given that we've been talking about categories lately, I was wondering if anyone had any opinions on good universities for studying category theory. I'm trying to figure out where to apply for my phd. I want to either be at a place with a strong category theory program or a strong differential geometry program. Thanks, Creighton ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell
(aside to Dylan T: I hope you don't mind me advertising your (well, public) web pages here. In my opinion a lot more people should know about the stuff that both you and Ken are doing!) Here's an example of some great math being done in haskell: http://www.math.columbia.edu/~dpt/genus2fiber/ (the code for this paper): http://arxiv.org/abs/math.GT/0510129 On Mon, 21 May 2007, Brandon S. Allbery KF8NH wrote: On May 21, 2007, at 14:15 , Andrew Coppin wrote: Henning Thielemann wrote: I only know few mathematicians using Haskell, most of the (applied) mathematician colleagues I know prefer MatLab. I hate MatLab... it's horrid! Everyone hates Matlab. Problem is, it's hard to find anything like its toolkits -- brandon s. allbery [linux,solaris,freebsd,perl] [EMAIL PROTECTED] system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED] electrical and computer engineering, carnegie mellon university KF8NH ___ 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] Monad pronounced like gonad?
I cringe to post to a thread with this subject line, but no American mathematician I know would call it Moe-nad. I think the US math consensus is Mon - ad, where mon is like the faux-jamaican Hey, mon, or (more to the point) monoid or monomorphism. Sometimes Dictionaries are only as good as (their current crop of fact-checkers) x (current budget) On Thu, 10 May 2007, Melissa O'Neill wrote: Although I hate to resort to dictionaries, curiosity got the better of me and I find the following. According to both Merriam Webster and the OED, monad is indeed pronounced exactly like gonad. BUT, in the UK at least, there is more than way to pronounce gonad, so it doesn't necessarily clarify things. In the US (according to Merriam Webster), it appears that the correct pronunciation is mō-nad, like joe-nad. In the UK (according to the OED), it appears that the pronunciation is either mȯ-nad, like gone-bad (i.e., with an o sound like the o in lot or pot), or mō-nad, like joe-nad. So, from this information, we can conclude that to be truly international, go with the long O sound, and to sound more English, use the short o sound. Melissa. P.S. See http://mw1.merriam-webster.com/pronsymbols.html for the meanings of the phonetic symbols ō and ȯ. (Assuming they make it through email, etc., which is probably unlikely, but we'll see.) ___ 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] Haskell to call Microsoft COM (Dispatch)
Marc Weber wrote: Hi. I spent much time trying to get it to work.. you have to download the whole fptools directory (from cvs!).. and I think i did some little patches but I can check out again and compare.. It did compile and I think it's working well but I'm still struggling getting to use it.. At least the examples do compile! If you are really interested I would appreciate getting in contact with you (my private email: marco-oweber a t gmx.de) .. Perhaps we can help each other. (Becaue I'm not an experienced haskell programmer, yet ;-) I've been trying to get hdirect to build and would also appreciate any hints. Sounds like I should try the version from CVS? - Marsh ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] newbie help
Hi I just started on haskell , i am using the yet another haskell tutorial by Hal Daume I wrote the following program and it dint compile. what's wrong with it module Main where import IO main = do hSetBuffering stdin LineBuffering let testList = makeList let sum = foldr (+) 0 testList putStrLn Sum is ++ show(sum) makeList = do putStrLn enter a num num - getLine let nbr = read num if nbr == 0 then do return [] else do all - makeList return (nbr : all) -- the error i get is Chasing modules from: Sum.hs Compiling Main ( Sum.hs, Sum.o ) Sum.hs:6: Couldn't match `[a]' against `IO ()' Expected type: [a] Inferred type: IO () In the application `putStrLn Sum is ' In the first argument of `(++)', namely `putStrLn Sum is ' Sum.hs:9: Couldn't match `[b]' against `IO [a]' Expected type: [b] Inferred type: IO [a] In the third argument of `foldr', namely `testList' In the definition of `sum': sum = foldr (+) 0 testList - Thanks, Abhijit Ray ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe