Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-15 Thread wren ng thornton
On 8/13/12 5:42 PM, Jay Sulzberger wrote: One difficulty which must impede many who study this stuff is that just getting off the ground seems to require a large number of definitions of objects of logically different kinds. (By logic I mean real logic, not any particular formalized system.) We

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread wren ng thornton
On 8/13/12 9:25 PM, Jay Sulzberger wrote: I did suspect that, in some sense, constraints in combination with forall could give the quantifier exists. It's even easier than that. (forall a. P(a)) - Q = exists a. (P(a) - Q) Where P and Q are metatheoretic/schematic variables. This is

Re: [Haskell-cafe] For consistency; it would be better if the import statement matched the cabal install statement or :m form.

2012-08-15 Thread Ivan Lazar Miljenovic
On 15 August 2012 13:04, KC kc1...@gmail.com wrote: :m +Data.Array.Repa.Algorithms.Randomish cabal install repa.algrothms would be more consistent. Why would that be? They look completely different to me... -- -- Regards, KC -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com

[Haskell-cafe] Improvement suggestions

2012-08-15 Thread José Lopes
Hello everyone, I am quite new to monadic code so I would like to ask for improvement suggestions on the last line of the code below. I know I could do something like do strs - mapM ...; intercalate ... etc, but I would like to avoid the use of -. Thank you, José data XmlState = XmlState

[Haskell-cafe] Upcoming resourcet 0.4

2012-08-15 Thread Michael Snoyman
Hi all, I've been working with Aristid on an enhancement to resourcet[1]. Please see the issue for more details, this email isn't about that change. Instead, now that we're looking at a new breaking release, I was wondering if anyone had ideas of something they thought should be changed in

Re: [Haskell-cafe] Improvement suggestions

2012-08-15 Thread Twan van Laarhoven
On 15/08/12 17:01, José Lopes wrote: someFn docs = return concat `ap` (sequence $ intersperse (return \n) (map loop docs)) First of all, return x `ap` y = x `fmap` y or x $ y. fmap (or its infix synonym ($)) is the answer here, you could write: someFn docs = concat . intersperse \n $

Re: [Haskell-cafe] Improvement suggestions

2012-08-15 Thread Clark Gaebel
Try: concat . intersperse \n $ (sequence $ map loop docs) On Wed, Aug 15, 2012 at 11:01 AM, José Lopes jose.lo...@ist.utl.pt wrote: Hello everyone, I am quite new to monadic code so I would like to ask for improvement suggestions on the last line of the code below. I know I could do

Re: [Haskell-cafe] Improvement suggestions

2012-08-15 Thread José Lopes
Thank you. On 15-08-2012 23:09, Twan van Laarhoven wrote: On 15/08/12 17:01, José Lopes wrote: someFn docs = return concat `ap` (sequence $ intersperse (return \n) (map loop docs)) First of all, return x `ap` y = x `fmap` y or x $ y. fmap (or its infix synonym ($)) is the answer here,

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread David Feuer
On Aug 15, 2012 3:21 AM, wren ng thornton w...@freegeek.org wrote: It's even easier than that. (forall a. P(a)) - Q = exists a. (P(a) - Q) Where P and Q are metatheoretic/schematic variables. This is just the usual thing about antecedents being in a negative position, and thus flipping

[Haskell-cafe] [Pipes] Can pipes solve this problem? How?

2012-08-15 Thread Daniel Hlynskyi
Hello Cafe. Consider code, that takes input from handle until special substring matched: matchInf a res s | a `isPrefixOf` s = reverse res matchInf a res (c:cs) = matchInf a (c:res) cs hTakeWhileNotFound str hdl = hGetContents hdl = return.matchInf str [] It is simple, but

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread Albert Y. C. Lai
On 12-08-15 03:20 AM, wren ng thornton wrote: (forall a. P(a)) - Q = exists a. (P(a) - Q) For example: A. (forall p. p drinks) - (everyone drinks) B. exists p. ((p drinks) - (everyone drinks)) In a recent poll, 100% of respondents think A true, 90% of them think B paradoxical, and

[Haskell-cafe] Custom QuickCheck Gens without custom shrinks

2012-08-15 Thread Niklas Hambüchen
I wrote this Gen to generate lines of texts without \NUL and \n: fullLinesProp = forAll linesGen ... linesGen = listOf . listOf $ arbitrary `suchThat` (`notElem` ['\NUL', '\n']) -- alternatively: linesGen = arbitrary `suchThat` (all (all (`notElem` ['\NUL', '\n']))) However, I

[Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Bryan O'Sullivan
Hi, folks - I'm sure we are all familiar with the phrase cabal dependency hell at this point, as the number of projects on Hackage that are intended to hack around the problem slowly grows. I am currently undergoing a fresh visit to that unhappy realm, as I try to rebuild some of my packages to

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread Ryan Ingram
In classical logic A - B is the equivalent to ~A v B (with ~ = not and v = or) So (forall a. P(a)) - Q {implication = not-or} ~(forall a. P(a)) v Q {forall a. X is equivalent to there does not exist a such that X doesn't hold} ~(~exists a. ~P(a)) v Q {double negation elimination}

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Johan Tibell
On Wed, Aug 15, 2012 at 12:38 PM, Bryan O'Sullivan b...@serpentine.com wrote: I propose that the sense of the recommendation around upper bounds in the PVP be reversed: upper bounds should be specified only when there is a known problem with a new version of a depended-upon package. This

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Brandon Allbery
On Wed, Aug 15, 2012 at 3:57 PM, Johan Tibell johan.tib...@gmail.comwrote: On Wed, Aug 15, 2012 at 12:38 PM, Bryan O'Sullivan b...@serpentine.com wrote: I propose that the sense of the recommendation around upper bounds in the PVP be reversed: upper bounds should be specified only when

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Bryan O'Sullivan
On Wed, Aug 15, 2012 at 1:02 PM, Brandon Allbery allber...@gmail.comwrote: So we are certain that the rounds of failures that led to their being *added* will never happen again? Of course I am sure that problems will arise as a result of recommending that upper bounds be added reactively;

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Johan Tibell
On Wed, Aug 15, 2012 at 1:02 PM, Brandon Allbery allber...@gmail.com wrote: So we are certain that the rounds of failures that led to their being *added* will never happen again? It would be useful to have some examples of these. I'm not sure we had any when we wrote the policy (but Duncan

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread David Thomas
Would it make sense to have a known-to-be-stable-though soft upper bound added proactively, and a known-to-break-above hard bound added reactively, so people can loosen gracefully as appropriate? On Aug 15, 2012 1:45 PM, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Aug 15, 2012 at 1:02 PM,

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Bryan O'Sullivan
On Wed, Aug 15, 2012 at 1:50 PM, David Thomas davidleotho...@gmail.comwrote: Would it make sense to have a known-to-be-stable-though soft upper bound added proactively, and a known-to-break-above hard bound added reactively, so people can loosen gracefully as appropriate? I don't think so. It

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Michael Blume
it's usual for the existing upper bounds to refer to versions that don't exist at the time of writing (and hence can't be known to be stable). Well, known to be stable given semantic versioning, then. http://semver.org/ On Wed, Aug 15, 2012 at 1:55 PM, Bryan O'Sullivan b...@serpentine.com

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Carter Schonwald
As someone who recurrently is nudging a large number of maintainers every major ghc release to bump their bounds, I favor the no upper bounds approach! :) plus the whole improving ecosystem of build bot tools which play nice with cabal et al that are cropping up mean that in principal we could

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Lorenzo Bolla
I definitely agree! http://www.reddit.com/r/haskell/comments/x4knd/what_is_the_reason_for_haskells_cabal_package/ L. On Wed, Aug 15, 2012 at 12:38:33PM -0700, Bryan O'Sullivan wrote: Hi, folks - I'm sure we are all familiar with the phrase cabal dependency hell at this point, as the number

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Brandon Allbery
On Wed, Aug 15, 2012 at 4:44 PM, Johan Tibell johan.tib...@gmail.comwrote: On Wed, Aug 15, 2012 at 1:02 PM, Brandon Allbery allber...@gmail.com wrote: So we are certain that the rounds of failures that led to their being *added* will never happen again? It would be useful to have some

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Carter Schonwald
no one is disputing that there are conditional changes in dependencies depending on library versions. an interesting intermediate point would be have a notion of testing with constraints in cabal and engineering cabal to support a --withTestedConstraints to have a simple composable way of

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Michael Sloan
Upper bounds are a bit of a catch-22 when it comes to library authors evolving their APIs: 1) If library clients aren't encouraged to specify which version of the exported API they target, then changing APIs can lead to opaque compile errors (without any information about which API is

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Brandon Allbery
On Wed, Aug 15, 2012 at 6:46 PM, Carter Schonwald carter.schonw...@gmail.com wrote: no one is disputing that there are conditional changes in dependencies depending on library versions. Indeed. But the ghc release that split up base broke cabalised packages with no warning to users until

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread David Feuer
I understand this now, though I still don't understand the context. Thanks! I managed to mix up implication with causation, to my great embarrassment. On Aug 15, 2012 3:39 PM, Ryan Ingram ryani.s...@gmail.com wrote: In classical logic A - B is the equivalent to ~A v B (with ~ = not and v = or)

[Haskell-cafe] Haskell Weekly News: Issue 240

2012-08-15 Thread Daniel Santa Cruz
Welcome to issue 240 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of August 05 to 11, 2012. Quotes of the Week * johnw: Monads are an interface, all bets are off until you see what the interface does for a

Re: [Haskell-cafe] Custom QuickCheck Gens without custom shrinks

2012-08-15 Thread Niklas Hambüchen
Oh, this is silly. Of course it is: forAllShrink linesGen shrink ... On 15/08/12 20:35, Niklas Hambüchen wrote: I wrote this Gen to generate lines of texts without \NUL and \n: fullLinesProp = forAll linesGen ... linesGen = listOf . listOf $ arbitrary `suchThat` (`notElem`

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Ivan Lazar Miljenovic
On 16 August 2012 08:55, Brandon Allbery allber...@gmail.com wrote: On Wed, Aug 15, 2012 at 6:46 PM, Carter Schonwald carter.schonw...@gmail.com wrote: no one is disputing that there are conditional changes in dependencies depending on library versions. Indeed. But the ghc release that

[Haskell-cafe] Does someone have a compiled binary of the LLVM for Windows 7 or must one compile the source?

2012-08-15 Thread KC
I just want to get started on some matrix operations with REPA. Or is there a library (package?) like REPA without using the LLVM? -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Does someone have a compiled binary of the LLVM for Windows 7 or must one compile the source?

2012-08-15 Thread Ivan Lazar Miljenovic
On 16 August 2012 11:21, KC kc1...@gmail.com wrote: I just want to get started on some matrix operations with REPA. Or is there a library (package?) like REPA without using the LLVM? If you're referring to your recent problems with repa-algorithms, you can try this: cabal unpack

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Conrad Parker
On 16 August 2012 03:38, Bryan O'Sullivan b...@serpentine.com wrote: Hi, folks - I'm sure we are all familiar with the phrase cabal dependency hell at this point, as the number of projects on Hackage that are intended to hack around the problem slowly grows. I am currently undergoing a

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread MightyByte
On Wed, Aug 15, 2012 at 9:19 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 16 August 2012 08:55, Brandon Allbery allber...@gmail.com wrote: Indeed. But the ghc release that split up base broke cabalised packages with no warning to users until they failed to compile. Upper

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Brandon Allbery
On Wed, Aug 15, 2012 at 11:02 PM, MightyByte mightyb...@gmail.com wrote: be to add a flag to Cabal/cabal-install that would cause it to ignore upper bounds. (Frankly, I think it would also be great if Ignore, or at least treat them as being like flags... if the versions don't converge with

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Michael Snoyman
On Thu, Aug 16, 2012 at 5:38 AM, Conrad Parker con...@metadecks.org wrote: On 16 August 2012 03:38, Bryan O'Sullivan b...@serpentine.com wrote: Hi, folks - I'm sure we are all familiar with the phrase cabal dependency hell at this point, as the number of projects on Hackage that are