Re: [Haskell-cafe] Haskell for children? Any experience?
On 28 January 2011 01:23, Chris Smith cdsm...@gmail.com wrote: [TRUNC] I did look at Haskore, and there's a lot to like about it; but also a lot to worry about. The documentation talks about it only being able to do synthesis on Linux (but that documentation seems to be old; I wonder if this is still true); it definitely suffers from wall of modules syndrome ... Hi Chris Note that Haskore-vintage and Henning's Haskore are now quite different. From the date I'd assume John Peterson's slides would have been using vintage Haskore (at the time it wouldn't have been called vintage, of course). Vintage Haskore generates MIDI files only, Paul Hudak has a large tutorial for vintage Haskore, its (probably) too long for kids but you could certainly crib a lot from it. Paul's also re-doing the School of Expression book to concentrate more on music - I think he's making drafts available. If you have Haskore specific queries, the Haskell-art list is better than Cafe as Paul is a regular commentator there. Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric
On Thu, 2011-01-27 at 19:36 -0500, wren ng thornton wrote: On 1/27/11 2:21 PM, Maciej Piechotka wrote: On Thu, 2011-01-27 at 00:45 -0500, wren ng thornton wrote: On 1/26/11 5:51 AM, Maciej Piechotka wrote: Some projects (like Linux) remove this clause and I'm not sure how many projects are marked on hackage as GPL2 being GPL2-only. Technically GPLx and GPLy are incompatible for all x and y such that x /= y.The problem is that *technically* the phrasing of the viral clause prohibits dual licensing, despite the obvious intention. Could you elaborate? I cannot see any problem why author, having all rights, cannot publish code under GPL-2 and MPL. Sure GPL-2 allows someone to fork it into single-licence fork. IANAL, but that is the synopsis that was given to me by and old friend who was. ISTR that the FSF may have a page on the matter too (circa how to upgrade to GPL3 pages), though I'm loo lazy to look for it now. The problem is in the exact wording of how the viral clause is phrased, which is somewhat at odds with the intention. Basically, if you license your work under GPL2, and someone else wants to use it in a derivative work, then they must distribute the composite work under GPL2. All well and good, since this is the intention of the viral clause. However, copyright law doesn't have any built-in notion of versioning. So if you distribute your work as GPL2 and someone does some derivative work that they want to distribute as GPL3, then technically they must distribute the composite work under the *joint* license (GPL2 GPL3); however, since parts of the GPL3 were specifically written as bugfixes to the GPL2, this means the joint license is inconsistent and so noone can simultaneously adhere to both of them, so the composite work cannot be (non-vacuously) distributed. Conversely, if your work was distributed as GPL2+ then you are providing a disjunction of licenses for users to choose from. The person making their derivative work would be free to choose the GPL3 (or GPL3+) license(s) for their use of your work, and this is clearly compatible with their own GPL3 (or GPL3+) license, so the composite work can be released under GPL3 GPL3 == GPL3 (or GPL3+ GPL3+ == GPL3+, or GPL3+ GPL3 == GPL3,...) If you're familiar with linear logic, this is basically the same kind of differentiation between multiplicative and additive conjunction. Sorry - I misunderstood you. Dual licensing corresponds in my mind to || not . I.e. program dual-licensed on MPL and GPL-2 is (MPL || GPL-2) and user can choose to which license he wants to adhere. I believe similar nomenclature is used on Wikipedia. The problem you are describing corresponds to compatibility and, of course, GPL-2 and GPL-3 are not compatible (I believe that GPL-2+ GPL-3+ == GPL-3+). I'm not sure about the interpretation (and IANAL) but I'm not entirely sure if GPLx+ and GPLx-only are compatible at all. If one project is released under GPL version x (or, at your option, any later version) and the other is released under GPL version x (only), then the composite work can satisfy both by being released under GPL version x (only), since they have the option to choose GPL version x as their license for the first project. It's only a problem when x-only is not in the range of y+. Sorry - my concerns were unbased. I reread licences and found answer in point 9 (GPL-2) and 14 (GPL-3). Regards signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell for children? Any experience?
I think this is a wonderful idea! Fer land sakes, I remember when kids were taught BASIC or Fortran! I think Haskell will be a great improvement. Now, how'z'bout web sites? Kids love web sites, yes? I've been working on a small project, in quiet mode, to develop an all in the web browser development environment and tutorial on programming in Haskell with web programming as the main focus. So far the development environment part is up and running: you start like this: barley start playground ...project created Running on http://localhost:8080/ Now you browse to that URL and you have a Haskell development environment in the web page. Edit Haskell modules, and click save... bang! compiled with either in-line error messages, or if it runs, with a web page preview output. It's a lot of fun, actually. Here's the catch: The project isn't even at 0.1 yet: The above works, but there are some missing features from the development environment, and, most importantly, there is only the barest wisp of a tutorial yet. BUT - you aren't starting until next year, so help us write the tutorial! The project is, for now, here: https://github.com/mtnviewmark/barley But will be moving to code.google.com in a few weeks. - Mark Mark Lentczner http://www.ozonehouse.com/mark/ m...@glyphic.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] source line annotations
Evan Laforge schrieb: One of the first things I did when starting a larger haskell project was to write a preprocessor that would replace certain tokens with (token_srcpos (filename, func_name, lineno)) and then write x and x_srcpos versions of the various 'throw' and logging functions. This is extremely handy to have, and since logs are part of my app's UI, it's part of the app itself. I suspect that if you add source position information to 'throw' then you use 'throw' for showing (unintended) programming errors, but 'throw' is not intended for this purpose, but for expected problems like 'file not found' and so on. Adding source position to 'error', 'undefined', irrefutable patterns and logging functions for debugging makes sense to me, but for 'throw'? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell for children? Any experience?
On Thu, Jan 27, 2011 at 10:26 PM, Chris Smith cdsm...@gmail.com wrote: Like I said in the original post, my initial reaction was to push for something like Python. But the kids are very clear; if I'm at all willing, they want to learn Haskell! IMO the most important facet of education is motivation, which it sounds like the kids already have in spades. Therefore, your primary job is to feed and protect their enthusiasm while making it easier for them to learn what they want (and guiding them in the right direction). It sounds like whatever you were doing with GHCi was working, so I would build off of that and expand it to programs that require writing to disk, interact with one another (networking), and such. I remember when I was a kid, I wanted to be able to write things to disk so badly (I have no idea why), but to me that was what 'real' programming was all about. I agree that sound, animations, etc... are very sexy and if done right can increase their enthusiasm many fold, but it also has the ability to turn them off from the simple elegance of what first hooked their interest. So start simple and be attentive to what THEY enjoy and you will give them the most valuable programming knowledge of all: passion. Best of luck and keep us up to date on your blog/reddit posts! -- Jason M. Knight ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] source line annotations
On Fri, Jan 28, 2011 at 8:39 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: Evan Laforge schrieb: One of the first things I did when starting a larger haskell project was to write a preprocessor that would replace certain tokens with (token_srcpos (filename, func_name, lineno)) and then write x and x_srcpos versions of the various 'throw' and logging functions. This is extremely handy to have, and since logs are part of my app's UI, it's part of the app itself. I suspect that if you add source position information to 'throw' then you use 'throw' for showing (unintended) programming errors, but 'throw' is not intended for this purpose, but for expected problems like 'file not found' and so on. Adding source position to 'error', 'undefined', irrefutable patterns and logging functions for debugging makes sense to me, but for 'throw'? When I say 'throw' I mean ErrorT.throwError, which boils down to returning Left or Nothing. I.e. expected errors, used simply for early return. And especially in the case of Nothing, when debugging it's important to know which particular guard failed to make the operation expectedly unexpectedly abort. Otherwise I wind up sticking 'trace's in strategic points to see where execution is going, which is just a pain. For the IO 'throw' srcpos info is just as important even if it's a program crashing error, so I guess I disagree no matter which 'throw' we're talking about. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Using IsString with attoparsec
On Wed, Jan 26, 2011 at 7:43 PM, Bryan O'Sullivan b...@serpentine.com wrote: On Tue, Jan 25, 2011 at 5:16 AM, Yitzchak Gale g...@sefer.org wrote: I suggest adding the following type-specialized variants to Data.Attoparsec.Char8: (*.) :: Applicative f = f a - f ByteString - f a (*.) = (*) (.*) :: Applicative f = f ByteString - f a - f a (.*) = (*) Sounds reasonable. Send a patch? Done! It will be in attoparsec-text 0.8.2.0. Bryan, I don't know how to give you a patch using Mercurial, so I've used 'hg export -r 231 -o ../attoparsec_applicative.hg_export'. The patch is basically the same as attoparsec-text's. Cheers! =) -- Felipe. attoparsec_applicative.hg_export Description: Binary data ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell for children? Any experience?
Chris Smith schrieb: On Thu, 2011-01-27 at 11:44 -0600, aditya siram wrote: I was a little negative in my last message so maybe I can contribute something positive. If you're looking for a musical way to teach Haskell I did a Haskell music hackathon [1] about a year and a half ago. The idea was to use Haskell [2] to play music through a Supercollider music server [3] . Well, it seems like music is a good possibility for part of it. We're talking about a weekly class for a year, so it'll go beyond that. I'm sure that whatever I do, I won't be able to prevent it ending with the programming of video games! I did look at Haskore, and there's a lot to like about it; but also a lot to worry about. The documentation talks about it only being able to do synthesis on Linux (but that documentation seems to be old; I wonder if this is still true); it definitely suffers from wall of modules syndrome -- there's no obvious top-level module with a simplified interface that I can see... no starting point or anything beyond type signatures, a lot of abstraction, and the apparent existence of many different types all called named with a capital T. Maybe, though, I can wrap it in something more simple and usable. Sorry for not-up-to-date documentation. I think that looking at the various examples is most helpful for a start. I can't provide a link to code.haskell.org since it is down. But there is an Example directory. And maybe: http://www.haskell.org/haskellwiki/Haskore ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell for children? Any experience?
Jason, thanks for the comments. Unfortunately, I probably won't do blogs about it. Hate to say it, but anyone who has read much outside of /r/haskell will surely agree it's irresponsible to write about children on Reddit. And things I write on my blog are likely to end up on Reddit. I'll find somewhere to do an experience report, though, assuming this happens. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell for children? Any experience?
On Fri, Jan 28, 2011 at 10:47 AM, Chris Smith cdsm...@gmail.com wrote: Jason, thanks for the comments. Unfortunately, I probably won't do blogs about it. Hate to say it, but anyone who has read much outside of /r/haskell will surely agree it's irresponsible to write about children on Reddit. And things I write on my blog are likely to end up on Reddit. I have not read much outside of /r/haskell. Why is this irresponsible? Luke ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: web-routes and forms
Hello again, is there a way to had a hidden field in digestive-functor-blaze? I'm using it to transmit some data... Thanks, Corentin On Thu, Jan 27, 2011 at 11:21 AM, Corentin Dupont corentin.dup...@gmail.com wrote: OK thanks, now it's clear! On Thu, Jan 27, 2011 at 11:13 AM, Jasper Van der Jeugt jasper...@gmail.com wrote: Hello, As Jeremy said, the HTML returned by formHtml is meant to be placed inside the a form tag: it does not include a form tag. You should use it like this: H.form ! A.enctype (H.stringValue $ show enctype) ! A.method POST ! A.action / $ do html -- The HTML rendered by formHtml H.input ! A.type_ submit ! A.value Submit (with or without the submit button). Cheers, Jasper On Jan 27, 2011 10:54 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello Jasper, Do you have an idea? Thanks, Corentin -- Forwarded message -- From: Jeremy Shaw jer...@n-heptane.com Date: Thu, Jan 27, 2011 at 2:22 AM Subject: Re: web-routes and forms To: Corentin Dupont corentin.dup...@gmail.com Cc: haskell haskell-cafe@haskell.org On Wed, Jan 26, 2011 at 4:33 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Now turning to digestive functors, I don't see where do goes the A.action actionURL part that was in traditionnal forms? It seems I need it for routing the result of the form. I think you will find formHtml is returning you the stuff that goes inside the form tag, but does not actually include the form tag itself ? I am not sure how to modify the attrs using blaze-html. I think that is a missing feature of the digestive-functors-blaze package. In digestive-functors-hsp there is a function: setAttrs :: (EmbedAsAttr x attr, XMLGenerator x, Monad m, Functor m) = Form m i e [HSX.GenXML x] a - attr - Form m i e [HSX.GenXML x] a setAttrs form attrs = mapView (map (`set` attrs)) form You probably need something similar for blaze. - jeremy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Merry monad mixup?
The first and third work, but not the second. Why? Michael == f :: String - IO () f s = do putStrLn s {- g :: [String] - IO () g l = do s - l putStrLn s -} {- h :: [Int] - [Int] h l = do i - l return (i+1) -} == serialize2.hs:29:9: Couldn't match expected type `[String]' against inferred type `IO String' In a stmt of a 'do' expression: s - l In the expression: do { s - l; putStrLn s } In the definition of `g': g l = do { s - l; putStrLn s } ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Merry monad mixup?
On Fri, 2011-01-28 at 11:20 -0800, michael rice wrote: The first and third work, but not the second. Why? When you use a do block, it can be the syntactic sugar for whatever monad you like; but you do have to make a choice. Your first example had a do block for the IO monad. Your third example used the [] monad. Both are fine. The second, though, wasn't clear on what monad it was using. When you used the (-) syntax to nondeterministically choose from a list, the compiler settled upon the [] monad. But then the next line was a statement in the IO monad. That's inconsistent, hence the error. Perhaps you wanted to build a monad out of both behaviors? In this case, you should likely look into monad transformers, and in particular, the ListT monad transformer in the List package. This would allow you to write the code you did in a monad called ListT IO, except that the IO actions would need to be lifted through the use of either `lift` or `liftIO`. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Merry monad mixup?
Beware of ListT. It only works if your internal monad is commutative, which IO is not. (Maybe would work, for example) On Fri, Jan 28, 2011 at 2:41 PM, Chris Smith cdsm...@gmail.com wrote: On Fri, 2011-01-28 at 11:20 -0800, michael rice wrote: The first and third work, but not the second. Why? When you use a do block, it can be the syntactic sugar for whatever monad you like; but you do have to make a choice. Your first example had a do block for the IO monad. Your third example used the [] monad. Both are fine. The second, though, wasn't clear on what monad it was using. When you used the (-) syntax to nondeterministically choose from a list, the compiler settled upon the [] monad. But then the next line was a statement in the IO monad. That's inconsistent, hence the error. Perhaps you wanted to build a monad out of both behaviors? In this case, you should likely look into monad transformers, and in particular, the ListT monad transformer in the List package. This would allow you to write the code you did in a monad called ListT IO, except that the IO actions would need to be lifted through the use of either `lift` or `liftIO`. -- Chris Smith ___ 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] Merry monad mixup?
And by works, I mean, ListT is is a monad only if the internal monad is commutative. On Fri, Jan 28, 2011 at 2:46 PM, Daniel Peebles pumpkin...@gmail.comwrote: Beware of ListT. It only works if your internal monad is commutative, which IO is not. (Maybe would work, for example) On Fri, Jan 28, 2011 at 2:41 PM, Chris Smith cdsm...@gmail.com wrote: On Fri, 2011-01-28 at 11:20 -0800, michael rice wrote: The first and third work, but not the second. Why? When you use a do block, it can be the syntactic sugar for whatever monad you like; but you do have to make a choice. Your first example had a do block for the IO monad. Your third example used the [] monad. Both are fine. The second, though, wasn't clear on what monad it was using. When you used the (-) syntax to nondeterministically choose from a list, the compiler settled upon the [] monad. But then the next line was a statement in the IO monad. That's inconsistent, hence the error. Perhaps you wanted to build a monad out of both behaviors? In this case, you should likely look into monad transformers, and in particular, the ListT monad transformer in the List package. This would allow you to write the code you did in a monad called ListT IO, except that the IO actions would need to be lifted through the use of either `lift` or `liftIO`. -- Chris Smith ___ 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] Merry monad mixup?
So, my suspicions are confirmed. Thanks, all. Michael --- On Fri, 1/28/11, Daniel Peebles pumpkin...@gmail.com wrote: From: Daniel Peebles pumpkin...@gmail.com Subject: Re: [Haskell-cafe] Merry monad mixup? To: Chris Smith cdsm...@gmail.com Cc: michael rice nowg...@yahoo.com, haskell cafe haskell-cafe@haskell.org Date: Friday, January 28, 2011, 2:47 PM And by works, I mean, ListT is is a monad only if the internal monad is commutative. On Fri, Jan 28, 2011 at 2:46 PM, Daniel Peebles pumpkin...@gmail.com wrote: Beware of ListT. It only works if your internal monad is commutative, which IO is not. (Maybe would work, for example) On Fri, Jan 28, 2011 at 2:41 PM, Chris Smith cdsm...@gmail.com wrote: On Fri, 2011-01-28 at 11:20 -0800, michael rice wrote: The first and third work, but not the second. Why? When you use a do block, it can be the syntactic sugar for whatever monad you like; but you do have to make a choice. Your first example had a do block for the IO monad. Your third example used the [] monad. Both are fine. The second, though, wasn't clear on what monad it was using. When you used the (-) syntax to nondeterministically choose from a list, the compiler settled upon the [] monad. But then the next line was a statement in the IO monad. That's inconsistent, hence the error. Perhaps you wanted to build a monad out of both behaviors? In this case, you should likely look into monad transformers, and in particular, the ListT monad transformer in the List package. This would allow you to write the code you did in a monad called ListT IO, except that the IO actions would need to be lifted through the use of either `lift` or `liftIO`. -- Chris Smith ___ 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] GPL License of H-Matrix and prelude numeric
On 1/28/11 7:25 AM, Maciej Piechotka wrote: On Thu, 2011-01-27 at 19:36 -0500, wren ng thornton wrote: you distribute your work as GPL2 and someone does some derivative work that they want to distribute as GPL3, then technically they must distribute the composite work under the *joint* license (GPL2 GPL3); however, since parts of the GPL3 were specifically written as bugfixes to the GPL2, this means the joint license is inconsistent and so noone can simultaneously adhere to both of them, so the composite work cannot be (non-vacuously) distributed. Conversely, if your work was distributed as GPL2+ then you are providing a disjunction of licenses for users to choose from. The person making their derivative work would be free to choose the GPL3 (or GPL3+) license(s) for their use of your work, and this is clearly compatible with their own GPL3 (or GPL3+) license, so the composite work can be released under GPL3 GPL3 == GPL3 (or GPL3+ GPL3+ == GPL3+, or GPL3+ GPL3 == GPL3,...) Sorry - I misunderstood you. Dual licensing corresponds in my mind to || not. I.e. program dual-licensed on MPL and GPL-2 is (MPL || GPL-2) and user can choose to which license he wants to adhere. I believe similar nomenclature is used on Wikipedia. Yes, dual licensing is disjunctive in the sense that clients are free to choose. However, the issue about GPL versions has to do with *joint* licensing, which is more like an intersection between the licenses since both must be satisfied simultaneously. Elsewhere on the thread I brought up the example of joint licenses arising from multiple versions of the BSD3 (namely the person named by the third clause varies). We can form the join of many BSD3 licenses by just concatenating them together, which is exactly what Apple does for all the licenses of the code they build off of. It's just that the join of GPL2 and GPL3 is inconsistent, so technically they aren't GPL-compatible with one another (until you get around the issue by dual licensing as GPLx+). The problem you are describing corresponds to compatibility and, of course, GPL-2 and GPL-3 are not compatible (I believe that GPL-2+ GPL-3+ == GPL-3+). Yes, GPL2+ GPL3+ == GPL3+. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe