News aggregator

reactive-banana GLFW-b event register example

haskell-cafe - Thu, 05/08/2014 - 1:08pm
Hello List, I am trying to make the following quasi-code example work: registerMouseButton :: IO (Event MouseButton) registerMouseButton = do(addHandler, fire) <- newAddHandler setMouseButtonCallback $ \button _ -> fire button fromAddHandler addHandler According to http://stackoverflow.com/questions/8631816/reactive-banana-how-to-create-an-addhandlerit looks like it should be something straightforward. Can somebody show an example of a functional code that registers a key or a mouse event? Thanks, Vladimir _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Benefits of coroutine?

Haskell on Reddit - Thu, 05/08/2014 - 8:51am

I found a link(http://www.haskellforall.com/2014/03/introductions-to-advanced-haskell-topics.html) from haskelllforall.com earlier and am trying to go through the materials in it. I am now reading the corontine article(http://themonadreader.files.wordpress.com/2011/10/issue19.pdf).

I think the article did a good job explaining what corontine is and how it works. However, i don't think i see the full benefits of coroutine from the article.

I know one usage is that you can stream a list of coroutines together as a data process flow. Because you don't need to hold a lot data in memory this way, data is consumed and send to next 'data processor' immediately, low memory footprint is definitely a benefit. Also, because you don't have to put 'data processor's in different threads, so less context switch will happen. The coroutines just cooperate with each other without any locks/mutexes/etc. That can be another benefit.

But don't we lose some parallelism as a result? If we allow more memory usage, and put processors in different threads. Processor 1 can accumulate some data then pass to processor 2, and while processor 2 is at it, processor 1 can continue to process. In fact, this is how java blocking queue is usually used.

Or maybe coroutines can be used to do this, it's just the pipe functions in the article are just simple implementation to help people understand the concept? If this is true, how are those implemented in a real world?

Also, coroutine seems to be useful in many other cases, can someone list those as well?

I know this is a lot questions..but i really want to understand coroutines, they on their own are very interesting already.

submitted by icetortoise
[link] [5 comments]
Categories: Incoming News

Haskell Game Lib Preferences? (SDL/SFML)

Haskell on Reddit - Thu, 05/08/2014 - 7:57am

I'm just starting out learning Haskell, and as I'm primarily a game developer, I figure the best way is to make some games. The most promising bindings appear to be for SDL and SFML.

Is there any consensus as to which of these (or another alternative) is the nicest to use? I don't have any experience with SDL or SFML.

submitted by detorid
[link] [13 comments]
Categories: Incoming News

Haskell Weekly News: Issue 294

haskell-cafe - Thu, 05/08/2014 - 4:26am
Welcome to issue 294 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from April 27 to May 3, 2014 Quotes of the Week * roconnor: oh no. edwardk and I can never meet otherwise it will be revealed that I am actually him in a very short costume. * edwardk: I'm a product mostly of old Wadler monad papers and TaPL with some Cale thrown in. * benzrf: zippers are fun / they are zippy! / anyway bye Top Reddit Stories * Nikki and the Robots (FOSS Haskell game) has been greenlit on Steam Domain: steamcommunity.com, Score: 130, Comments: 7 Original: [1] http://goo.gl/VgbYzB On Reddit: [2] http://goo.gl/rsKKLn * So I re-implemented Freenet in Haskell, what now? Domain: self.haskell, Score: 85, Comments: 34 Original: [3] http://goo.gl/yLHLD4 On Reddit: [4] http://goo.gl/yLHLD4 * Meditations on learning Haskell from an ex-Clojure user Domain: bitemyapp.com, Score: 79, Comments: 113
Categories: Offsite Discussion

Is there a tool to check if "cabal frozen" dependencies are outdated

Haskell on Reddit - Thu, 05/08/2014 - 2:07am

cabal-install includes a freeze command these days, which is very helpful to get reproducible builds, especially for executables. See the announcement of cabal 1.20 for more details.

Now, my question: Is there a tool which can tell if/when there are newer versions of cabal frozen dependencies?

I guess one way to achieve this is rebuilding the application in a clean sandbox with no cabal.config and calling cabal freeze again.

However that requires recompiling the universe unnecessarily. I assume packdeps can be extended to support this functionality or cabal-install can itself provide this information.

submitted by ozgurakgun
[link] [4 comments]
Categories: Incoming News

Programming programs that program programs to simplify programming.

Haskell on Reddit - Wed, 05/07/2014 - 9:49pm

Hello, I've been recently interested in programs that can program programs for you. That is, you give it a map of input/output pairs and it gives you the source code of a program that is valid for that map. If we had something like that that worked for arbitrary programs, programming would become so much ridiculously easier that the whole field would change. In order to investigate, I made a small program that finds the definition of the (λx -> x+tan(x*x)) function from 20 input/output pairs. I was actually surprised by how fast it could find the result, but, obviously, anything much more complex than that results in a combinatory explosion.

But thinking about it, most of the functions we write in Haskell are really small. Even complex stuff that take hours to get right, such as an interpreter for the lambda calculus, could be written in as few as 3 lines. So this makes me suspect that kind of thing, with some added heuristics (genetic programming?) could actually be useful to practical jobs. So this makes me wonder, why I never heard of it? Has anyone ever tried to use and incorporate this kind of thing in their daily Haskell work? How successful (or not) was it?

submitted by SrPeixinho
[link] [8 comments]
Categories: Incoming News

OCL 2014: First Call for Papers

General haskell list - Wed, 05/07/2014 - 9:37pm
(Apologies for duplicates) CALL FOR PAPERS 14th International Workshop on OCL and Textual Modeling Applications and Case Studies (OCL 2014) Co-located with ACM/IEEE 17th International Conference on Model Driven Engineering Languages and Systems (MODELS 2014) September 28-30 (tbc), 2014, VALENCIA, SPAIN http://www.software.imdea.org/OCL2014/ Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but some of their features are difficult to formalize and lack the level of precision required to create complete and unambiguous specifications. Limitations of the graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have the
Categories: Incoming News

OCL 2014: First Call for Papers

haskell-cafe - Wed, 05/07/2014 - 9:37pm
(Apologies for duplicates) CALL FOR PAPERS 14th International Workshop on OCL and Textual Modeling Applications and Case Studies (OCL 2014) Co-located with ACM/IEEE 17th International Conference on Model Driven Engineering Languages and Systems (MODELS 2014) September 28-30 (tbc), 2014, VALENCIA, SPAIN http://www.software.imdea.org/OCL2014/ Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but some of their features are difficult to formalize and lack the level of precision required to create complete and unambiguous specifications. Limitations of the graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have the
Categories: Offsite Discussion

Edward Z. Yang: Elimination with a Motive (in Coq)

Planet Haskell - Wed, 05/07/2014 - 9:13pm

Elimination rules play an important role in computations over datatypes in proof assistants like Coq. In his paper "Elimination with a Motive", Conor McBride argued that "we should exploit a hypothesis not in terms of its immediate consequences, but in terms of the leverage it exerts on an arbitrary goal: we should give elimination a motive." In other words, proofs in a refinement setting (backwards reasoning) should use their goals to guide elimination.

I recently had the opportunity to reread this historical paper, and in the process, I thought it would be nice to port the examples to Coq. Here is the result:

http://web.mit.edu/~ezyang/Public/motive/motive.html

It's basically a short tutorial motivating John Major equality (also known as heterogenous equality.) The linked text is essentially an annotated version of the first part of the paper—I reused most of the text, adding comments here and there as necessary. The source is also available at:

http://web.mit.edu/~ezyang/Public/motive/motive.v

Categories: Offsite Blogs

Need pointer to explain CPU usage

haskell-cafe - Wed, 05/07/2014 - 8:43pm
Hello List, I have a tiny scotty-based application, which when compiled and started in profiling mode, consumes 10x CPU it does in normal mode. Interestingly, if I fire a request on the app, CPU usage drops to minimal after finishing the request for a while. But after a few minutes it starts consuming 10x CPU again. First I would have suspected scotty, however collecting time profiling info with -p, -P or -Pa doesn't reveal much. That still not rules scotty out however. To make matters worse, I inspect strange time profiling tick count I can't explain - the .prof file says "2 ticks < at > 1000 us", while the application was clearly running idle for a good few seconds. Any ideas what am I missing? Thanks, Robin
Categories: Offsite Discussion

Please, don't take it as an offence, but Cabal is terrible as a package manager, it is a serious problem about Haskell and it is about time the community does something to solve this.

Haskell on Reddit - Wed, 05/07/2014 - 2:41pm

I've been trying for months to install GHCJS to no success. Haste, Fay, many other things I try to install end up in a plain failure with terrible error messages that give you no hope to get it right. Getting anything to work with Haskell is a pain and I spent much more time installing and cleaning installs than ever coding on the language. This is completely unacceptable. Coming from Node.js, where npm install lib actually works makes me feel like I'm back to the 90's. You keep asking what is stopping Haskell from getting main adoption, and there it is. This. This is what is stopping it.

I think it is about time we unite ourselves as a community and try to solve the problem by creating an actual package manager for Haskell. And humbling ourselves to learn a lot from Node.js.

submitted by SrPeixinho
[link] [27 comments]
Categories: Incoming News

Could someone provide a shell script that will clean any existing Haskell installation and install GHC 7.8 and GHCJS in OSX Mavericks?

Haskell on Reddit - Wed, 05/07/2014 - 2:30pm

As some might even know, I've tried installing GHCJS 7.8 on OSX several times already. I've even asked this a few times here to no luck. So now what I am asking is, could someone write a sh script that will do all I need - cleaning any existing Haskell and setting GHC 7.8 with working GHCJS up on OSX? That would be really great. :(

submitted by SrPeixinho
[link] [5 comments]
Categories: Incoming News