Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-27 Thread Robin KAY
Hello, Keshav Kini wrote: [snip] However, there are newish bindings [2] for the Qt Quick declarative UI stuff that's appeared in recent Qt versions -- see the package hsqml on hackage [3]. It hasn't had any new uploads to hackage since last year, but there was activity on its repo as recently

Re: [Haskell-cafe] Music update

2013-09-27 Thread Mark Lentczner
Yes, video was shot and several audio recordings taken. I'm mastering the audio and expect to have something in a week to share. On Mon, Sep 23, 2013 at 4:21 AM, Dan Krol orbliv...@gmail.com wrote: Will there be a video of the live premier? On Fri, Sep 20, 2013 at 12:14 PM, Mark Lentczner

[Haskell-cafe] Proposal: new function for lifting

2013-09-27 Thread Thiago Negri
Everybody is claiming that using lift is a bad thing. So, I come to remedy this problem. Stop lifting, start using shinny operators like this one: (^$) :: Monad m = m a - (a - b - c) - m b - m c (^$) = flip liftM2 Then you can do wonderful stuff and you will never read the four-letter

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-27 Thread Keshav Kini
Robin KAY komad...@gekkou.co.uk writes: Yes, I'm afraid I've been failing to embrace the release early release often mantra with HsQML. I originally set myself some (fairly modest) goals for the next release. Unfortunately, I've had less time to spend on it than I'd like and it's delayed

[Haskell-cafe] [ANN] New OpenCV Bindings

2013-09-27 Thread Arjun Comar
Hi all, I've been hard at work on a new set of OpenCV bindings that will hopefully solve a lot of the shortcomings with previous attempts. An automatic header parser has been used to generate a full set of Haskell bindings for the C++ API, and I'm now working to create a pleasant Haskell API. The

Re: [Haskell-cafe] Proposal: new function for lifting

2013-09-27 Thread Wvv
Which lift? This one? class MonadTrans t where lift :: Monad m = m a - t m a -- View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-new-function-for-lifting-tp5737189p5737196.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Re: [Haskell-cafe] Proposal: new function for lifting

2013-09-27 Thread Nick Vanderweit
Sorry for sending this twice; I didn't reply to the list initially. I thought people [1] were generally talking about lift from Control.Monad.Trans: class MonadTrans t where lift :: Monad m = m a - t m a The idea being that lifting through a monad stack feels tedious. The proposed solution

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-27 Thread Jason Dagit
On Thu, Sep 26, 2013 at 8:32 PM, Conal Elliott co...@conal.net wrote: I'm polling to see whether there are will and expertise to reboot graphics and GUIs work in Haskell. I miss working on functional graphics and GUIs in Haskell, as I've been blocked for several years (eight?) due to the

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-27 Thread Henk-Jan van Tuyl
On Fri, 27 Sep 2013 05:32:18 +0200, Conal Elliott co...@conal.net wrote: I'm polling to see whether there are will and expertise to reboot graphics and GUIs work in Haskell. : * cross-platform, * easily buildable, * GHCi-friendly, and * OpenGL-compatible. : wxHaskell (whose API and visual

[Haskell-cafe] Non-termination using Free Monads and Data Types a la Carte

2013-09-27 Thread Alexander Solla
I am trying to use a data types a la carte approach to define a free monad for templating purposes. I am using Edward Kmett's free package, and a module implementing data types a la carte's injections, modelled on the IOSpec Types module. I have written a few combinators, but I am stuck. My

Re: [Haskell-cafe] [ANN] New OpenCV Bindings

2013-09-27 Thread Arjun Comar
After receiving feedback, I went ahead and split out the raw C wrappers and Haskell bindings. You can find them at www.github.com/arjuncomar/opencv-raw. I'll upload it to hackage as opencv-raw once I have uploader privileges. Regards, Arjun On Fri, Sep 27, 2013 at 4:09 PM, Arjun Comar

Re: [Haskell-cafe] [GSoC 2013] Porting Charts to Diagrams - Final Report

2013-09-26 Thread Daniel Santa Cruz
Awesome work, Jan. I'm looking forward to playing around with the new libs! As a side note, what did you use to generate your email? Did you manage all the footnotes by hand? Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Looking for numbers to support using haskell

2013-09-26 Thread Mike Meyer
The fpcomplete case studies are similar to what I'm looking for. Anyone have more of them? Maybe a blog post or comparison they've written? Thanks, mike On Mon, Sep 23, 2013 at 5:05 PM, Eric Rasmussen ericrasmus...@gmail.comwrote: Hi Nick, FP Complete has a lot of good resources on this

[Haskell-cafe] FP Complete competition clarification

2013-09-26 Thread Mike Meyer
I got some clarification on what unpublished means for FP Complete competition entries. Basically, you can enter code that you've already published, providing it has an appropriate license (or can be republished with such a license). The tutorial/description/documentation that shows how to use it

[Haskell-cafe] Fwd: [GSoC 2013] Porting Charts to Diagrams - Final Report

2013-09-26 Thread Jan Bracker
Hello everybody, I am sorry to send this a second time. Someone hinted out that I would not reach everybody on the mailing list through the Google Groups address. I should have looked a bit more thoroughly. The Google Summer of Code 2013 is over! My project to port the charts [0] library to use

Re: [Haskell-cafe] Hackage 2 switchover imminent

2013-09-26 Thread Duncan Coutts
On 24 September 2013 22:38, Duncan Coutts dun...@well-typed.com wrote: Hi everyone, Having been running the Hackage 2 alpha beta for several months we intend to do the final switchover tomorrow (Wednesday 25th Sept). This will involve disabling uploads to the old server for a few hours. If

Re: [Haskell-cafe] FP Complete competition clarification

2013-09-26 Thread Ivan Perez
Thank you, Mike. This is definitely not the answer I got when I contacted FP more than a month ago. It's good to see that they are broadening the definition :) On 26 September 2013 18:35, Mike Meyer m...@mired.org wrote: I got some clarification on what unpublished means for FP Complete

Re: [Haskell-cafe] Why superclass' instances are bad idea?

2013-09-26 Thread Wvv
Thanks a lot! This makes clear. I haven't noticed before that OverlappingInstances don't look at constraint! John Lato-2 wrote This line instance Monad m = Applicative m where tells the compiler Every type (of the appropriate kind) is an instance of Applicative. And it needs to have

Re: [Haskell-cafe] Looking for numbers to support using haskell

2013-09-26 Thread Carter Schonwald
you can also look at the CUFP talks by various folks doing haskell based businesses in the past year or several. worth watching some of them On Thu, Sep 26, 2013 at 12:14 PM, Mike Meyer m...@mired.org wrote: The fpcomplete case studies are similar to what I'm looking for. Anyone have more of

[Haskell-cafe] Proposal: RankedInstances

2013-09-26 Thread Wvv
The main power of Haskell is on instances. But Haskell instances system work fine with lower number of instances (rare instances). But we want hight density of instances! If we wish to have more selective instances we use `OverlappingInstances` (which are desined in a poor way) and if we still

[Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-26 Thread Conal Elliott
I'm polling to see whether there are will and expertise to reboot graphics and GUIs work in Haskell. I miss working on functional graphics and GUIs in Haskell, as I've been blocked for several years (eight?) due to the absence of low-level foundation libraries having the following properties: *

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-26 Thread aditya siram
Hi Conal, I'm glad you're bringing this up. I am currently working on FLTK bindings ( github.com/deech/fltkhs). It's main advantage of this toolkit is that it lets the user deploy apps as a self-contained binary on all platforms. Right now the work consists of the tedium of binding Haskell to the

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-26 Thread KC
What does the following mean? About three years ago, I built a modern replacement of my old Pan and Vertigo systems (optimized high-level functional graphics in 2D and 3D), generating screamingly fast GPU rendering code. I'd love to share it with the community, but I'm unable to use it even

[Haskell-cafe] [ANNOUNCE] cereal-0.4.0.0

2013-09-26 Thread Trevor Elliott
Hi Everyone, I'm happy to announce the newest release of the cereal[1] binary serialization library. This includes a number of bug fixes, as well as instances of Serialize for the newtypes defined in Data.Monoid. Happy hacking! --trevor [1]

Re: [Haskell-cafe] Poll plea: State of GUI graphics libraries in Haskell

2013-09-26 Thread Conrad Parker
Hi Conal! Yes. I'd be very interested to help get Pan and Vertigo working. Do you have a repo somewhere? Conrad. On 27 September 2013 13:32, Conal Elliott co...@conal.net wrote: I'm polling to see whether there are will and expertise to reboot graphics and GUIs work in Haskell. I miss

Re: [Haskell-cafe] Problem with HXT `when`

2013-09-25 Thread Vlatko Basic
Hi Albert, thanks for your answer. It helped in some other issues I have. I did experiment with parenthesis, but obviously not in the right place. I found the filterA arrow to do the thing I want, like this: getRowWithHeading caption = filterA (deep (hasName th / hasText (==caption)

Re: [Haskell-cafe] Hackage 2 switchover imminent

2013-09-25 Thread Duncan Coutts
On 24 September 2013 22:38, Duncan Coutts dun...@well-typed.com wrote: For issues with accounts or permissions please contact the administrators by email at adm...@hackage.haskell.org Sorry, that should be: ad...@hackage.haskell.org Ie singular admin, not plural. I got myself confused because

[Haskell-cafe] Haskell Weekly News: Issue 281

2013-09-25 Thread Daniel Santa Cruz
Welcome to issue 281 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of September 15 to 21, 2013. Quotes of the Week * jmcarthur: weak algebraic structures? ha! i prefer my algebraic structures to put up more

[Haskell-cafe] Haskell Job Opportunity (Remote Work)

2013-09-25 Thread Benny
Hello, ShotVibe is an early-stage Israeli startup company in the mobile photo sharing space. We are looking for an experienced or expert level Haskell programmer for backend web related projects. The work will be done by you remotely, using a freelancer model, with the potential for longer term

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-24 Thread Sven Panne
2013/9/22 Mike Meyer m...@mired.org: On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson s...@scientician.net wrote: Trying to make something whose name is Not A Number act like a number sounds broken from the start. The point here is that IEEE floats are actually more something like a Maybe

[Haskell-cafe] Hackathon der Frankfurt-Haskell-User-Group

2013-09-24 Thread Peter Althainz
the Frankfurt Haskell User Group announces its first Hackathon, if interested, see here: http://www.meetup.com/Frankfurt-Haskell-User-Group/events/138895112/ Peter Althainz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-24 Thread Stijn van Drongelen
On Tue, Sep 24, 2013 at 5:39 PM, Sven Panne svenpa...@gmail.com wrote: 2013/9/22 Mike Meyer m...@mired.org: On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson s...@scientician.net wrote: Trying to make something whose name is Not A Number act like a number sounds broken from the start.

[Haskell-cafe] Why superclass' instances are bad idea?

2013-09-24 Thread Wvv
I suggest to add superclass' instances into libraries. http://ghc.haskell.org/trac/ghc/ticket/8348 In brief, we could write next: {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} instance Monad m = Applicative m where pure = return (*) = ap instance

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-24 Thread John Lato
On Tue, Sep 24, 2013 at 11:36 AM, Stijn van Drongelen rhym...@gmail.comwrote: On Tue, Sep 24, 2013 at 5:39 PM, Sven Panne svenpa...@gmail.com wrote: 2013/9/22 Mike Meyer m...@mired.org: On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson s...@scientician.net wrote: Trying to make

Re: [Haskell-cafe] Problem with HXT `when`

2013-09-24 Thread Albert Y. C. Lai
On 13-09-21 05:13 AM, Vlatko Basic wrote: I'd like to extract A texts from row with header Caption, and have come up with this runX $ doc (deep (hasName tr) -- filter only TRs withTraceLevel 5 traceTree -- shows

[Haskell-cafe] Hackage 2 switchover imminent

2013-09-24 Thread Duncan Coutts
Hi everyone, Having been running the Hackage 2 alpha beta for several months we intend to do the final switchover tomorrow (Wednesday 25th Sept). This will involve disabling uploads to the old server for a few hours. If all goes well we will switch the DNS over. If anything goes wrong we will

Re: [Haskell-cafe] Why superclass' instances are bad idea?

2013-09-24 Thread John Lato
This line instance Monad m = Applicative m where tells the compiler Every type (of the appropriate kind) is an instance of Applicative. And it needs to have a Monad instance as well. That's what Edward means when he said that it means every Applicative is a Monad. Theoretically the

[Haskell-cafe] A thought on the LinkedIn spam and an upstream spam filter

2013-09-23 Thread damodar kulkarni
Hello, Sorry for dwelling on a spammy topic. If you are NOT interested in this then please accept my regret and let me assure you that this is NOT to add to the existing spam. If you still are unconvinced, then the only thing I can tell you is sorry, accept my apologies for wasting your time and

Re: [Haskell-cafe] A thought on the LinkedIn spam and an upstream spam filter

2013-09-23 Thread Vo Minh Thu
Hi, Thanks for the heads-up. I have just checked my email addresses registered on linkedin: I had three of them, my regular email address (this one), me previous work address, which I never added myself, and haskell-cafe, which I did not add myself either. My regular address was labeled as

[Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Miro Karpis
Please, can you help me with following: I have an external dll that I'm importing in my haskell program. In some particular cases the dll crashes. Simplified: first I need to send to dll with MethodA some parameters and then call MethodB to do some calculations on those parameters. If I didn't

Re: [Haskell-cafe] PSA: do not install xcode 5 if you are using ghc 7.6

2013-09-23 Thread Edsko de Vries
Just to add to Carter's message: if you happened to install Xcode 5 anyway, then realized your mistake and uninstalled it and installed Xcode 4 again, you will STILL have the command line tools that came with Xcode 5 and your Haskell toolchain will STILL be broken -- and so far I have been unable

[Haskell-cafe] Embedding compiled Haskell Platform in custom application

2013-09-23 Thread blackbox.dev.ml
Hi! I'm writing a tool that generates haskell code, build it with cabal and launch it. I want to deliver that tool to clients, but I don't want to force them, to install system wide any specific ghc or cabal version. How can I embed compiled ghc, cabal and selected libraries (for specific

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Niklas Hambüchen
If you cannot do it with Haskell exceptions, I guess you need to look how you would do it in plain C in do the same. Keep in mind that if something crashes in a C library, that library might have corrupted (or leaked) any memory it had access to. I guess a somewhat reliable way is to fork an

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Miro Karpis
Hi Niklas, I think that I'm doing this in my try2 function with tryAny and catchAny functions. Unfortunately that didn't work. I'm just starting with Haskell so maybe also my implementation of my haskell code is not 100% correct. cheers, m. On Mon, Sep 23, 2013 at 1:36 PM, Niklas Hambüchen

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Niklas Hambüchen
Hey, I don't think any of your code actually forks of an *OS process*. There three main kinds of threading constructs: * Haskell threads (forkIO) * Operating System threads (forkOS) * Operating System processes (forkProcess, fork() in C) Async uses the first one, you will need last one (which

Re: [Haskell-cafe] Embedding compiled Haskell Platform in custom application

2013-09-23 Thread Henk-Jan van Tuyl
On Mon, 23 Sep 2013 14:03:00 +0200, blackbox.dev.ml blackbox.dev...@gmail.com wrote: Hi! I'm writing a tool that generates haskell code, build it with cabal and launch it. I want to deliver that tool to clients, but I don't want to force them, to install system wide any specific ghc or cabal

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Miro Karpis
Thanks for that. I checked forkProcess - which is packed in POSIX module. I'm building under windows. Do I need to go via cygwin, is there some other way for creating new OS process? m. On Mon, Sep 23, 2013 at 1:46 PM, Niklas Hambüchen m...@nh2.me wrote: Hey, I don't think any of your code

[Haskell-cafe] Looking for numbers to support using haskell

2013-09-23 Thread Mike Meyer
Hi all, I'm looking for articles that provide some technical support for why Haskell rocks. Not just cheerleading, but something with a bit of real information in it - a comparison of code snippets in multiple languages, or the results of a study on programmer productivity (given all the noise

Re: [Haskell-cafe] Creating a local Hoogle ...

2013-09-23 Thread John Wiegley
aditya siram aditya.si...@gmail.com writes: Combining 4263 databases hoogle: embroidery.hoo: openFile: resource exhausted (Too many open files) Any help is appreciated. Thanks! I created the 'rehoo' utility to solve this very problem. Change directory to where your .hoo files are, and run:

Re: [Haskell-cafe] Looking for numbers to support using haskell

2013-09-23 Thread MigMit
The classical reference is, I think, the paper “Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software Prototyping Productivity” On Sep 23, 2013, at 9:20 PM, Mike Meyer m...@mired.org wrote: Hi all, I'm looking for articles that provide some technical support for why Haskell

Re: [Haskell-cafe] Looking for numbers to support using haskell

2013-09-23 Thread Nick Vanderweit
I'd be interested in more studies in this space. Does anyone know of empirical studies on program robustness vs. other languages? Nick On 09/23/2013 11:31 AM, MigMit wrote: The classical reference is, I think, the paper “Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software

Re: [Haskell-cafe] Strange exit status behavior from the process package

2013-09-23 Thread Michael Xavier
Could I trouble you or anyone else to help me implement this feature? I have some test processes, one that exits cleanly on sigterm and one that refuses and must be killed abruptly. In some experimentation on GHCi, things seem to go alright, but in test, either process reports that it has

Re: [Haskell-cafe] Looking for numbers to support using haskell

2013-09-23 Thread Eric Rasmussen
Hi Nick, FP Complete has a lot of good resources on this topic, including some case studies: https://www.fpcomplete.com/business/resources/case-studies/ I believe part of their aim is making the business case for Haskell (meaning many of the resources are geared towards management), which I

[Haskell-cafe] Minh Thu, please add me to your LinkedIn network

2013-09-22 Thread Kyle Hanson via LinkedIn
LinkedIn Kyle Hanson requested to add you as a connection on LinkedIn: -- Minh Thu, I'd like to add you to my professional network on LinkedIn. - Kyle Accept invitation from Kyle Hanson

Re: [Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-22 Thread TP
TP wrote: But I have still a question: is the behavior of GHC correct in the example of my initial post? See here: http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/type-class-extensions.html#instance-overlap When matching, GHC takes no account of the context of the instance

Re: [Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-22 Thread adam vogt
On Sun, Sep 22, 2013 at 11:07 AM, TP paratribulati...@free.fr wrote: My misunderstanding came from a confusion between a context and a constraint. The context is what is before the =, and the constraint is what is after, i.e. the main part of the instance declaration. Hi TP, I think context

Re: [Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-22 Thread TP
adam vogt wrote: I think context and constraint mean the same thing. The haskell report uses the word context for http://www.haskell.org/onlinereport/decls.html for the whole list and constraint for one part of that list (Eq a). With the extension -XConstraintKinds both of those are called

Re: [Haskell-cafe] Minh Thu, please add me to your LinkedIn network

2013-09-22 Thread damodar kulkarni
What a surprise, I didn't know the real name of Haskell Cafe till date, BUT today I came to know it: it is Minh Thu V. linked in sucks ... Thanks and regards, -Damodar Kulkarni On Sun, Sep 22, 2013 at 2:53 PM, Kyle Hanson via LinkedIn mem...@linkedin.com wrote: [image: LinkedIn]

Re: [Haskell-cafe] Music update

2013-09-22 Thread Dan Krol
Will there be a video of the live premier? On Fri, Sep 20, 2013 at 12:14 PM, Mark Lentczner mark.lentcz...@gmail.comwrote: Some might remember me asking about music packages a while back... An update: I ended up using Euterpea, which in turn uses both Codec.Midi and Sound.PortMidi. My

[Haskell-cafe] Cabal install build of scion-browser 0.2.18 fails when linking Persistent-sqlite1.21

2013-09-22 Thread Stephen Taylor
Hi I'm a Haskell newbie. I just installed Haskell on Windows 7 x64 (Haskell Platform 2013.2.0.0 containing GHC 7.6.3), and have been using cabal-install to build/install from Hackage all the helper executables required and/or supported by EclipseFP, the Eclipse Haskell Plugin. All the helper

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-22 Thread Richard A. O'Keefe
On 20/09/2013, at 11:47 PM, damodar kulkarni wrote: There is an Eq instance defined for these types! So I tried this: *Main sqrt (10.0) ==3.1622776601683795 True *Main sqrt (10.0) ==3.16227766016837956 True *Main sqrt (10.0) ==3.1622776601683795643 True *Main sqrt (10.0)

[Haskell-cafe] GSoC Result - Communicating with Mobile devices - Push Notifications

2013-09-22 Thread Marcos Pividori
I am happy to announce the result of 3 months working on the GSoC project: Communicating with mobile devices. After reading many documentation, looking for a good abstraction, learning about mobile apps and networks connections, and really valuable recommendations from my mentor, (I really want to

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread damodar kulkarni
Making floats not be an instance of Eq will just cause those people to ask Why can't I compare floats for equality?. This will lead to pretty much the same explanation. Yes, and then all the torrent of explanation I got here about the intricacies of floating point operations would seem more

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Bardur Arantsson
On 2013-09-21 06:16, Mike Meyer wrote: The single biggest gotcha is that two calculations we expect to be equal often aren't. As a result of this, we warn people not to do equality comparison on floats. The Eq instance for Float violates at least one expected law of Eq: Prelude let nan =

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Stijn van Drongelen
I think you are trying to solve a problem that doesn't exist. * Float and Double are imprecise types by their very nature. That's exactly what people are forgetting, and exactly what's causing misunderstandings. Perhaps(!) it would be better to remove the option to use rational literals as

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Colin Adams
On 21 September 2013 08:34, Stijn van Drongelen rhym...@gmail.com wrote: * As mentioned, there is a total order (Ord) on floats (which is what you should be using when checking whether two approximations are approximately equal), which implies that there is also an equivalence relation (Eq).

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Stijn van Drongelen
On Sep 21, 2013 9:38 AM, Colin Adams colinpaulad...@gmail.com wrote: On 21 September 2013 08:34, Stijn van Drongelen rhym...@gmail.com wrote: * As mentioned, there is a total order (Ord) on floats (which is what you should be using when checking whether two approximations are approximately

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Mike Meyer
On Sat, Sep 21, 2013 at 2:21 AM, Bardur Arantsson s...@scientician.net wrote: On 2013-09-21 06:16, Mike Meyer wrote: The single biggest gotcha is that two calculations we expect to be equal often aren't. As a result of this, we warn people not to do equality comparison on floats. The Eq

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Stijn van Drongelen
On Sat, Sep 21, 2013 at 10:26 AM, Mike Meyer m...@mired.org wrote: On Sat, Sep 21, 2013 at 2:21 AM, Bardur Arantsson s...@scientician.net wrote: On 2013-09-21 06:16, Mike Meyer wrote: The single biggest gotcha is that two calculations we expect to be equal often aren't. As a result of

[Haskell-cafe] Problem with HXT `when`

2013-09-21 Thread Vlatko Basic
Hello Cafe, I have this HTML structure: ... table ... tr thCaption/th td a href=...Want this/a a href=...And this/a /td /tr tr thAnother caption/th td tr thYet another

[Haskell-cafe] using default declaration for overloaded numeric operations

2013-09-21 Thread TP
Hi, I try to develop an embedded domain specific language in Haskell. I don't want to type ::Rational all the time, so I try to use a default declaration for my types. This works correctly in this simple example: -- default (Integer, Double) -- default

Re: [Haskell-cafe] ANNOUNCE: New OpenGL packages

2013-09-21 Thread Ivan Perez
Thank you very much for the work. It is deeply appreciated. I'll test all of Keera's programs with these new versions and let you know if something comes up. Best regards Ivan On 15 September 2013 18:23, Sven Panne svenpa...@gmail.com wrote: New versions of the OpenGL packages are available

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Bob Hutchison
On 2013-09-21, at 4:46 AM, Stijn van Drongelen rhym...@gmail.com wrote: I do have to agree with Damodar Kulkarni that different laws imply different classes. However, this will break **a lot** of existing software. You could argue that the existing software is already broken. If we would

[Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-21 Thread TP
Hi everybody, I encouter some problem in my code in the following simple example: two instances overlap for the multiplication sign `*`. The `OverlappingInstances` extension is of no help because it seems GHC does not look at the instance context to decide which instance is the most specific.

Re: [Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-21 Thread adam vogt
Hi TP, You can add another instance to cover the case that everything is zero. Then you don't need the :. Also it's convenient to arrange for the a,b,c to be the argument to Tensor, as given below: class Multiplication a b c | a b - c where (*) :: Tensor a - Tensor b - Tensor c instance

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Stijn van Drongelen
On Sep 21, 2013 4:17 PM, Bob Hutchison hutch-li...@recursive.ca wrote: On 2013-09-21, at 4:46 AM, Stijn van Drongelen rhym...@gmail.com wrote: I do have to agree with Damodar Kulkarni that different laws imply different classes. However, this will break **a lot** of existing software. You

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Stuart A. Kurtz
Let me quibble. * Float and Double are imprecise types by their very nature. That's exactly what people are forgetting, and exactly what's causing misunderstandings. Float and Double are precise types. What is imprecise is the correspondence between finite precision floating point types

Re: [Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

2013-09-21 Thread TP
adam vogt wrote: You can add another instance to cover the case that everything is zero. Then you don't need the :. Also it's convenient to arrange for the a,b,c to be the argument to Tensor, as given below: class Multiplication a b c | a b - c where (*) :: Tensor a - Tensor b - Tensor

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Bardur Arantsson
On 2013-09-20 18:31, Brandon Allbery wrote: [--snip--] unless you have a very clever representation that can store in terms of some operation like sin(x) or ln(x).) I may just be hallucinating, but I think this is called describable numbers, i.e. numbers which can described by some (finite)

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 12:35 PM, Bardur Arantsson s...@scientician.netwrote: On 2013-09-20 18:31, Brandon Allbery wrote: [--snip--] unless you have a very clever representation that can store in terms of some operation like sin(x) or ln(x).) I may just be hallucinating, but I think this

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread David Thomas
Sure. An interesting, if not terribly relevant, fact is that there are more irrational numbers that we *can't* represent the above way than that we can (IIRC). However, those aren't actually interesting in solving the kinds of problems we want to solve with a programming language, so it's

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 12:43 PM, David Thomas davidleotho...@gmail.comwrote: Sure. An interesting, if not terribly relevant, fact is that there are more irrational numbers that we *can't* represent the above way than that we can (IIRC). I think that kinda follows from diagonalization... it

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread David Thomas
I think that's right, yeah. On Sat, Sep 21, 2013 at 9:49 AM, Brandon Allbery allber...@gmail.comwrote: On Sat, Sep 21, 2013 at 12:43 PM, David Thomas davidleotho...@gmail.comwrote: Sure. An interesting, if not terribly relevant, fact is that there are more irrational numbers that we

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Mike Meyer
On Sep 21, 2013 9:17 AM, Bob Hutchison hutch-li...@recursive.ca wrote: On 2013-09-21, at 4:46 AM, Stijn van Drongelen rhym...@gmail.com wrote: I do have to agree with Damodar Kulkarni that different laws imply different classes. However, this will break **a lot** of existing software. You could

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Bardur Arantsson
On 2013-09-21 23:08, Mike Meyer wrote: Exactly. The Eq and Ord instances aren't what's broken, at least when you're dealing with numbers (NaNs are another story). That there are pairs According to Haskell NaN *is* a number. Eq and Ord are just the messengers. No. When we declare something an

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Mike Meyer
On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson s...@scientician.net wrote: On 2013-09-21 23:08, Mike Meyer wrote: Exactly. The Eq and Ord instances aren't what's broken, at least when you're dealing with numbers (NaNs are another story). That there are pairs According to Haskell NaN *is*

[Haskell-cafe] Strange exit status behavior from the process package

2013-09-21 Thread Michael Xavier
I've run into some strangeness with the process package. When you kill some processes on the command line you correctly get a non-zero exit status. However when using the process package's terminateProcess (which sends a SIGTERM), it returns an ExitSuccess: module Main (main) where import

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Carter Schonwald
i had a longer email written out, but decided a shorter one is better. I warmly point folks to use libs like the numbers package on hackage http://hackage.haskell.org/packages/archive/numbers/2009.8.9/doc/html/Data-Number-BigFloat.html it has some great alternatives to standard floats and

[Haskell-cafe] Creating a local Hoogle ...

2013-09-21 Thread aditya siram
Hi all, I've installed Hoogle but am having issues creating the databases. I first did: `hoogle data all`, tried a search `hoogle [a] - a and got: Could not find some databases: default Searching in: . ~/.cabal/share/hoogle-4.2.21/databases Either the package does not exist or has not been

Re: [Haskell-cafe] Strange exit status behavior from the process package

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 11:12 PM, Michael Xavier mich...@michaelxavier.netwrote: I've run into some strangeness with the process package. When you kill some processes on the command line you correctly get a non-zero exit status. However when using the process package's terminateProcess (which

[Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread damodar kulkarni
Hello, There were some recent discussions on the floating point support in Haskell and some not-so-pleasant surprises people encountered. There is an Eq instance defined for these types! So I tried this: *Main sqrt (10.0) ==3.1622776601683795 True *Main sqrt (10.0) ==3.16227766016837956 True

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Scott Lawrence
On ghc 7.6.3: Prelude 3.16227766016837956 3.1622776601683795 So if you specify a number with greater-than-available precision, it will be truncated. This isn't an issue with (==), but with the necessary precision limitations of Double. On Fri, 20 Sep 2013, damodar kulkarni wrote: Hello,

[Haskell-cafe] Which builder to choose?

2013-09-20 Thread Alejandro Serrano Mena
Hi, I'm looking at the packages blaze-builder and bytestring, and both provide builders for ByteString. Which one should I use? In which situations is one more convenient than the other? Thanks for the help. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Which builder to choose?

2013-09-20 Thread Duncan Coutts
On Fri, 2013-09-20 at 14:57 +0200, Alejandro Serrano Mena wrote: Hi, I'm looking at the packages blaze-builder and bytestring, and both provide builders for ByteString. Which one should I use? In which situations is one more convenient than the other? I'd say the usual answer here would be

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Albert Y. C. Lai
On 13-09-20 07:47 AM, damodar kulkarni wrote: *Main sqrt (10.0) ==3.1622776601683795 True [...] *Main sqrt (10.0) ==3.16227766016837956435443343 True This is not even specific to Haskell. Every language that provides floating point and floating point equality does this. (To date,

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Brandon Allbery
On Fri, Sep 20, 2013 at 12:17 PM, damodar kulkarni kdamodar2...@gmail.comwrote: Ok, let's say it is the effect of truncation. But then how do you explain this? Prelude sqrt 10.0 == 3.1622776601683795 True Prelude sqrt 10.0 == 3.1622776601683796 True Because there's no reliable difference

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Tom Ellis
On Fri, Sep 20, 2013 at 06:34:04PM +0200, Stijn van Drongelen wrote: Please find yourself a copy of What Every Computer Scientist Should Know About Floating-Point Arithmetic by David Goldberg, and read it. It should be very enlightening. It explains a bit about how IEEE754, pretty much the

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Mike Meyer
On Fri, Sep 20, 2013 at 11:17 AM, damodar kulkarni kdamodar2...@gmail.com wrote: Ok, let's say it is the effect of truncation. But then how do you explain this? Oh, it's a trunaction error all right. Prelude sqrt 10.0 == 3.1622776601683795 True Prelude sqrt 10.0 == 3.1622776601683796 True

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread damodar kulkarni
Ok, let's say it is the effect of truncation. But then how do you explain this? Prelude sqrt 10.0 == 3.1622776601683795 True Prelude sqrt 10.0 == 3.1622776601683796 True Here, the last digit **within the same precision range** in the fractional part is different in the two cases (5 in the first

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Stijn van Drongelen
On Fri, Sep 20, 2013 at 6:17 PM, damodar kulkarni kdamodar2...@gmail.comwrote: Ok, let's say it is the effect of truncation. But then how do you explain this? Prelude sqrt 10.0 == 3.1622776601683795 True Prelude sqrt 10.0 == 3.1622776601683796 True Well, that's easy: λ: decodeFloat

<    1   2   3   4   5   6   7   8   9   10   >