Re: [Haskell-cafe] [ANNOUNCE] Fmark markup language

2012-09-18 Thread Stefan Monnier
> The problem with that is that some people DO end some headings with > a full stop; for them your special syntax is not natural. Markdown/ReST is already using the "no syntax" idea (e.g. compared to pre-wiki markup such a LaTeX or Texinfo), so he's simply trying to push this idea further. I susp

Re: [Haskell-cafe] Darcs fetches too little files

2012-08-29 Thread Stefan Monnier
> Albert Einstein said: > Insanity: doing the same thing over and over again and expecting > different results. > I repeated the command today and it worked! So, did you expect the result to be different, or did you re-try just to confirm that it doesn't work? Stefan

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-22 Thread Stefan Monnier
> I think, Apple has made their stance quite clear by releasing the > command line dev tools: I'm not sure what you mean by that, but looking at the history of Apple devices, especially the recent history with iPad, iPhone, etc... it's pretty clear to me where this is headed: keep as tight a contr

Re: [Haskell-cafe] Misleading MVar documentation

2011-01-15 Thread Stefan Monnier
> I'll try another writeup. Does anyone know where the original papers for > MVars might be? In my mind, full/empty variables date back to dataflow machines. But I don't know where I got this idea. Stefan ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] What's the motivation for η rules?

2010-12-28 Thread Stefan Monnier
One way to look at it is that β rules are the application of an eliminator (e.g. function application) to its corresponding constructor (the lambda expression), whereas η rules correspond to the application of a constructor to its corresponding eliminator. E.g. λ y . (x y)=> x

[Haskell-cafe] Re: GHC 7.0.1 developer challenges

2010-11-25 Thread Stefan Monnier
> And if it actually freezes your machine (as opposed to making it go > really slowly), that's a kernel bug. Very true, tho sometimes the difference between a real freeze and "just going very slow" is pretty subtle. Stefan ___ Haskell-Cafe mai

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-17 Thread Stefan Monnier
> Good start, if only the "advanced" were replaced with something more > characteristic, like "lazy", or "statically typed". Which, BTW, both do not > appear in the whole blurb, even though they are *the* characteristics of > Haskell, lazyness being even something that sets it apart from most other

[Haskell-cafe] Re: Strict Core?

2010-10-17 Thread Stefan Monnier
> That said, I've been told that UHC's core language uses the ideas from > Strict Core, and they have/had a student at Utretch (Tom Lokhorst) who > was working on implementing optimisations like arity raising and deep > unboxing for the language. Many/most implementations of ML-ish languages use a

[Haskell-cafe] Re: Chuch encoding of data structures in Haskell

2010-05-27 Thread Stefan Monnier
> churchedBool :: t -> t -> t Important detail: the precise type is "∀t. t → t → t". > encodeBool x = \t e -> if x then t else e So the type of encodeBool should be: Bool → ∀t. t → t → t whereas Haskell will infer it to be ∀t. Bool → t → t → t which means that a given object can only be e

[Haskell-cafe] Re: Embedded funcional programming?

2010-04-18 Thread Stefan Monnier
> As a side comment, I haven't noticed any reaction in the > Haskell/iPhone community about Apple's recent policy change. The stricter they make it, the better, since it hopefully gets us closer to the point where people will see that they should stay the heel away from any such handcuffs,

[Haskell-cafe] Re: US Patent for the idea of using Haskell to implement UAX #9

2010-04-18 Thread Stefan Monnier
>> revealed a link to a US Patent (7120900) for the idea of implementing >> the Unicode Bidirectional Algorithm (UAX #9 >> http://www.unicode.org/reports/tr9) in Haskell, making use, as far as I >> can tell, of nothing more than the normal approach any functional >> programmer would use, namely sep

[Haskell-cafe] Re: instance Eq (a -> b)

2010-04-14 Thread Stefan Monnier
> Why isn't there an instance Eq (a -> b) ? I guess it's because even for those cases where it can be written, it will rarely be what you want to do, so it's better to require the programmer to explicitly request a function-comparison than to risk silently using such a costly operation when the pr

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread Stefan Monnier
> So if the local variable can be changed, then we can use loop, > etc. same as imperative languages. For example, for (i=0; i<100; i++) > where `i` is a local variable in function. It is true that a pure language could support such things (some pure languages do, e.g. Sisal). The experience of

Re: [Haskell-cafe] Re: GPL answers from the SFLC

2010-03-04 Thread Stefan Monnier
> The thing is that the new X' library can provide the same API while > not being very useful (bug, performance, whatever). And in this case, > it is trivial to make that new X'. So I don't understand why the > answer was no in the first place. The law is not a set of mathematical rules. It all

[Haskell-cafe] Re: GPL answers from the SFLC

2010-03-04 Thread Stefan Monnier
> The next question that comes to mind is thus: > What if a new library X' released under BSD or MIT license implements > the X API (making possible to compile Y against it)? Can such a new > library X' be licensed under something else than the GPL (we guess Yes > because we don't think it is possi

[Haskell-cafe] Re: GPL answers from the SFLC

2010-03-04 Thread Stefan Monnier
> Note that this is a safety measure for the submitter: If the code is, > indeed, released to the public, it is (dual licesed) GPL, anyway, even > if that might not have been the intent. No. If the submitter did not explicitly release his code under the GPL, then it is not licensed under the GPL,

[Haskell-cafe] Re: Non-termination of type-checking

2010-02-01 Thread Stefan Monnier
> And I'm pretty sure that there's no way to convince Agda that F = R, > or something similar, because, despite the fact that Agda has > injective type constructors like GHC (R x = R y => x = y), it doesn't > let you make the inference R Unit = F Unit => R = F. Of course, in > Agda, one could ar

[Haskell-cafe] Re: ssh ports for monk and nun?

2010-01-13 Thread Stefan Monnier
>> Trying to get ssh working via putty from behind my company firewall. My recommendation is to get access to an outside machine where you run an OpenVPN server on port 80 or 443. This will solve it "once and for all". But first, please complain loudly and repeatedly about the firewall being clos

[Haskell-cafe] Re: Why?

2009-12-10 Thread Stefan Monnier
> This is a matter that I genuinely at the present time do not grasp and > I am hoping that some of you who are more familiar with the Haskell > language may be able to help enlighten me. I feel the question to be > an important one. What material benefit does Haskell derive from being > a "pure" f

[Haskell-cafe] Re: Status of TypeDirectedNameResolution proposal?

2009-11-20 Thread Stefan Monnier
> You know, another solution to the records problem, which is not quite > as convenient but much simpler (and has other applications) is to > allow local modules. > module Foo where > module Bar where > data Bar = Bar { x :: Int, y :: Int } > module Baz where > data Baz = Baz { x :: In

[Haskell-cafe] Daniel Schüssler

2009-11-04 Thread Stefan Monnier
> this is rather trivial, but maybe someone else finds these useful: > darcs get http://code.haskell.org/~daniels/haskell-snippets/ Since Emacs already comes bundled with several template systems (at least skeleton.el and tempo.el, where the first seems to be marginally more "canonical"), I think

Re: [Haskell-cafe] Re: cvs.haskell.org down? haskell-mode abandoned?

2009-10-22 Thread Stefan Monnier
>>> In any case, I need it fixed before I can work on haskell-mode. >>> Preferably by migrating haskell-mode over to cvs. :-) >> You mean migrating to DaRCS?  That would be appreciated, yes. > Um, yes. > I can get the revision history into darcs pretty easily, such as it > is, assuming cvs.haskell.

[Haskell-cafe] Re: cvs.haskell.org down? haskell-mode abandoned?

2009-10-20 Thread Stefan Monnier
> In any case, I need it fixed before I can work on haskell-mode. > Preferably by migrating haskell-mode over to cvs. :-) You mean migrating to DaRCS? That would be appreciated, yes. > who *is* the current maintainer? Last I heard, it was me. But if someone wants to take over, he's welcome.

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Stefan Monnier
>>> The only thing I haven't figured out is how to do tab-completion of >>> words in the ghci buffer.  Do I need to use a different key >>> combination?  I couldn't find that in the documentation. >> I think it's just a missing feature. > OK! Let me know if there's anything I can do to help. I no

[Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Stefan Monnier
> Real programmers use butterflies!! In Emacs-23, this is available as M-x butterfly C-M-c Too bad it wasn't around when I was writing my thesis, Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/list

[Haskell-cafe] Re: Best Editor In Windows

2009-10-15 Thread Stefan Monnier
> The only thing I haven't figured out is how to do tab-completion of > words in the ghci buffer. Do I need to use a different key > combination? I couldn't find that in the documentation. I think it's just a missing feature. Stefan ___ Hask

[Haskell-cafe] Re: Best Editor In Windows

2009-10-15 Thread Stefan Monnier
> I'm very new at Haskell, i'm reading a book and starting, but i want to > know which is the best editor for development under Windows, because now > i'm using Notepad++(That i use to develop in C++). The best editor for development is Emacs, of course. http://www.gnu.org/software/emacs

[Haskell-cafe] Re: I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Stefan Monnier
> I might also point out that 90% of all desktop computers run Windows, and > yet every single C library binding on Hackage fails to compile on > Windows. That really needs to be fixed. Luckily, this is being fixed ... by the Free Software movement. Stefan _

[Haskell-cafe] Re: accessible layout proposal?

2009-09-23 Thread Stefan Monnier
> http://www.haskell.org/haskellwiki/Accessible_layout_proposal I see two main problems with such a proposal (other than the particular details of the syntax chosen for it): - layout is not very well supported by most of the text editors, contrary to parens/brackets/braces. - more importantly: i

[Haskell-cafe] Re: Darcs as undo/redo system?

2009-05-09 Thread Stefan Monnier
> I have thought about applications of patch theory like this as well. > I could imagine applying it to the undo stack in GIMP. Allowing you > to undo things on different layers. I think one of the things you Don't know about the GIMP, but in Emacs, you can select a region of text and undo just

[Haskell-cafe] Re: Why is Bool no instance of Num and Bits?

2009-05-09 Thread Stefan Monnier
> "[...] unsafe [PerformIO ...]" looks safer to me. Hmmm Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Is curryfication practical with dynamic scope?

2009-04-28 Thread Stefan Monnier
> PS: In a meta interpreter, lexical scope seems to be actually easier > to implement than dynamic scope. Depends on whether your meta-language is lexically or dynamically scoped. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org h

[Haskell-cafe] Re: Haskell/JS -- better through typeclasses?

2009-04-26 Thread Stefan Monnier
> There's a tool for converting SML to JavaScript: Such tools converting between different languages, are usually called "compilers", by the way. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/lis

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-23 Thread Stefan Monnier
> I think the non-applicable to code observation is very likely true – > we'd like to be able to write nice descriptive variable names. > In doing this, we probably want them to be more than the 1 or > 2 characters that Haskellers traditionally use, maybe of the order of > 5-10. > Given this, it

[Haskell-cafe] Re: Issues with running Ghci from emacs

2009-04-16 Thread Stefan Monnier
> It is looking for the closest ancestor directory with a file ending in > .cabal, and that's where cd goes. Probably the simplest way to trick it > without chaniging any setting is to create an empty dummy.cabal in the > directory of your program. The haskell-mode code in the CVS repository has a

[Haskell-cafe] Re: Best text editor

2009-04-13 Thread Stefan Monnier
> I'm a beginner, but I'll chime in and say I use Emacs with > haskell-mode. It's auto-indentation is a bit complex in behavior which is > unappealing (I feel like I never know what it's going to do when I hit tab), > but I would be curious what someone with more experience feels about that. I cle

[Haskell-cafe] Re: Referential Transparency and Monads

2009-04-10 Thread Stefan Monnier
IO a ~ World -> (a, World) >>> I still don't understand this; we are passing a World and getting a >>> World back, >> We are? Why do you think that? > Because that's what (World -> (a,World)) means, last I checked. No: Hasekll functions are partial, which means that "a -> b" means "takes a

[Haskell-cafe] Re: Amazing

2009-02-15 Thread Stefan Monnier
> So IMO static typing is good, but it's only with functional programming that > it really shines. You can go one step further: if you start using dependent types, you'll see that it gets yet harder to get your program to type-check, and once it does, you don't even bother to run it since it's so

[Haskell-cafe] Re: Verifying Haskell Programs

2009-02-02 Thread Stefan Monnier
> State of the art is translating subsets of Haskell to Isabelle, and > verifying them. Using model checkers to verify subsets, or extracting > Haskell from Agda or Coq. Another state of the art is to use type classes, GADTs, and/or type functions, to specify and prove the properties you want abou

[Haskell-cafe] Re: WYSIWYG literate programming

2009-01-28 Thread Stefan Monnier
> http://haskell.org/haskellwiki/Emacs#Unicodifying_symbols_.28Pretty_Lambda_for_Haskell-mode.29 I'm pretty sure this text wasn't there last time I looked, yet last time I looked was already long after Haskell-mode integrated such a feature. In any case I've added a note to mention that all you ne

[Haskell-cafe] Re: Dr Dobbs: Time to get good at functional programming

2008-12-08 Thread Stefan Monnier
> http://www.ddj.com/development-tools/212201710;jsessionid=3MQLTTYJRPL3CQSNDLRSKH0CJUNN2JVN Do they purposefully obfuscate names? I mean who are those "Martin Obersky" and "Don Sype"? Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.

[Haskell-cafe] Re: Gluing pipes

2008-12-05 Thread Stefan Monnier
> \ x y -> f (g x) (h y) [...] > f $. g ~> h ~> id I keep help wonder: other than a "5 chars", what is it we have gained? Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: What *not* to use Haskell for

2008-11-12 Thread Stefan Monnier
> So I should clarify I'm not a troll and do "see the Haskell light". But > one thing I can never answer when preaching to others is "what does > Haskell not do well?" The most obvious cases where Haskell does not do well, for me: - When you feed it Java code. Incidentally, the same holds when y

[Haskell-cafe] Re: Why 'round' does not just round numbers ?

2008-10-27 Thread Stefan Monnier
>>> 2.4x -> x >> That's supposed to be 2.4x -> 2, of course. > Ah, damn it. I was hoping for a long discussion on just what math > would look like with rounding like that ;-) I think it has a name... "modulo" maybe? Stefan ___ Haskell-Cafe m

Re: [Haskell-cafe] Re: What I wish someone had told me...

2008-10-15 Thread Stefan Monnier
> Would you please explain this a bit more: > the various unfortunate consequences of type erasure in Java are > avoided by the fact that Haskell types lack constructors, so the user > never expects to be able to conjure up a value of an unknown type. Even if Haskell had Java-style constructors,

[Haskell-cafe] Re: What I wish someone had told me...

2008-10-15 Thread Stefan Monnier
>> leaders and pioneers: "if you know one language, picking up others >> should be easy, they just differ in syntax". > I have heard it, and I used to believe it. Now I think it's only true > provided the one language you know is suitably advanced (and currently > non-existent, I think). It all d

[Haskell-cafe] Re: What I wish someone had told me...

2008-10-15 Thread Stefan Monnier
> The instance selection for an interface is done at run-time and this is > inherently necessary. The instance (in a different sense) selection for > type classes is almost always resolvable statically. In Haskell 98 In both cases, the dispatch is inherently dynamic, and in both cases, most disp

[Haskell-cafe] Re: cabal upgrade

2008-10-01 Thread Stefan Monnier
> It's something to consider in the future, although a change-aware > "filesystem" (git, say? It's fast) would probably be better. ^^^ You misspelled "darcs". Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:/

[Haskell-cafe] Re: Hmm, what license to use?

2008-09-30 Thread Stefan Monnier
> I am not allowed to use such an interpretation. The (expensive and very > carefully researched) legal advice used to shape the use of Open Source > code at my employer has resulted in a "no LGPL under any circumstances > whatsoever" policy. [...] > That still leaves anyone free to use LGPL if the

[Haskell-cafe] Re: Hmm, what license to use?

2008-09-26 Thread Stefan Monnier
> When I compare GPL and MIT/BSD licenses, I do a simple reasoning. > Suppose a doctor in a battle field meet a badly injuried enemy. > Should he help the enemy? My answer would be that he indeed should, at the condition that the patient will switch side. Oh wait, that's just what the GPL says.

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Stefan Monnier
> I believe this was voiced as an SML issue more than an OCaml issue, though > honestly I don't know enough of the differences to distinguish them. Before > I mentioned that function/prefix application always binds tighter than > operator/infix application, he was using many redundant parentheses,

[Haskell-cafe] Re: Line noise

2008-09-24 Thread Stefan Monnier
> qsort [] = [] > qsort (x:xs) = qsort (filter (x <) xs) ++ [x] ++ qsort (filter (x >=) xs) Note that you can help the reader by making the precedence a bit more obvious: qsort [] = [] qsort (x:xs) = qsort (filter (x <) xs) ++ [x] ++ qsort (filter (x >=) xs) I

[Haskell-cafe] Re: Haskell Weekly News: Issue 85 - September 13, 2008

2008-09-15 Thread Stefan Monnier
> A more difficult question is: how do I know that the formal > specification I've written for my program is the right one? Tools can > fairly easily check that your programs conform to a given > specification, but they cannot (to my knowledge) check that your > specification says exactly what y

[Haskell-cafe] Re: Bug in Emacs Haskell Mode

2008-06-24 Thread Stefan Monnier
> Emacs Haskell Mode has the following useful feature: when "Haskell -> > Load File" is used to load a file into GHCi from Emacs, Haskell Mode > automatically looks for a "*.cabal" file in an attempt to find the > project directory. I'm truly sorry about the fact that I only release new versions r

[Haskell-cafe] do and ifthenelse indentation in GHC

2008-06-19 Thread Stefan Monnier
http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse says (and my memory seems to agree) that GHC has been changed to accept things like readnums f n = do eof <- hIsEOF f if eof then return n else do l <- hGetLine f

[Haskell-cafe] Re: type families and type signatures

2008-04-07 Thread Stefan Monnier
> Id is an operation over types yielding a type, as such it doesn't make > much sense to me to have (Id a -> Id a) but rather something like (a -> > Id a). Actually, it can make perfect sense: e.g. if the `Id' function acts as a constraint. Stefan ___

[Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-08 Thread Stefan Monnier
>> > You seem to write 12 as 1 :+ 2 instead of () :+ 1 :+ 2. But I think, the >> > latter representation should probably be prefered. With it, :+ always >> > has a number as its left argument and a digit as its right. Without the >> > () :+ we get ugly exceptional cases. >> > You can see this, f

[Haskell-cafe] Re: anybody can tell me the pronuncation of "haskell"?

2008-01-28 Thread Stefan Monnier
> *did* disagree with me was also named "Jeremy". How confusing. Are both "Jeremy"s pronounced identically? Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: The programming language market (was Re: Why functional programming matters

2008-01-26 Thread Stefan Monnier
>> * Say "computers are cheap but programmers are expensive" whenever >> explaining a correctness or productivity feature. > This is true only if talking to people in high-income nations. Is it? Maybe you're right. But historically, computers have been available at all kinds of price ranges, so

[Haskell-cafe] Re: Newbie question

2008-01-21 Thread Stefan Monnier
> How does caller choose which particular instance of Num they want? By passing the type they want. That's what the "Num a =>" thingy does. > In object-oriented language If function return type is an interface it means > that it can return any implementation of this interface, but caller can't >

[Haskell-cafe] Re: Why purely in haskell?

2008-01-15 Thread Stefan Monnier
> Yes, this is a doctrinal problem. Since *any* concrete reaction, e.g., an > error message is a kind of answer, the only - unusable as it is - way of > not providing it is to fail the termination... You can just disallow the call, using the type system. Not that it's always easy or practical eith

Re: [Haskell-cafe] Haskell-mode 2.4

2008-01-11 Thread Stefan Monnier
> "Johan" == Johan Tibell <[EMAIL PROTECTED]> writes: >> > Emacs is completely frozen until I press C-g and then it goes back to >> > normal (without loading the file). Here's the back trace: >> >> > Debugger entered--Lisp error: (quit) >> > accept-process-output(#) >> > (and (not (re-sea

Re: [Haskell-cafe] Haskell-mode 2.4

2008-01-10 Thread Stefan Monnier
>> >> First of all, thanks. My Aqua Emacs (on OS X Leopard) hangs when I >> >> send a command like C-c C-l or C-c C-t to the interpreter (I can quit >> >> the command using C-g) . Starting the interpreter and using :l from >> >> inside it works fine. This is using GHC 6.8 (and I think I also tried

Re: [Haskell-cafe] Haskell-mode 2.4

2008-01-10 Thread Stefan Monnier
>> First of all, thanks. My Aqua Emacs (on OS X Leopard) hangs when I >> send a command like C-c C-l or C-c C-t to the interpreter (I can quit >> the command using C-g) . Starting the interpreter and using :l from >> inside it works fine. This is using GHC 6.8 (and I think I also tried >> 6.6.) Wha

[Haskell-cafe] Re: viewing HS files in Firefox

2008-01-10 Thread Stefan Monnier
> My problem is when viewing plain darcs repositories (like mine on > darcs.johantibell.com which I recently fixed with the above mime type > hack.) Please complain to your browser('s authors): most browsers only provide *one* way to view a given mime-type, which is stupid. It's not specific to .

[Haskell-cafe] Haskell-mode 2.4

2007-12-11 Thread Stefan Monnier
Here's for Xmas, version 2.4 of the Haskell-mode package. Haskell-mode is an Elisp package to support editing Haskell in Emacs. See the home page at http://www.iro.umontreal.ca/~monnier/elisp/ -- Stefan Changes since 2.3: * Update license to GPLv3. * New derived major mode for .hsc files.

[Haskell-cafe] Re: Monad.Reader 8: Haskell, the new C++

2007-09-14 Thread Stefan Monnier
> PS: And, no, you won't be able to set breakpoints in type-level > programs... Yet. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: "Functional dependencies conflict between instance declarations"

2007-09-12 Thread Stefan Monnier
>> Never mind, that GHC compiler was again more clever than me, sigh. >> That's really frustrating about Haskell: the compiler captures so many >> errors at compile time, that newbies hardly get anything done, it's >> a constant battle against the errors. But once it compiles, it usually >> works a

[Haskell-cafe] Re: Using haskell with emacs

2007-08-08 Thread Stefan Monnier
>> I've removed it from the next release of haskell-mode, so if you need it, >> please explain why. > So C-c C-l is the preferred method for re-loading? Yes. > I don't know enough about the details to know if :l and :r do exactly the > same things in ghci. I don't either. But experimentation s

[Haskell-cafe] Re: Using haskell with emacs

2007-08-08 Thread Stefan Monnier
>> C-c C-b ... when pressed for the first time this will start an >> interpreter (ghci or hugs most of the time), when pressed with a >> running interpreter it'll switch to that buffer. >> >> C-c C-l ... Load the current file into the editor. There is no >> function-wise compilation. More genera

[Haskell-cafe] Re: Newbie question: "multi-methods" in Haskell

2007-08-06 Thread Stefan Monnier
> Remember that type classes do not provide object-oriented functionality. > The dispatch is static, not dynamic. I beg to disagree. map (\n. n + n) calls different (+) operations depending on the (type of the) argument list. That's why dictionaries are passed around (they are called vtables

[Haskell-cafe] Re: Indentation woes

2007-07-27 Thread Stefan Monnier
> I wish to be able to indent my code like so: >> longFunctionName various and sundry arguments >> | guard1 = body1 >> | guard2 = body2 >> | ... >> where declarations > That is, with guards and where clauses indented to the same level as > the function name. Sounds like a generalization of the ide

[Haskell-cafe] Re: Haskell mode for emacs - some questions

2007-06-19 Thread Stefan Monnier
>> I finally got emacs using Haskell-mode working. It seems that the latest Sounds like it was difficult. Could you describe what you tried, what didn't work, and what did work in the end? Hopefully I can then improve the doc. >> - How can I just compile and run in one go without having to type

[Haskell-cafe] Re: Tutorial on Haskell

2007-04-16 Thread Stefan Monnier
> No we don't! At least not anywhere near as much of an exaggeration as that > statement would be about an strongly typed imperative language (sequencing > can't be type checked*, imperative programs are mostly sequencing, thus > imperative programs are mostly unchecked). Actually, side effects *c

[Haskell-cafe] Re: A wish for relaxed layout syntax

2007-04-01 Thread Stefan Monnier
> list := '[' item* ';'? ']' Indeed, it's the same idea as the 'else' in do-blocks. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Church Encoding Function

2007-03-10 Thread Stefan Monnier
> I'm pretty sure you can define a catamorphism for any regular algebraic > data type. Actually, so-called negative occurrences in (regular) data types cause problems. Try to define the catamorphism of data Exp = Num Int | Lam (Exp -> Exp) | App Exp Exp to see the problem, Stefan

[Haskell-cafe] Re: literate Haskell newbie question

2007-03-10 Thread Stefan Monnier
> cat foo.lhs | grep -e "^>" | sed "s/^> //" Running for the Useless Use of cat Award? A simpler version would be: sed -n -e 's/^>//p //p http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: LGPL libraries

2007-03-06 Thread Stefan Monnier
> Gtk2Hs and HDBC are both LGPL licensed, but aren't they always > static linked? Is there a way to use them in closed-source programs? Of course, just read the LGPL again. It doesn't prevent use of static-linking. It's a bit long and verbose with odd-sounding rationales, but all it really s

[Haskell-cafe] Re: seq does not preclude parametricity (Re: IO is not a monad)

2007-01-24 Thread Stefan Monnier
> FYI, don't try to run this in GHC, because it gives the simplifier fits. You mean it triggers a bug in the inliner? Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: GHC performance of 64-bit

2007-01-08 Thread Stefan Monnier
> I noticed that GHC generates slower code on an Linux amd64 bit platform than > the 32-bit version on a cheaper 32-bit machine. > CPUTime for running sieve of Erathostenes to generate 10,000 primes: > Athlon XP 2800 (32-bit): 7.98 secs > Athlon 64 3800 (64-bit): 10.29 secs > This is using GHC 6.6

[Haskell-cafe] Re: Why is Haskell not homoiconic?

2006-10-31 Thread Stefan Monnier
>> Homiconic means that "the primary representation of programs is also a >> data structure in a primitive type of the language itself" > The main reason is that Haskell is designed as a compiled > language, so the source of the programme can safely > disappear at runtime. So there's no need to h

[Haskell-cafe] Re: Simple GADT parser for the eval example

2006-10-31 Thread Stefan Monnier
> ...No surprise there, since there is no way to fail in the event of a > maltyped "Expr". The next thing to try is a type class solution... Think about it: you need to do type checking. For our little language we used Template Haskell to do your "Expr -> Term a" translation, thus the type-check

[Haskell-cafe] Re: What's going on in our courses?

2006-10-14 Thread Stefan Monnier
> Last Spring my Functional Programming class implemented a Genetic Algorithm > with Neural Networks that learned to play Nim. The students had a really > good time--they also learned lots about Functional Programming > with Haskell. > Part of the final exam was a tournament. > This Fall in AI

[Haskell-cafe] Re: Haskell performance (again)!

2006-10-10 Thread Stefan Monnier
> Assuming your machine architecture supports something like condition codes. > On, e.g., the MIPS you would need to test for < and == separately. And even if your machine supports condition codes, you'll need one test plus two conditional jumps. Not much better than MIPS's 2 independent tests

[Haskell-cafe] Re: flip dot

2006-09-28 Thread Stefan Monnier
> If I were to fix the language I would probably use something like ":" or > "::" for selection and keep "." for composition. I agree it's not worth changing. But I'd favor the use of a char such as ○ instead (which is incidentally how haskell-mode displays the "." char when used infix).

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-23 Thread Stefan Monnier
> For that one, if it doesn't get mended for long enough, > Haskell' might accept the present layout. > http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse Hmm... the bug in haskell-mode has been known for almost a year now. So you're saying that I should just wait even more and it'

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-23 Thread Stefan Monnier
First, how do I fix the identation of the if then else? >>> getList = find 5 >>> where find 0 = return [] >>> find n = do >>> ch <- getChar >>> if ch `elem` ['a'..'e'] >>> then do tl <- find (n-1) >>> return (ch : tl) >>> else find n >> >> OK. Thanks. I didn't find that one because it's not

[Haskell-cafe] Re: Monad laws

2006-09-07 Thread Stefan Monnier
> Are you really sure Haskell compilers do that optimization? > I would regard a compiler that does optimizations that are justified by > laws that the compiler cannot check as broken. You mean like the non-aliasing law in Fortran? Stefan ;-) ___

[Haskell-cafe] Re: how do you debug programs?

2006-09-06 Thread Stefan Monnier
> I simply can't let this pass without comment. It's irrelevant if you're > using a functional or imperative language, debuggers are invariably > a waste of time. The only reason to use a debugger is because you need > to inspect the contents of a processes address-space; That's a very narrow de

[Haskell-cafe] Re: does the compiler optimize repeated calls?

2006-09-06 Thread Stefan Monnier
> Purely functional does give you some performance benefits, though. Nice theory. People don't use functional languages for their performance, mind you. All the optimizations that are supposedly made possible by having a pure functional language tend to be either not quite doable (because of non

[Haskell-cafe] Re: map (-2) [1..5]

2006-08-17 Thread Stefan Monnier
> I'd have thought it would have been simpler to just make the rule that -2 > (no spaces between '-' and '2') would be a single lexeme, But then x-2 won't mean "subtract 2 from x" but "call x with arg -2". Stefan ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Why Not Haskell? (sidenote on licensing)

2006-08-07 Thread Stefan Monnier
> Sorry, I didn't mean to offend anybody, or be misleading. I like GPL, > but I also like the disease metaphor (although is not as much being > sneezed at as having sex with somebody :-). Then you should think twice before using such metaphors: you end up propagating hate for something which you

[Haskell-cafe] Re: Why Not Haskell?

2006-08-07 Thread Stefan Monnier
> Well I understand the "free as in free speech not free beer" motto, but > suppose person A is talented at writing software but prefers a peaceful > existence and lacks the contacts/refs/desire/energy etc to be a consultant > or contractor, and has had the bad experience of being forced to work >

[Haskell-cafe] Re: Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Stefan Monnier
> Confusingly, > if c > then t > else f > Also works, although no-one really knows why. Actually, it doesn't work inside a `do' layout, Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/has

[Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-27 Thread Stefan Monnier
> Trying to design a consistent naming system, it helps if we all agree > on what the various parts of a filepath are called, this is my draft > of that: > http://www-users.cs.york.ac.uk/~ndm/temp/filepath.png For what it's worth, the FSF's coding conventions uses "path" only for lists of directo

[Haskell-cafe] Re: help with MPTC for type proofs?

2006-05-27 Thread Stefan Monnier
> I'm thinking that either the functional dependency constraint is weaker > than I thought, or that somehow GADTs aren't interacting with FDs as I'd > like, but I'm not sure which. Or, of course, it may be that my recursive > instance is not doing what I like. Or I may be just plain confused, as

[Haskell-cafe] Re: lambda evaluator in GADT

2006-04-09 Thread Stefan Monnier
> The introduction to GADT usually starts with a little expression > evaluator. So I gave it a try, but there are some troubles. Actually, the generalization is not necessarily trivial at all, depending on what you need to do with your ASTs. >> data E a where >> Lit :: a -> E a >> App :: E (a ->

[Haskell-cafe] Re: haskell-mode indentation

2006-03-31 Thread Stefan Monnier
> Being an emacs-addicted person, I'm using haskell-mode for editing > haskell code. But its default indentation rule doesn't seem to > be correct. I mean when i type something like the code below, i've got > the following indentation: > doSomeStuff a b c = do > somefunc a >anothe

[Haskell-cafe] Re: Code completion? (IDE)?

2006-02-20 Thread Stefan Monnier
>> vim7 has introduced "omni-completion"... So I'm interested wether there >> are any projects which support any kind of completion.? > I have been working on some code completion support for EclipseFP. It > is right now in a really infant stage, but it at least is something. > Just take a look a

[Haskell-cafe] Re: Why is $ right associative instead ofleftassociative?

2006-02-07 Thread Stefan Monnier
> The trouble with monad comprehensions was that it became far too easy to > write ambiguous programs, even when you thought you were just working with > lists. One solution was already suggested: to make the comprehension syntax be pure syntactic sugar whose semantics depends on the semantics of

  1   2   >