Re: [Haskell-cafe] coding standard question

2009-06-30 Thread Loup Vaillant
2009/6/22 Malcolm Wallace : > Erik de Castro Lopo wrote: > >> Vasili I. Galchin wrote: >> >> >  "where/let" functions use the >> > same name for function parameters as the outer function and hence >> > there is a "shadow" warning from the compiler. >> >> In Haskell there is an easy way around this

Re: [Haskell-cafe] Logo fun

2009-06-12 Thread Loup Vaillant
2009/6/11 Thomas Davie : > Here's the logo, continuing on the batteries included theme: > http://www.cs.kent.ac.uk/people/rpg/tatd2/HaskellBatteries.png I'd sugest a thinner and smaller lambda, or bigger (maybe longer) batteries. The + tip of the batteries should also be colored in gold. Loup. __

Re: [Haskell-cafe] Expression parsing problem

2009-05-19 Thread Loup Vaillant
Hello, 2009/5/19 leledumbo : >> expression ::= term | term "+" expression >> term ::= factor | factor "*" term >> factor ::= constant | variable | "(" expression ")" > > Oh, left recursion. Well, it should be easy to transform: > > expression ::= term | moreTerm > term ::= factor | moreFactor > mo

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

2009-04-26 Thread Loup Vaillant
!! Sorry for the noise. PS: In a meta interpreter, lexical scope seems to be actually easier to implement than dynamic scope. 2009/4/26 Loup Vaillant : > Hi, can this code > > (\a -> \b -> a) 1 2 > > eval to normal form in a strict language with dynamic scope? > &

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

2009-04-26 Thread Loup Vaillant
Hi, can this code (\a -> \b -> a) 1 2 eval to normal form in a strict language with dynamic scope? Thanks, Loup PS: some context: I am currently implementing a toy language. The AST is this one: data whnf = -- Weak Head Normal Form | Unit | Int of int | Bool of bool | Prim of (whnf

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

2009-04-24 Thread Loup Vaillant
2009/4/23 Miguel Mitrofanov : > On 23 Apr 2009, at 12:17, Thomas Davie wrote: > >> Haskell is a very horizontal language, and to limit our horizontal space >> seems pretty weird. > > +1. I sometimes use lines up to 200 characters long, when I feel they would > be more readable. 200 sounds awfully

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-26 Thread Loup Vaillant
2009/3/26 Thomas Hartman : >> Beginner list processing code can and often does go awry when presented with >> infinite lists. > > I didn't mean code that a beginner would write, I mean code that would > be easy to understand for a beginner to read For that, in this particular example, a type sign

Re: [Haskell-cafe] The votes are in!

2009-03-25 Thread Loup Vaillant
2009/3/24 John Van Enk : > If any one seconds the motion, i'm picking up this part of the thread and > putting it in the humor section of the haskell wiki. > /jve Seconded. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mai

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Loup Vaillant
2009/3/24 Manlio Perillo : > Jonathan Cast ha scritto: >> >> [...] >> >> I think, in general, the best way to document the purpose of the >> function is >> >>    -- | Split a function into a sequence of partitions of specified >> lenth >>    takeList :: [Int] -> [a] -> [[a]] *That* was what I crav

Re: [Haskell-cafe] I want to write a compiler

2009-03-08 Thread Loup Vaillant
Thanks to the courage you all gave me, I found the strength to go on. Template instantiation seems to be the easiest path, so I decided to follow it. I think I solved the problem about primitives and FFI I though it had. Namely, how the hell do I compile primitive calls with an arbitrary number of

Re: [Haskell-cafe] I want to write a compiler

2009-03-08 Thread Loup Vaillant
ghly Optimising Back End For Lazy Functional > Languages, U. Boquist, http://www.cs.chalmers.se/~boquist/ifl96-abstract.html Oh, I forgot about the second paper, thank you. I find it a bit clearer than the thesis. Having the GRIN BNF helps a lot. > Then again you said you're not interest

[Haskell-cafe] I want to write a compiler

2009-03-07 Thread Loup Vaillant
This is a homework question. I am mainly looking for guidance or pointers. Source code, even. (Not GHC's, though, it is too complicated for me right now. The AST of STG is fine, but the rest kinda scares me.) Ideally, I would very much like to compile to C. The requirements are easily stated. My

Re: [Haskell-cafe] The Haskell re-branding exercise

2008-12-22 Thread Loup Vaillant
2008/12/22 Eelco Lempsink : > Hmm, right. I started on a thing in HAppS. See > http://github.com/eelco/voting/ for the source code (contributors more than > welcome!) and http://code.tupil.com/voting/ for a live demo. It relies > heavily on javascript, needs some work on the UI and there are a l

Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Loup Vaillant
Thank you, everyone. You have addressed my concerns very accurately. So in short, higer rank types subsume existentials. Good. And the burden of emulating existentials can be lowered by a suitable macro system. Very good. 2008/11/9 Derek Elkins <[EMAIL PROTECTED]>: > There are various rules for mo

[Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Loup Vaillant
Maybe one subsumes the other? What I want to know is if there is an easy way to emulate one with the other, and how much convenience is lost in doing so. For instance, is it possible to implement stream fusion with rank2 types, or the ST monad with existantials? Is there any paper discussing thi

Re: [Haskell-cafe] Question concerning datatype "Either"

2008-07-04 Thread Loup Vaillant
2008/7/4 phy51km4n <[EMAIL PROTECTED]>: > > There is a exercise using datatype "Either" I'm a bit confused about... > > The following datatypes are given: > > data Either a b = Left a >| Right b > > data Tuple a b c d = One a > | Two a b > |

Re: [Haskell-cafe] gcc as a portable assembler: tail calls vs trampoline

2008-07-01 Thread Loup Vaillant
cc 4.1.2 yet). Did not notice any difference... > On Tue, 1 Jul 2008 16:57:38 +0200 > "Loup Vaillant" <[EMAIL PROTECTED]> wrote: > >> Hello, everyone, >> I'm not sure this is the good list for this posting: I plan to write >> yet another lazy graph re

[Haskell-cafe] gcc as a portable assembler: tail calls vs trampoline

2008-07-01 Thread Loup Vaillant
Hello, everyone, I'm not sure this is the good list for this posting: I plan to write yet another lazy graph reduction machine, using gcc, mainly for fun. My concern right now is about one particular aspect of gcc: the tail calls vs trampoline deathmatch. First some clarifications: -> By tail call

Re: [Haskell-cafe] Re: Lambda and closures in PHP -- could someone please comment?

2008-06-17 Thread Loup Vaillant
2008/6/17 Achim Schneider <[EMAIL PROTECTED]>: > PR Stanley <[EMAIL PROTECTED]> wrote: > >> Blimey! Talk about rearranging the deckchairs :-) >> With respect, do you not think it'd be wiser for the community to >> deal with a total lack of proper type checking, the lack of any >> notion of the gene

Re: [Haskell-cafe] Design your modules for qualified import

2008-06-07 Thread Loup Vaillant
2008/6/6 Andrew Coppin <[EMAIL PROTECTED]>: > Until very recently, it was not at all clear to me that there is actually a > very simple solution to this problem: > > import Text.ParserCombinators.Parsec as P > > Now I only have to write "P.runPaser", which is much shorter. Err, I have a beginner

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Loup Vaillant
2008/6/4 apfelmus <[EMAIL PROTECTED]>: > [...] > But it can waste space (-> "space leak"), for instance by > accumulating a big expression like > > (..) -> ((..)+1) -> (((..) + 1) + 1) -> etc. > > instead of evaluating x+1 immediately > > 5 -> 6-> 7-> etc. So, it is

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Loup Vaillant
[Forgot to post to the list, sorry] 2008/6/4 Duncan Coutts <[EMAIL PROTECTED]>: > > On Wed, 2008-06-04 at 09:32 +0200, Henning Thielemann wrote: >> On Tue, 3 Jun 2008, Don Stewart wrote: >> >> > I wrote up the second part of the tour of understanding low level >> > performance in GHC here, >> > >>

Re: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Loup Vaillant
2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>: > On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm pleased to announce yet another tool for importing darcs repositories >> to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in >> Haskell, o

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-28 Thread Loup Vaillant
2008/5/28 Iavor Diatchki <[EMAIL PROTECTED]>: > Hi, > "Purely Functional Data Structures" by Chris Okasaki is a good one. > Here is a link to it on Amazon: > http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504 > Good luck! > -Iavor Argh, I'm predated by a few seconds! :-

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-04 Thread Loup Vaillant
2008/4/4, Neil Mitchell <[EMAIL PROTECTED]>: > > > > Also, having strict Int's by default is a bit ugly, in an > > > > otherwise lazy-by-default language. > > > > > I meant: > > (\x (y :: Int) -> x + 1) 1 (1/0 :: Int) <=> _|_ ? > > Division by 0 is still an error. What I mean is: Yes,

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-04 Thread Loup Vaillant
2008/4/4, Neil Mitchell <[EMAIL PROTECTED]>: > > Also, having strict Int's by default is a bit ugly, in an > otherwise lazy-by-default language. You do mean that, for example (\x -> x + 1) (1/0 :: Int) <=> _|_ ? Does it bites often (and how, if you have any example)? cheers, Loup _

Re: [Haskell-cafe] Re: Function Precedence

2008-04-02 Thread Loup Vaillant
2008/4/2, Dan Piponi <[EMAIL PROTECTED]>: > On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley <[EMAIL PROTECTED]> wrote: > > All you'd have to do is to give the inner most function the highest > > precdence > > > What's the innermost function in "f g x" here? > > test :: (a -> b -> c) -> a -> b -> c >

Re: [Haskell-cafe] Function Precedence

2008-04-02 Thread Loup Vaillant
2008/4/2, Hans Aberg <[EMAIL PROTECTED]>: > On 2 Apr 2008, at 14:27, [EMAIL PROTECTED] > wrote: > > > > It would be better to write a new Prelude. :-) > > > > Oh, yes, our common dream... > > One may not need to write a wholly new Prelude, by something like: > > module NewPrelude where > > impor

Re: [Haskell-cafe] Re: FW: Haskell

2008-04-02 Thread Loup Vaillant
2008/4/2, Janis Voigtlaender <[EMAIL PROTECTED]>: > apfelmus wrote: > > > Janis Voigtlaender wrote: > > > > > Loup Vaillant wrote: > > > > Thanks to some geniuses (could someone name them?), we have type > > > > classes and higher orde

Re: [Haskell-cafe] FW: Haskell

2008-04-01 Thread Loup Vaillant
2008/4/1, Andrew Bagdanov <[EMAIL PROTECTED]>: > > In short, I think the orginal question must be asked in context. For > some problems, types are just a natural way to start thinking about > them. For others dynamic typing, with _judicious_ use of macros to > model key aspects, is the most n

Re: [Haskell-cafe] FW: Haskell

2008-04-01 Thread Loup Vaillant
2008/4/1, Bulat Ziganshin <[EMAIL PROTECTED]>: > Hello Simon, > > > Tuesday, April 1, 2008, 2:18:25 PM, you wrote: > > > How can one answer the question--why choose Haskell over Scheme? > > > 1. static typing with type inference - imho, must-be for production > code development. as many haskelle

Re: [Haskell-cafe] Function Precedence

2008-04-01 Thread Loup Vaillant
2008/4/1, Jules Bean <[EMAIL PROTECTED]>: > PR Stanley wrote: > > Why can't we have > > function application implemented outwardly (inside-out). > > No reason we can't. > > We could. > > We just don't. > > People have spent some time thinking and experimenting and have decided > this way roun

Re: [Haskell-cafe] Newbie question: mutually exclusive strict / lazy

2008-02-11 Thread Loup Vaillant
2008/2/11, Peter Verswyvelen <[EMAIL PROTECTED]>: > > Yes, sorry, GHC's strictness analyzer. > > What I meant with this email is that I guess that for a strictness analyzer, > the information that a function is strict in an argument *independent from > the other arguments* would not be good enough

Re: [Haskell-cafe] bimap 0.2

2008-02-05 Thread Loup Vaillant
2008/2/5, Neil Mitchell <[EMAIL PROTECTED]>: > 3) > insert x y = delete x > >>> deleteR y > >>> unsafeInsert x y > > Why not: > > insert x y = unsafeInsert x y . delete x . delete y > > Now you don't end up using the arrow combinators, and it becomes more > readable (at least to

Re: [Haskell-cafe] Who started 42, and when?

2008-02-01 Thread Loup Vaillant
2008/2/1, Christopher L Conway <[EMAIL PROTECTED]>: > Loup, > > This is not unique to the Haskell community. I suspect the arbitrary > constant 42 has been appearing unexplained in research papers for as > long as there have been computer scientists who were sci-fi geeks > (absolutely no offense in

[Haskell-cafe] Who started 42, and when?

2008-02-01 Thread Loup Vaillant
I have read quite a lot of Haskell papers, lately, and noticed that the number 42 appeared quite often, in informal tutorials as well as in very serious research papers. No wonder Haskell is the Answer to The Great Question of Life, The Universe, and Everything, but I would like to know who started