Re: [Haskell-cafe] Is (==) commutative?

2012-07-26 Thread Alexander Solla
On 7/25/12, Christian Sternagel c.sterna...@gmail.com wrote: Dear Alexander, On 07/26/2012 01:09 PM, Alexander Solla wrote: On 7/25/12, Christian Sternagel c.sterna...@gmail.com wrote: On 07/26/2012 11:53 AM, Alexander Solla wrote: The classically valid inference: (x == y) = _|_ = (y == x)

Re: [Haskell-cafe] Applicative functors with branch/choice ?

2012-07-26 Thread Ross Paterson
On Wed, Jul 25, 2012 at 09:22:23PM +0100, Евгений Пермяков wrote: So, it seems for me, that Applicative API should be extended with typeclass for making choice what actions to execute depending on result of some test (pattern matching). Is there any reasonable definition of such typeclass

Re: [Haskell-cafe] Applicative functors with branch/choice ?

2012-07-26 Thread Евгений Пермяков
well... This code is both demonstration for use case and more sane class + instance typeclass name is selected quite randomly, may be native speaker will select a better one module Actuative where import Control.Applicative import System.IO import System.IO.Error -- | minimal complete

Re: [Haskell-cafe] Applicative functors with branch/choice ?

2012-07-26 Thread Twan van Laarhoven
On 26/07/12 12:40, Евгений Пермяков wrote: class Applicative f = Actuative f where -- | select computation conditionally . Side effects of only one two alternative take place select :: f (Either a b) -- ^ selector - f (a - c) -- ^ first alternative -

Re: [Haskell-cafe] Applicative functors with branch/choice ?

2012-07-26 Thread Евгений Пермяков
May be difference will be more clear with this example ? import Control.Monad.State instance (Functor m, Monad m) = Actuative (StateT s m) where select i l r = do iv - i case iv of Left lv - l = \lf - return (lf lv) Right rv - r = \rf - return (rf rv) select' xs fs gs = sel $

Re: [Haskell-cafe] Applicative functors with branch/choice ?

2012-07-26 Thread Twan van Laarhoven
On 26/07/12 13:58, Евгений Пермяков wrote: As you can see, if I use select definition with Control.Applicative.*, I'll execute both l and r and the only choice will be, what result to drop. Both l and r, however, will be executed, and their side effects will take place. With select from my code

[Haskell-cafe] Haskell on Mac OS X Mountain Lion

2012-07-26 Thread mrbuchmann
Hi all, does the Haskell Platform (2012.2.0.0 I suppose) work on 10.8. http://hackage.haskell.org/platform/mac.html only says something about 10.7. I don't want to break my development system due to upgrading to 10.8, so if anybody has any experience regarding this topic, please let me know.

[Haskell-cafe] Making extra GMP bindings

2012-07-26 Thread Robin Morisset
Hello, We haven't found mpz_nextprime in the list of gmp functions that have bindings in integer-gmp, and we would like to call it from a Haskell project. We have first looked at a few simple examples of using the FFI but found several difficulties: - The mapping between Integer and the C

[Haskell-cafe] GHC type error pretty printing

2012-07-26 Thread Christopher Done
Is it me or is this output not right? The \ syntax doesn't indicate a newline. chris@midnight:~$ ghci GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ...

[Haskell-cafe] FP Developers Conference

2012-07-26 Thread Bartosz Milewski
Alex Miller is the organizer of a very successful Strange Loop developers conference in St Luis. He also happens to be a Closure programmer. He wants to organize a Functional Programming Developers Conference in the US (stress on _developers_). He will probably succeed, so it's very important that

Re: [Haskell-cafe] Haskell on Mac OS X Mountain Lion

2012-07-26 Thread Bryan O'Sullivan
On Thu, Jul 26, 2012 at 9:19 AM, mrbuchm...@googlemail.com wrote: does the Haskell Platform (2012.2.0.0 I suppose) work on 10.8. Yes. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is (==) commutative?

2012-07-26 Thread Joachim Breitner
[Re-sent as my first post did not make it through.] Hi Christian, Am Mittwoch, den 25.07.2012, 10:19 +0900 schrieb Christian Sternagel: Btw: Isabelle/HOLCF unifies all error values and nontermination in a single bottom element _|_. Currently we are using the following axioms for our formal