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 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] Proposal: New syntax for Haskell

2013-09-14 Thread David Thomas
Honestly, I've not. Worth looking at, probably. On Thu, Sep 12, 2013 at 3:42 PM, Bob Ippolito b...@redivi.com wrote: Have you tried AppleScript? I wouldn't say it's pleasant to use, but it's easy to read. On Thursday, September 12, 2013, David Thomas wrote: I've long been interested

Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-12 Thread David Thomas
I've long been interested in a scripting language designed to be spoken. Not interested enough to go about making it happen... but the idea is fascinating and possibly useful. On Thu, Sep 12, 2013 at 2:57 PM, Andreas Abel andreas.a...@ifi.lmu.dewrote: ** +1 Cucumber seems to be great if

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread David Thomas
I do wish there was a compiler-checked way of specifying a minimum complete definition. On Thu, Aug 8, 2013 at 11:02 AM, Joey Adams joeyadams3.14...@gmail.comwrote: On Thu, Aug 8, 2013 at 12:22 PM, Lyle Kopnicky li...@qseep.net wrote: ... So I went to the Data.Hashable page and looked up

Re: [Haskell-cafe] Alternative name for return

2013-08-07 Thread David Thomas
2. This is the only way you can evaluate your pure value, and because of the monadic chaining, you cannot do it twice, you cannot re-evaluate it. I'm sure there is a sense in which this is true, but I'm not seeing it. How would you describe what's going on here? twice :: IO () - IO () twice x

Re: [Haskell-cafe] Alternative name for return

2013-08-07 Thread David Thomas
Return is all about providing a value *when used transitively*. When used intransitively, it's about moving yourself. There's nothing about the latter sense that implies providing a value. Which is not to say Richard did not overstate the case - return needn't necessarily (in English) suggest

Re: [Haskell-cafe] Dual-licensing the package on Hackage

2013-07-30 Thread David Thomas
One question is how much of a discovery/indexing role Hackage plays. There can be a tremendous difference in ease of obtaining a commercial license, and a restriction for things I can use in a proprietary project, once I pay enough seems like a legitimate use case. It also has some bearing on

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-23 Thread David Thomas
It strikes me as unlikely static analysis would be confused by shadowing. On Tue, Jul 23, 2013 at 12:37 PM, i c ivan.chol...@gmail.com wrote: let's consider the following: let fd = Unix.open ... let fd = Unix.open ... At this point one file descriptor cannot be closed. Static analysis

Re: [Haskell-cafe] memoization

2013-07-22 Thread David Thomas
I, for one, would love to have a compiler do (a) based on (b), my specification of (c), and the ability to pin particular things... On Mon, Jul 22, 2013 at 4:04 PM, wren ng thornton w...@freegeek.org wrote: On 7/22/13 9:06 AM, Tom Ellis wrote: On Mon, Jul 22, 2013 at 07:52:06PM +1200, Chris

Re: [Haskell-cafe] Wrapping all fields of a data type in e.g. Maybe

2013-07-16 Thread David Thomas
Oh, very nice. It seems reasonable to extend this to Cfg - IO Cfg to support things like dynamically loading config files, if needed. On Jul 16, 2013 5:42 PM, John Lato jwl...@gmail.com wrote: The suggestion of parameterizing on a functor would be good, however there's another approach I've

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread David Thomas
On Thu, Jul 11, 2013 at 10:50 AM, Brandon Allbery allber...@gmail.comwrote: ... but functions don't have an Eq instance, and *can't* have one. Not a general one that's interesting. There are two Eq instances that'll compile for all functions (not that it's advisable): instance Eq ((-) a b)

Re: [Haskell-cafe] tangential request...

2013-06-24 Thread David Thomas
I haven't found a font that really works well for Nethack in a while... lemme know if anyone has suggestions :-P On Mon, Jun 24, 2013 at 10:26 AM, Bardur Arantsson s...@scientician.netwrote: On 06/24/2013 06:18 AM, Mark Lentczner wrote: Thanks all, I’ve got what I needed. Finally, 15%

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread David Thomas
I'd also like to see these two. It occurs to me there may be language tweak that could reduce breakage and add some convenience in both cases. It would not surprise me at all if this has been thought of, examined, and discarded, but I don't have time to dig so I'll just lay it out quickly, and if

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread David Thomas
That's approximately what I was describing, yes. Thanks! On Fri, May 3, 2013 at 7:54 AM, Guy guytsalmave...@yahoo.com wrote: David Thomas wrote: I'd also like to see these two. It occurs to me there may be language tweak that could reduce breakage and add some convenience in both cases

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread David Thomas
That's approximately what I was describing, yes. Thanks! On Fri, May 3, 2013 at 7:54 AM, Guy guytsalmave...@yahoo.com wrote: David Thomas wrote: I'd also like to see these two. It occurs to me there may be language tweak that could reduce breakage and add some convenience in both cases

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread David Thomas
If you are actively using something then keep it up to date, encourage someone to keep it up to date, pay someone to keep it up to date, or migrate off of it. If you try building with a fresh set of packages every so often, you can catch breaking changes early and deal with them when it's

Re: [Haskell-cafe] Haskel let

2013-04-01 Thread David Thomas
On Mon, Apr 1, 2013 at 9:32 AM, Richard Eisenberg e...@cis.upenn.edu wrote: Normal let: In a function (which does not use do), you can use let to make local variables. The word in separates the local variable declaration from the part of your function where you want to use that variable.

Re: [Haskell-cafe] Overloading

2013-03-12 Thread David Thomas
If you add NoImplicitPrelude, I think you should also be able to do: import Prelude hiding (Num) import qualified Prelude (Num) instance Num a = Plus a a where type PlusResult a a = a a + b = a Prelude.+ b On Tue, Mar 12, 2013 at 2:24 PM, MigMit miguelim...@yandex.ru wrote: On Mar

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread David Thomas
hash(id:secret) should not be reversible, if you use a cryptographic hash. hash(id) can be brute-forced, on something with so small a range. On Wed, Feb 27, 2013 at 11:20 AM, Corentin Dupont corentin.dup...@gmail.com wrote: hash is reversible or not? On Wed, Feb 27, 2013 at 8:18 PM, Clark

Re: [Haskell-cafe] performance question

2013-02-14 Thread David Thomas
(I'll be brief because my head is hurting, but please don't interpret that as an intent to offend) A few points: 1) Capture groups are all you need to do some meaningful interpretation of data; these were around long before perl. 2) Yacc is typically used in conjunction with lex, partly for (a)

Re: [Haskell-cafe] performance question

2013-02-13 Thread David Thomas
One way in which regexps are foreign to Haskell-think is that, if they break, they generally break at run-time. This could be ameliorated with template haskell, but a substantial portion of Haskell coders find that a smell itself. On Wed, Feb 13, 2013 at 8:32 AM, Nicolas Bock

Re: [Haskell-cafe] performance question

2013-02-13 Thread David Thomas
...@incubaid.comwrote: On Wed, 2013-02-13 at 08:39 -0800, David Thomas wrote: One way in which regexps are foreign to Haskell-think is that, if they break, they generally break at run-time. This could be ameliorated with template haskell Care to elaborate on the ameliorate using TH part? I figure

Re: [Haskell-cafe] performance question

2013-02-13 Thread David Thomas
. On Wed, Feb 13, 2013 at 9:43 AM, David Thomas davidleotho...@gmail.comwrote: I don't think you can do much about fails to match the input string - indeed, that's often desired behavior... and matches the wrong thing you can only catch with testing. The simplest place template haskell could

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-25 Thread David Thomas
for an explanation of why). Alternatively, if there is much reasoning specific to a particular module it could certainly go there, while the cabal gets the overview... On Fri, Jan 25, 2013 at 3:23 PM, wren ng thornton w...@freegeek.org wrote: On 1/24/13 1:40 AM, Ertugrul Söylemez wrote: David

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-23 Thread David Thomas
Couldn't this be actually on hackage, so one search turns up what you want? On Jan 23, 2013 3:24 PM, wren ng thornton w...@freegeek.org wrote: On 1/23/13 3:00 AM, Alexander Kjeldaas wrote: If we step back, I think the lesson here is that Haskell libraries exist, but the concepts are far

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

2013-01-04 Thread David Thomas
On Sun, Dec 30, 2012 at 1:27 PM, Brandon Allbery allber...@gmail.comwrote: [T]he Monad m = in the signature really means hey, compiler, pass me the appropriate implementation of Monad so I can figure out what I'm doing with this type m. It's not a built in table, it's a hidden parameter.

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

2012-12-31 Thread David Thomas
Couldn't that simply be simulated? On Mon, Dec 31, 2012 at 2:36 PM, Nathan Hüsken nathan.hues...@posteo.dewrote: That seems almost impossible, I would need an android device with unusual capacity. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))

2012-12-30 Thread David Thomas
Jon's suggestion sounds great. The bike shed should be green. That is all. On Sun, Dec 30, 2012 at 4:44 PM, Petr P petr@gmail.com wrote: Hi, I also support Jon's proposal for standalone of { ... }. Seems to me clearer and more useful than the special \case construct. I suppose 'of {

Re: [Haskell-cafe] Substituting values

2012-12-22 Thread David Thomas
Seems like the function is easy to define: replaceIfEq a b c = if c == a then b else c Then the above can be written replaceIfEq Foo Bar value Or the slightly more general (in exchange for slightly more verbosity at the call site) replaceIf p r a = if p a then r else a replaceIf (==

Re: [Haskell-cafe] (L)GPL libraries Haskell/GHC

2012-12-12 Thread David Thomas
Strictly speaking this is correct, and probably there's no one who would miss the gotcha on the list, but for the sake of completeness: You can release the source only to people who you have provided the program, but *they* have the ability to redistribute it under the terms of the GPL. As

Re: [Haskell-cafe] containers license issue

2012-12-12 Thread David Thomas
Right. If either of the following hold, you should be able to carry on as you were (but double check with your lawyer): 1) The algorithm is borrowed but the code was not copied. In this case, copyright doesn't cover it, and the GPL is inapplicable. (Patents could conceivably be an issue, but no

Re: [Haskell-cafe] containers license issue

2012-12-12 Thread David Thomas
at 11:00 AM, David Thomas davidleotho...@gmail.com wrote: Right. If either of the following hold, you should be able to carry on as you were (but double check with your lawyer): 1) The algorithm is borrowed but the code was not copied. In this case, copyright doesn't cover

Re: [Haskell-cafe] containers license issue

2012-12-12 Thread David Thomas
This may be overconfident - how does copyright law deal with translations in literature? Still, it certainly makes infringement less likely, and the earlier explicit statement that code was copied likely the result of confusion. On Dec 12, 2012 8:33 AM, Niklas Larsson metanik...@gmail.com wrote:

Re: [Haskell-cafe] ANNOUNCE: tie-knot library

2012-12-11 Thread David Thomas
On Tue, Dec 11, 2012 at 5:35 PM, Brandon Allbery allber...@gmail.comwrote: (Oddly enough, GPL is not the only open source license.) There was no implication to the contrary. It was stated that BSD is a *weaker* license - this is true in the sense that it has fewer requirements (in particular,

Re: [Haskell-cafe] ANNOUNCE: tie-knot library

2012-12-11 Thread David Thomas
Right. Like, if Linus hadn't bogged down the Linux kernel with the GPL license, it might have wound up as popular as BSD! Both dynamics go on, and the question is which is more likely to dominate in a given case (and cumulatively). On Tue, Dec 11, 2012 at 5:50 PM, Jonathan Fischer Friberg

Re: [Haskell-cafe] ANNOUNCE: tie-knot library

2012-12-11 Thread David Thomas
of this has anything to do with Haskell. Petr can release *his* code with any license he wants. Some licenses fit into *this* ecosystem better than others. Suggestions have been made and we can all move on. On Tue, Dec 11, 2012 at 6:03 PM, David Thomas davidleotho...@gmail.comwrote: Right. Like

Re: [Haskell-cafe] ANNOUNCE: tie-knot library

2012-12-11 Thread David Thomas
IANAL, but reviewing what others have written, it sounds like it may be possible to maintain *some* distinction between LGPL and GPL in Haskell, but it's a different distinction than with an LGPL shared library, so even if applicable it's certainly worth being aware of. It sounds (and I'd very

[Haskell-cafe] Recursive timezone-loading function

2012-11-27 Thread David Thomas
https://github.com/dlthomas/tzcache A small bit of code, but seems likely to be useful enough that I figured I should share. I've a few notes/questions: 1) Does this already exist somewhere I missed? 2) It seems silly to make this its own library - any suggestions where it could be added? 3)

Re: [Haskell-cafe] Common function names for '(.) . (.)', '(.) . (.) . (.)' ...?

2012-11-21 Thread David Thomas
( . ) . ( . ) in particular seems to be a generalization of flip on - hopefully there's something cleaner and more general though. On Wed, Nov 21, 2012 at 9:43 AM, Daniel Trstenjak daniel.trsten...@gmail.com wrote: Greetings, Daniel ___

[Haskell-cafe] Deriving settings from command line, environment, and files

2012-11-01 Thread David Thomas
Is there a library that provides a near-complete solution for this? I looked around a bit and found many (many!) partial solutions on hackage, but nothing that really does it all. In coding it up for my own projects, however, I can't help but feel like I must be reinventing the wheel. What I

Re: [Haskell-cafe] foldr (.) id

2012-10-29 Thread David Thomas
sum can be a verb, but yeah, product can't really, so it probably makes sense to follow the noun pattern if we're wanting to be consistent more than brief. and as a noun is unusual, but fwiw dictionary.com says that there's a noun sense that means conjunction in the logical sense, which is

Re: [Haskell-cafe] Sparse records/ADTs

2012-10-24 Thread David Thomas
You've got a bunch of great answers, if there's no rhyme or reason to which fields are missing. If, on the other hand, they will tend to be present or absent in groups, you could decompose your data-structure a bit, for fast lookups, good space efficiency, and maybe even slightly more interesting

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread David Thomas
I think the version below (with a Functor or Applicative superclass) is clearly the right answer if we were putting the prelude together from a clean slate. You can implement whichever is easiest for the particular monad, use whichever is most appropriate to the context (and add optimized

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] Are there arithmetic composition of functions?

2012-03-19 Thread David Thomas
The 17 at the end should be 12, or the 2 passed into (f+g+2) should be 3. On Mon, Mar 19, 2012 at 10:38 AM, Ozgur Akgun ozgurak...@gmail.com wrote: Hi, If you are feeling adventurous enough, you can define a num instance for functions: {-# LANGUAGE FlexibleInstances #-} instance Num a =

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread David Thomas
If the question is when can I have my output, then both are equally relevant and can be safely conflated. That said, while some programming problems *are* of this type, I think most aren't, and your points certainly stand. On Fri, Mar 16, 2012 at 3:31 PM, Chris Smith cdsm...@gmail.com wrote:

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-08 Thread David Thomas
record.field (read record, oops, I only want part of it.) I would read this record's field ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread David Thomas
Crash blossoms, while amusing, are not a desirable feature of a programming language. They are specifically a failure to communicate clearly. On Feb 6, 2012 6:38 PM, AntC anthony_clay...@clear.net.nz wrote: Donn Cave donn at avvanta.com writes: You can find stuff like fromIntegral.ord in

Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread David Thomas
My understanding is that blocking/redirection is to be done at the DNS level. In which case, there *is* a ?banner hack of sorts - get the IP by some other means. Which is not to say we should be significantly less concerned. On Wed, Jan 18, 2012 at 10:17 AM, Brandon Allbery allber...@gmail.com

Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread David Thomas
Granted, but nothing a technical user can't handle, which was the earlier question. On Wed, Jan 18, 2012 at 2:18 PM, Brandon Allbery allber...@gmail.com wrote: On Wed, Jan 18, 2012 at 17:15, David Thomas davidleotho...@gmail.com wrote: My understanding is that blocking/redirection

[Haskell-cafe] IO typeclasses

2011-12-29 Thread David Thomas
Is there any particular reason IO functions in the standard libraries aren't grouped into type-classes? This might allow for: 1) Testing IO code without actual input and output. (I have done this on a small scale, but it presently involves much ugliness). 2) Redirecting output of a function that