[Haskell-cafe] Monaris

2013-01-02 Thread 山本和彦
Happy new year from Japan. A young talented guy, @fumieval, has released Monaris, a Tetoris clone based on OpenGL. You can install it: % cabal install Monaris To my surprise, this game is implemented with free Monad. ;-) Regards, --Kazu ___

Re: [Haskell-cafe] Proving programs

2013-01-02 Thread AUGER Cédric
Le Tue, 01 Jan 2013 14:24:04 -0900, Christopher Howard christopher.how...@frigidcode.com a écrit : I'm working through a video lecture describing how to prove programs correct, by first translating the program into a control flow representation and then using propositional logic. In the

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
On Jan 2, 2013, at 2:26 AM, Bob Hutchison hutch-li...@recursive.ca wrote: On 2013-01-01, at 3:47 PM, MigMit miguelim...@yandex.ru wrote: Well, probably one of the reasons is that I've learned Eiffel later than Haskell. But really, Design by Contract — a theory? It certainly is a

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
On Jan 2, 2013, at 8:44 AM, Никитин Лев leon.v.niki...@pravmail.ru wrote: I said theoratical, but not mathematical or a scientific theory. Than what kind of theory did you mean? image1.gif Meyer have built a quite coherent construction in comparison with other OOP langs. More than

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
On Jan 2, 2013, at 10:52 AM, Mike Meyer m...@mired.org wrote: [Context destroyed by top posting.] MigMit miguelim...@yandex.ru wrote: But really, Design by Contract — a theory? It certainly is a useful approach, but it doesn't seem to be a theory, not until we can actually prove

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Mike Meyer
On Wed, 2 Jan 2013 13:48:07 +0400 MigMit miguelim...@yandex.ru wrote: On Jan 2, 2013, at 10:52 AM, Mike Meyer m...@mired.org wrote: MigMit miguelim...@yandex.ru wrote: But really, Design by Contract — a theory? It certainly is a useful approach, but it doesn't seem to be a theory, not until

[Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Francesco Mazzoli
Hi list, I am a bit puzzled by the behaviour exemplified by this code: {-# LANGUAGE RankNTypes #-} one :: (forall a. a - a) - b - b one f = f two = let f = flip one in f 'x' id three = (flip one :: b - (forall a. a - a) - b) 'x' id four = flip one 'x' id Try to guess

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Francesco Mazzoli
At Wed, 02 Jan 2013 12:32:53 +0100, Francesco Mazzoli wrote: Hi list, I am a bit puzzled by the behaviour exemplified by this code: {-# LANGUAGE RankNTypes #-} one :: (forall a. a - a) - b - b one f = f two = let f = flip one in f 'x' id three = (flip one :: b

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Никитин Лев
 Well, we can say "concepts" in place of "theory".  And I'm comparing Eiffel with other OOP lang, not with some langs based on a solid math theory (lambda calcules for FP langs, for example). ok? DbC is not the same as "assert macros". First, it has a lang semantic. There is an interesting

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Никитин Лев
Opps... I forgot about Eiffel agents! PS. After participationing in this discussion I'm  tempting to reread Meyer's book after 10 years interval, to have a detailed look at the eiffel from the FP position. When I read this book first I know nothing about FP.  

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Roman Cheplyaka
* Francesco Mazzoli f...@mazzo.li [2013-01-02 13:04:36+0100] At Wed, 02 Jan 2013 12:32:53 +0100, Francesco Mazzoli wrote: Hi list, I am a bit puzzled by the behaviour exemplified by this code: {-# LANGUAGE RankNTypes #-} one :: (forall a. a - a) - b - b one f =

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Bob Hutchison
On 2013-01-02, at 4:41 AM, MigMit miguelim...@yandex.ru wrote: On Jan 2, 2013, at 2:26 AM, Bob Hutchison hutch-li...@recursive.ca wrote: On 2013-01-01, at 3:47 PM, MigMit miguelim...@yandex.ru wrote: Well, probably one of the reasons is that I've learned Eiffel later than Haskell.

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Francesco Mazzoli
At Wed, 2 Jan 2013 14:49:51 +0200, Roman Cheplyaka wrote: I don't see how this is relevant. Well, moving `flip one' in a let solves the problem, and The fact that let-bound variables are treated differently probably has a play here. I originally thought that this was because the quantifications

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Bob Hutchison
On 2013-01-02, at 7:56 AM, Bob Hutchison hutch-li...@recursive.ca wrote: You should read OOSC2. You'll find that this is completely consistent with it. Don't forget that the 'C' in OOSC2 is 'contraction'. 'Construction' of course… the automated spell checker is not my friend :-(

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Emanuel Koczwara
Hi, First, I see (posts on this mailing list) that OO ideas are well known in functional community :) So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? Learn or not to learn? I would say: yes! There is whole new universe to discover: UML,

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Bob Hutchison
On 2013-01-02, at 1:52 AM, Mike Meyer m...@mired.org wrote: [Context destroyed by top posting.] MigMit miguelim...@yandex.ru wrote: But really, Design by Contract — a theory? It certainly is a useful approach, but it doesn't seem to be a theory, not until we can actually prove something

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Dan Doel
Your example doesn't work for the same reason the following doesn't work: id runST (some st code) It requires the inferencer to instantiate certain variables of id's type to polymorphic types based on runST (or flip's based on one), and then use that information to check some st code (id in

Re: [Haskell-cafe] [Haskell-beginners] ghc and android

2013-01-02 Thread Bernhard Urban
On Tue, Jan 1, 2013 at 3:41 PM, Brandon Allbery allber...@gmail.com wrote: On Tue, Jan 1, 2013 at 9:13 AM, Bernhard Urban lew...@gmail.com wrote: The main issue: The GHC runtime relies on glibc I have to assume this is not meant literally, because ghc works on OS X and *BSD. Right. I was

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Dan Doel
On Wed, Jan 2, 2013 at 11:20 AM, Dan Doel dan.d...@gmail.com wrote: Note that even left-to-right behavior covers all cases, as you might have: f x y such that y requires x to be checked polymorphically in the same way. There are algorithms that can get this right in general, but it's a

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Francesco Mazzoli
At Wed, 2 Jan 2013 11:20:46 -0500, Dan Doel wrote: Your example doesn't work for the same reason the following doesn't work: id runST (some st code) It requires the inferencer to instantiate certain variables of id's type to polymorphic types based on runST (or flip's based on one),

Re: [Haskell-cafe] [Haskell-beginners] ghc and android

2013-01-02 Thread Karel Gardas
Hello, rather than native GHC run on top of Android, I would recommend to have a look at GHC HEAD and attempt to cross-compile to Android. On ghc-cvs@ mailing list I've seen some work done for cross-compiling to QNX/BlackBerry OS 10 so I think Androind should be also doable with some

Re: [Haskell-cafe] Proving programs

2013-01-02 Thread Simon Thompson
Christopher, there's an introduction to proof for functional programs at http://www.cs.kent.ac.uk/people/staff/sjt/Pubs/ProofChapter.pdf I hope that you find it useful. Kind regards Simon On 1 Jan 2013, at 23:24, Christopher Howard christopher.how...@frigidcode.com wrote: 1. Does this

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Dan Doel
If you want to know the inner workings, you probably need to read the OutsideIn(X) paper.* I'm not that familiar with the algorithm. But what happens is something like this When GHC goes to infer the type of 'f x' where it knows that f's argument is expected to be polymorphic, this triggers a

Re: [Haskell-cafe] Inference for RankNTypes

2013-01-02 Thread Francesco Mazzoli
At Wed, 2 Jan 2013 13:35:24 -0500, Dan Doel wrote: If you want to know the inner workings, you probably need to read the OutsideIn(X) paper.* I'm not that familiar with the algorithm. But what happens is something like this When GHC goes to infer the type of 'f x' where it knows that

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
On Jan 2, 2013, at 4:24 PM, Никитин Лев leon.v.niki...@pravmail.ru wrote: Well, we can say concepts in place of theory. And I'm comparing Eiffel with other OOP lang, not with some langs based on a solid math theory (lambda calcules for FP langs, for example). ok? I agree that there are

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
2) prepost conditions and class invariants have defined behaviour in cases of inheritance, even/especially multiple inheritance. They are combined non-trivially in subclasses. Without this I don't think you have DbC. Yes, I forgot about that. Thanks. Feel free to enlighten me about these

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread Gershom Bazerman
On 1/2/13 4:29 PM, MigMit wrote: BTW. Why you think that Eiffel type system is unsafe? Well, if I remember correctly, if you call some method of a certain object, and this call compiles, you can't be certain that this object actually has this method. Could be that this object belongs to

Re: [Haskell-cafe] Object Oriented programming for Functional Programmers

2013-01-02 Thread MigMit
On Jan 3, 2013, at 2:09 AM, Gershom Bazerman gersh...@gmail.com wrote: On 1/2/13 4:29 PM, MigMit wrote: BTW. Why you think that Eiffel type system is unsafe? Well, if I remember correctly, if you call some method of a certain object, and this call compiles, you can't be certain that this

[Haskell-cafe] [Announcement] New SBV release

2013-01-02 Thread Levent Erkok
I'm happy to announce v2.9 release of the Haskell SBV library: http://leventerkok.github.com/sbv/ SBV (SMT Based Verification) is a library that allows Haskell programs to take advantage of modern SMT solvers, by providing a symbolic simulation engine that can invoke 3rd party SMT solvers

Re: [Haskell-cafe] Proving programs

2013-01-02 Thread Andrés Sicard-Ramírez
On Wed, Jan 2, 2013 at 12:22 PM, Simon Thompson s.j.thomp...@kent.ac.uk wrote: Christopher, there's an introduction to proof for functional programs at http://www.cs.kent.ac.uk/people/staff/sjt/Pubs/ProofChapter.pdf Simon, is it possible to get the list of the bibliographic references used

[Haskell-cafe] Safe 'chr' function?

2013-01-02 Thread Myles C. Maxfield
Hello, I'm working on a general text-processing library [1] and one of my quickcheck tests is designed to make sure that my library doesn't throw exceptions (it returns an Either type on failure). However, there are some inputs that cause me to pass bogus values to the 'chr' function (such as