Scratch jr is an iPad version of the Scratch environment, designed with young kids in mind. It is the best kid-oriented programming tool I tried so far, and my five year old has great fun making "movies" with it. As I noted on twitter an hour after installing, the ability to record your own voice and use it for your sprites is a killer feature. Check it out!
A fork in the back? See discussion over at HN. People in the know are encouraged to shed light on the situation.
One of the challenges with building a library like Chart is the tension between ease of use and flexibility. Users want to produce charts with a minimum of code up front, but later want to refine the details. The chart library addresses this through the use of "defaulted records" using Data.Default.Class. Because such records are often nested, we rely on the somewhat intimidating lens library to modify the default values. We end up with code to create chart elements like this:sinusoid2 = plot_points_title .~ "fn(x)" $ plot_points_values .~ mydata $ plot_points_style . point_color .~ opaque red $ def
This is much simpler and cleaner that the corresponding code using native record accessors, but it still has a certain amount of syntactic overhead.
I’ve added a simple state monad to the library to further clean up the syntax. The state of the monad is the value being constructed, allowing the use of the monadic lens operators. The above code sample becomes:sinusoid2 = execEC $ do plot_points_title .= "fn(x)" plot_points_values .= mydata plot_points_style . point_color .= opaque red
This may seem only a minor syntactic improvement, but it adds up over an typical chart definition.
A few other changes further reduce the clutter in charting code:
- A new Easy module that includes helper functions and key dependencies
- Simpler "toFile" functions in the rendering backends
- Automatic sequencing of colours for successive plots
All this means that a simple plot can now be a one liner:import Graphics.Rendering.Chart.Easy import Graphics.Rendering.Chart.Backend.Cairo mydata :: [Double,Double] mydata = ... main = toFile def "test.png" $ plot $ points "lines" mydata
But this extends naturally to more complex charts. The code differences between the new stateful API versus the existing API can been seen in this example.
The stateful API is available in chart v1.3 It is a thin layer over the existing API – both will be continue to be available in the future.
I gave a presentation about monads at a Hungarian Haskell meetup in February. I put an emphasis on examples over definitions. My code examples include ones about image processing and text-based adventure games.
I'm not a Haskell expert, I just wanted to give a different perspective about starting out with monads so don't expect anything high level.
Audience members said they've found my presentation informative; I hope you will too.
Code examples: https://github.com/printron/feb-2014-monadsubmitted by printron
I'm trying to implement a typeclass hierarchy and want to specify that a type can only implement one of two classes in a branch of the heirarchy. How would I go about doing that?submitted by deltaSquee
[link] [29 comments]
I've seen anecdotes about Haskell's type system being very beneficial for juniour programmers working in a team environment (I think one from Don Stewart); that leaning on the type system allows juniour engineers to become productive faster while also keeping teams more productive.
My conjecture is that Haskell creates a really good environment for junior engineers. Yes, there is a steeper learning curve, but productivity should be increased (for them and the rest of the team) and anxiety lessened by leaning on the compiler and purity to guide programmers on the right course. Alas, this is just conjecture.
I'm wondering if anyone has any experience or anecdotes in this area. Especially with respect to hiring summer co-op students for paid work. This is quite an important consideration for start-ups in University/College towns who rely on Co-Op students. Specifically:
- Was it hard to hire junior programmers to write Haskell? (i.e. do young coders know about Haskell and/or see the appeal)
- Is writing Haskell appealing to juniour / co-op students?
- Are junior programmers able to learn Haskell quick enough? Can they become productive in Haskell in a short, summer-long co-op? How long did it take?
- Any tips or advice on interviewing junior / co-op programmers?
- What didn't work? What did?
Thanks!submitted by aaronlevin
[link] [29 comments]