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

2007-10-27 Thread Isaac Dupree
Dougal Stanton wrote: On 27/10/2007, Isaac Dupree [EMAIL PROTECTED] wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file

Re: [Haskell-cafe] Fusing foldr's

2007-10-27 Thread Isaac Dupree
Josef Svenningsson wrote: Less bogus timing: avg4: 18.0s avgS: 2.2s avgP: 17.4s OK, so these figures make an even stronger case for my conclusion :-) Single traversal can be much faster than multiple traversals *when done right*. Did you use +RTS -N2 on your program (or whatever it is that

Re: [Haskell-cafe] ANN: Math.OEIS 0.1

2007-10-23 Thread Isaac Dupree
Brent Yorgey wrote: The point is, what you'd *like* (say) extendSequence [1,2,5,14,42] to do is return the *infinite* list of Catalan numbers, but that's very, very difficult to do in general! Actually impossible, since OEIS contains Busy Beaver sequences, which are not computable! (although

Re: [Haskell-cafe] Re: Using Haddock to document ADTs

2007-10-23 Thread Isaac Dupree
Simon Marlow wrote: Alfonso Acosta wrote: I'm beginning to get familiar with Haddock and I want to document a library which, as usually happens, has some ADT definitions. I'd like to document the ADTs both for the end-user (who shouldn't be told about its internal implementation) and future

Re: [Haskell-cafe] OS Abstraction module??

2007-10-23 Thread Isaac Dupree
Galchin Vasili wrote: In discussing this OS Abstraction Layer, I think I am thinking of some notion of laziness (read ... decisions made at run-time .. not compile-time .. otherwise I think we have to resort to ifdefs which are not so nice and require a lot of code maintenance.) It is

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-16 Thread Isaac Dupree
Ross Paterson wrote: I would make API extended only a bit more precise: any module that uses explicit import lists will not be affected by the changes. So one can add classes, types and functions, but not instances (except where either the class or the type is new). okay You probably can't

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-16 Thread Isaac Dupree
Neil Mitchell wrote: Hi I agree. = 1.0 isn't viable in the long term. Rather, a specific list, or bounded range of tested versions seems likely to be more robust. In general, if it compiles and type checks, it will work. It is rare that an interface stays sufficiently similar that the thing

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-16 Thread Isaac Dupree
Peter Verswyvelen wrote: Personally I could also live with allowing no space between the minus sign and the number... If you leave a space, - becomes the subtract operator. I once thought that... there was the opposition that (x-1) subtraction of a constant appears too often. And I found

Re: [Haskell-cafe] Hosting of Haskell project

2007-10-15 Thread Isaac Dupree
Magnus Therning wrote: On the other hand Redmine does look cleaner somehow and I've never seen a trac site that is as easy to find my way around as www.redmine.org. That site loads slowly for me in Firefox (loading several files per page, perhaps?). In some page's source on that site, it

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-13 Thread Isaac Dupree
ntupel wrote: Thanks for your reply Stefan. Unfortunately I could measure only a relatively small improvement by changing to concrete types the sample code was about one second faster when compiled with -O2. Profiling again indicated that most time was spend in random and randomR GHC

Re: [Haskell-cafe] do

2007-10-13 Thread Isaac Dupree
Luke Palmer wrote: Using this you can do more complex actions, like, for instance, adding two numbers: readLine = (\x - readLine = (\y - print (x + y))) Take a moment to grok that... Which you might like to write: do x - readLine y - readLine print (x + y) you can

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-13 Thread Isaac Dupree
Don Stewart wrote: I've seen similar results switching to the SIMD mersenne twister C implementation for randoms: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html If there's interest, I can package up the bindings for hackage. looks nice... at least for those of us who

Re: [Haskell-cafe] [EMAIL PROTECTED]: darcs patch: fix typo in docs.]

2007-10-12 Thread Isaac Dupree
David Roundy wrote: It seems a little unfriendly to reject contributions from anyone who isn't subscribed to the libraries mailing list... Quite so. `darcs send` should send to an e-mail address where darcs patch:es will be accepted (read at least, or responded to, or applied, as the case

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Isaac Dupree
Dan Weston wrote: applyNtimes :: (a - a) - Int - a - a This sounds like it should be in the library somewhere agree, I've used it a few times (mostly for testing things) - modulo argument order and Int vs. Integer vs. (Num a = a) Isaac ___

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Isaac Dupree
David Roundy wrote: On Wed, Oct 10, 2007 at 12:29:07PM +0200, [EMAIL PROTECTED] wrote: ChrisK writes: There are two things in Floating, the power function (**) [ and sqrt ] and the transcendental functions (trig functions,exp and log, and constant pi). Floating could be spit into two classes,

Re: [Haskell-cafe] Confusing type specialisation in ghci

2007-10-05 Thread Isaac Dupree
David Carter wrote: This is all as I would expect so far, but: Prelude let sqlist = map sq Prelude :t sqlist sqlist :: [Integer] - [Integer] And indeed, I get Prelude sqlist [2.5] interactive:1:8: No instance for (Fractional Integer) ... etc The dreaded Monomorphism Restriction,

Re: [Haskell-cafe] Re: PROPOSAL: New efficient Unicode string library.

2007-10-02 Thread Isaac Dupree
Stefan O'Rear wrote: On Tue, Oct 02, 2007 at 11:05:38PM +0200, Johan Tibell wrote: I do not believe that anyone was seriously advocating multiple blessed encodings. The main question is *which* encoding to bless. 99+% of text I encounter is in US-ASCII, so I would favor UTF-8. Why is UTF-16

Re: [Haskell-cafe] 'data' syntax - a suggestion

2007-09-27 Thread Isaac Dupree
Tomasz Zielonka wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thomas Conway writes: On 9/27/07, ok [EMAIL PROTECTED] wrote: I have often found myself wishing for a small extension to the syntax of Haskell 'data' declarations. It goes like this: ['where' clause to allow

Re: [Haskell-cafe] Troubles understanding memoization in SOE

2007-09-26 Thread Isaac Dupree
Peter Verswyvelen wrote: Let me see if I understand this correctly. Since I'm an imperative programmer, I'll try a bit of C++ here. struct Cell : Value { Value* head; Value* tail; }; So in (A) and (B), a Cell c1 is allocated, and c1-head would be a pointer to x, and c1-tail would be a

Re: [Haskell] Re: [Haskell-cafe] PROPOSAL: Rename haskell@ to haskell-announce@

2007-09-24 Thread Isaac Dupree
Claus Reinke wrote: so everything that would be of interest to all haskellers, including those too busy to follow haskell-cafe, would go to haskell, everything else would go to haskell-cafe. but even those topics starting out on haskell are meant to migrate to haskell-cafe after a few posts at

Re: [Haskell-cafe] Library Process (was Building production stable software in Haskell)

2007-09-23 Thread Isaac Dupree
Bulat Ziganshin wrote: Hello David, Sunday, September 23, 2007, 10:28:41 PM, you wrote: Let's say I have more than one Haskell implementation on my computer, e.g. GHC 6.6, GHC 6.7, and Hugs. (In MacPorts, these are the ghc, ghc-devel, and hugs packages, respectively.) Let's further say

[Haskell-cafe] Re: [Haskell] simple function: stack overflow in hugs vs none in ghc

2007-09-23 Thread Isaac Dupree
(redirecting to haskell-cafe) Tom Pledger wrote: | sqnc p ts = let ( r, ts' ) = p ts in case r of | Nothing - ([],ts') | Just x - let (r',ts'') = (sqnc p ts') in (x:r', ts'' ) : I don't know how ghc is avoiding the stack

Re: [Haskell-cafe] PROPOSAL: Rename haskell@ to haskell-announce@

2007-09-23 Thread Isaac Dupree
Neil Mitchell wrote: * Rename haskell@ to haskell-announce@, and redirect mails from haskell@ to haskell-announce@ for some period. I agree. Unless... do some people subscribe to haskell@ (not haskell-cafe@) and like the existing stuff that's sent there (not all announcements... I'm not

Re: [Haskell-cafe] Why isn't pattern matching lazy by default?

2007-09-19 Thread Isaac Dupree
Chaddaï Fouché wrote: 2007/9/19, Miguel Mitrofanov [EMAIL PROTECTED]: Now why isn't pattern matching lazy by default? This seems odd for a newbie since everything else is lazy by default. It's even more confusing that pattern matching in 'let' _is_ lazy. No, it's not. See, in let or where

Re: [Haskell-cafe] Why isn't pattern matching lazy by default?

2007-09-19 Thread Isaac Dupree
C.M.Brown wrote: Hi Miguel, See, in let or where constructs you don't have a choice; you can't do different things depending on whether some value is Just x or Nothing. Therefore, there is no need to perform pattern matching strictly. This is not entirely true. This is actually one of those

Re: [Haskell-cafe] Mutable but boxed arrays?

2007-09-06 Thread Isaac Dupree
Ketil Malde wrote: On Wed, 2007-09-05 at 20:37 +0200, Henning Thielemann wrote: Can someone explain me, why there are arrays with mutable but boxed elements? I, on the other hand, have always wondered why the strict arrays are called unboxed, rather than, well, strict? Strictness seems to be

Re: [Haskell-cafe] :, infix operator, infix constructor, et cetera

2007-08-26 Thread Isaac Dupree
Andrew Coppin wrote: Daniel C. Bastos wrote: But that won't compile, because it doesn't obey the syntax rules of Haskell. You could, however, write data List x = x : (List x) | End and it would work. 1 : (2 : (3 : End)) Except that (for no particularly good reason) : is a reserved

Re: [Haskell-cafe] GHC optimisations

2007-08-23 Thread Isaac Dupree
Hugh Perkins wrote: On 8/22/07, Twan van Laarhoven [EMAIL PROTECTED] wrote: But Double is already quite badly behaved: let x = 1e20 Prelude 1 + (x - x) 1.0 Prelude (1 + x) - x 0.0 E. Whilst that's understandable and unavoidable, that kindof rings alarm bells for folds of

Re: [Haskell-cafe] Tackling IO (the correct way)

2007-08-23 Thread Isaac Dupree
Dave Tapley wrote: Hi again all, I could do with some design pointers for a project I'm working on combining Haskell with a robot. My situation is: I read sensor data from the robot lazily a line at a time, as soon as a line is read in my code sends out a response down a pipe. Implemented in

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Isaac Dupree
Simon Peyton-Jones wrote: | Something I've pondered is adding a more-expressive form of RULES which | works using general pattern matching: Yes, but it would need the rule-matcher in the Simplifier to be more sophisticated. Have a look in specialise/Rules.lhs. No need to be so ambitious;

Re: [Haskell-cafe] GHC optimisations

2007-08-21 Thread Isaac Dupree
Simon Peyton-Jones wrote: | GHC does some constant folding, but little by way of strength | reduction, or using shifts instead of multiplication. It's pretty easy | to add more: it's all done in a single module. Look at primOpRules in | the module PrelRules. | | Patches welcome! But please

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Isaac Dupree
Duncan Coutts wrote: On Wed, 2007-08-15 at 18:23 +0100, Brian Hulley wrote: Therefore I propose: \of alts which doesn't suffer this problem since the keyword of can never follow a '\' in the existing grammar. Or how about: \case of alts which seems clearer to me.

Re: [Haskell-cafe] A few questions on primes generating.

2007-08-13 Thread Isaac Dupree
Andrew Coppin wrote: Stefan O'Rear wrote: Also, large numbers don't (this is arguably a bug...) have restricted types: [EMAIL PROTECTED]:~$ ghc -e '100 :: Int' -1486618624 So many other programming languages allow weird things to happen with numeric overflows... it would

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-13 Thread Isaac Dupree
Brian Hulley wrote: Thinking about this a bit more, and just so this thought is recorded for posterity (!) and for the benefit of anyone now or in a few hundred years time, trying to solve Fermat's last GUI, the object oriented solution allows the buffer object to do anything it wants, so that

Re: [Haskell-cafe] Re: Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-13 Thread Isaac Dupree
Benjamin Franksen wrote: I'd be careful. Introducing a network connection into the equation makes the object (its methods) susceptible to a whole new bunch of failure modes; think indefinite delays, connection loss, network buffer overflow, etc etc. It may be a mistake to abstract all that away;

Re: [Haskell-cafe] A few questions on primes generating.

2007-08-13 Thread Isaac Dupree
L.Guo wrote: Because 10,000,000 is too large for a Int On my pitiful system, maxBound::Int 2147483647 is certainly greater than 1000 . it is always in type of Integer or some higher level data type. Haskell doesn't do static checking like that. In GHC on my system (where 10,000,000,000

Re: [Haskell-cafe] Re: a regressive view of support for imperative programming in Haskell

2007-08-13 Thread Isaac Dupree
David Roundy wrote: The only cost is that this syntax relies on the do notation, and thus makes the desugaring of that do notation slightly more complicated when used. If I understand correctly, do blah f (do foo bar (- action) ) blah has an ambiguity: which

Re: [Haskell-cafe] Re: default for quotRem in terms of divMod?

2007-08-12 Thread Isaac Dupree
Henning Thielemann wrote: On Sun, 12 Aug 2007, Lennart Augustsson wrote: CPU design cannot be changed, because they implement well defined ISA. What is ISA? Why is it not possible to add CPU functions for `div` and `mod`? Instruction set architecture - it would take a concerted industry

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-12 Thread Isaac Dupree
apfelmus wrote: (3+) :: Int - Int ([1,2]++):: [Int] - [Int] insert x 3 :: Map String Int - Map String Int Of course, from the purely functional point of view, this is hardly perceived as mutation since the original value is not changed at all and still available. In other

Re: [Haskell-cafe] Re: default for quotRem in terms of divMod?

2007-08-11 Thread Isaac Dupree
Henning Thielemann wrote: Btw. is there any application, where 'quot' and 'rem' are needed? All occurrences of 'quot' and 'rem' I found in code so far were actually wrong and should have been 'div' and 'mod'. http://www.haskell.org/haskellwiki/Things_to_avoid#Forget_about_quot_and_rem Yes, my

Re: [Haskell-cafe] Re: default for quotRem in terms of divMod?

2007-08-11 Thread Isaac Dupree
Isaac Dupree wrote: I do think that if you almost always want to _use_ div and mod, you should be able to just define div and mod too (not quot and rem) that was unclear - I mean you should have that choice, not that it should be disallowed to define quot and rem only! Isaac

Re: [Haskell-cafe] Derivation of Eq given Ord

2007-08-09 Thread Isaac Dupree
Andreas Marth wrote: I would say that qualifies as a bug because it relays an error from compile time to run time. It doesn't relay anything to run time - ghci has to _compile_ the expressions you give it too. If you _compile something_ successfully, you will know that _it_ will not fail in

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-08-01 Thread Isaac Dupree
Simon Peyton-Jones wrote: When you install packages A,B,C, the documentation for A,B,C (and nothing else) ought to be locally available as an integrated whole, much as at the GHC web site. I don't know whether Cabal does, or could do, that, but it's surely what one would expect. and would

Re: [Haskell-cafe] -O2 compile option can give speed increase over -O. Fasta shootout program test runs.

2007-07-17 Thread Isaac Dupree
Derek Elkins wrote: Just to add as this was not addressed. -O2 -does not- turn off bounds checking or any other obvious safety mechanism. although even just -O removes GHC's special 'assert'ions (unless you explicitly keep them on?) -- though they shouldn't be used in such a way that they

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-17 Thread Isaac Dupree
Conor McBride wrote: Hi all On 9 Jul 2007, at 06:42, Thomas Conway wrote: I don't know if you saw the following linked off /. http://www.itwire.com.au/content/view/13339/53/ [..] The basic claim appears to be that discrete mathematics is a bad foundation for computer science. I suspect

Re: [Haskell-cafe] Perfect shuffle on std. libs

2007-07-15 Thread Isaac Dupree
Felipe Almeida Lessa wrote: I'd personally like to have at least the function shuffle :: RandomGen g = g - [a] - [a] Me too (along with permutations and a few, perhaps. shuffle doesn't create very long lists it doesn't start with, though, which makes me feel good about this...) shuffle is

Re: [Haskell-cafe] A really bad way to say all isSpace

2007-07-15 Thread Isaac Dupree
Neil Mitchell wrote: Hi, Reading through the code to read: read s = case [x | (x,t) - reads s, (,) - lex t] of [x] - x [] - error Prelude.read: no parse _ - error Prelude.read: ambiguous parse Reading through the code to lex, it appear that it

Re: [Haskell-cafe] no-coding functional data structures via lazyness

2007-07-15 Thread Isaac Dupree
Dave Bayer wrote: The code is very fast for its size; I haven't seen Haskell code posted on the web that comes close, and it is faster than any of my other tries (I posted this code to http://www.haskell.org/haskellwiki/Prime_numbers). Effectively, it steals a heap data structure out of thin

[Haskell-cafe] Frisby (PEG parser) unbiased-choice thoughts

2007-07-14 Thread Isaac Dupree
since I don't like unexpected behavior happening when something not intended to happen, happens, and it's better documentation (a free assertion) -- I find myself making Haskell comments to specify whether the left-biasedness of each (//) is important, various places in my own code that uses

Re: [Haskell-cafe] Haskell's prefix exprs

2007-07-09 Thread Isaac Dupree
Stefan O'Rear wrote: On Mon, Jul 09, 2007 at 03:55:52PM +0200, Christian Maeder wrote: Hi, I would like haskell to accept the following (currently illegal) expressions as syntactically valid prefix applications: f = id \ _ - [] g = id let x = [] in x h = id case [] of [] - [] i = id do [] j =

Re: [Haskell-cafe] TT check

2007-07-01 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew Coppin wrote: decode (c:cs) = case c of 'X' - X '*' - let (e0,cs0) = decode cs; (e1,cs1) = decode cs0 in (e0 `apply` e1, cs1) The letter X stands for the following combinator: X = \x - xSK K = \xy - x S = \fgx - fx(gx)

[Haskell-cafe] Re: [Haskell] ANN: Uniplate 1.0

2007-06-20 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil Mitchell wrote: Hi Thinking about this slightly further... For the implementation, Data.Derive has a special case for lists, tuples and Maybe. Its a shame that only a restricted number of types are supported - things like

Re: [Haskell-cafe] yi or not to yi was: IDE?

2007-06-18 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew Coppin wrote: OTOH... how the heck do you write an operating system in a language that doesn't even support I/O? :-S Back when I was first learning programming, with C, I had that exact same question: how the heck can your program DO

[Haskell-cafe] Re: [Haskell] ANN: Uniplate 1.0

2007-06-18 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil Mitchell wrote: Hi, I am pleased to announce Uniplate (formerly known as Play), a library for boilerplate removal requiring only Haskell 98 (for normal use) and optionally multi-parameter type classes (for more advanced features). This

Re: [Haskell-cafe] Reading open data types

2007-06-13 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Benja Fallenstein wrote: Hi all, We've had a discussion on #haskell about how we can make a function that reads in serialized values of an open data type, such as [...] However, this is still kind of boring. Is there a better way? If not,

Re: [Haskell-cafe] Existentials and type var escaping

2007-06-01 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 31/05/07, Isaac Dupree [EMAIL PROTECTED] wrote: foo undefined = undefined That's not true. When you evaluate foo undefined, it matches the first (irrefutable) pattern immediately, without any deconstruction

Re: [Haskell-cafe] Existentials and type var escaping

2007-05-31 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roberto Zunino wrote: In this function data C = C Int foo :: C - C foo ~(C x) = C x foo is _not_ the identity: its result must be non bottom, i.e. the constructor C is forced to its argument. foo undefined = undefined foo (C undefined) = C

Re: [Haskell-cafe] Re: Frisby grammars that have context

2007-05-30 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robin Green wrote: On Tue, 29 May 2007 19:28:02 -0400 Isaac Dupree [EMAIL PROTECTED] wrote: Luckily, Haskell's laziness means that doing an extra postprocessing pass doesn't necessarily yield two traversals requiring the whole file to be stored

Re: [Haskell-cafe] Memoization

2007-05-30 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Creighton Hogg wrote: Now maybe I'm being dense here, but would you really *want* a way in Haskell to do something like memo :: (a-b) - a-b since it changes the semantics of the function? It seems like a better abstraction would be to have memo

Re: [Haskell-cafe] Cabal can't install in home directory

2007-05-29 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Grzegorz wrote: Hi, It seems that if GHC is installed non-user-writable directory, and you want to install a package in the home directory (using runghc Setup configure --prefix=$HOME) this isn't possible: when running runghc Setup install you

Re: [Haskell-cafe] Re: Frisby grammars that have context

2007-05-29 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 apfelmus wrote: Mark T.B. Carroll wrote: I've been playing with Text.Parsers.Frisby to see how it stacks against other options and, while it's been great so far, I am finding that I can't encode a grammar where what's acceptable depends on what's

Re: [Haskell-cafe] Language extensions [was: Memoization]

2007-05-29 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simon Peyton-Jones wrote: | I wish the compilers would allow more fine grained switches on languages | extensions. -fglasgow-exts switches them all on, but in most cases I'm | interested only in one. Then typing errors or design flaws (like 'type

Re: [Haskell-cafe] Re: Frisby grammars that have context

2007-05-29 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 apfelmus wrote: Isaac Dupree wrote: apfelmus wrote: Mark T.B. Carroll wrote: I've been playing with Text.Parsers.Frisby to see how it stacks against other options and, while it's been great so far, I am finding that I can't encode a grammar

Re: [Haskell-cafe] More on the random idea

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: I've listed the mechanisms we use, and exploits that have been thought of, or discovered, over the years, on the page: http://haskell.org/haskellwiki/Safely_running_untrusted_Haskell_code The exception handling

Re: [Haskell-cafe] More on the random idea

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: I've listed the mechanisms we use, and exploits that have been thought of, or discovered, over the years, on the page: http://haskell.org/haskellwiki/Safely_running_untrusted_Haskell_code Lambdabot uses is the

Re: [Haskell-cafe] Distributing a program with support files

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil Mitchell wrote: Hi, I'm wanting to release a Haskell program, but am confused how I should distribute the associated files it needs. On Windows I would use the functions to find the path of the executable, and find the support files

Re: [Haskell-cafe] Mysterious monads

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew Coppin wrote: Take a look at the following: data Writer o v = Writer [o] v instance Monad (Writer o) where return v = Writer [] v (Writer os v) = f = let (Writer os' v') = f v in Writer (os ++ os') v' write ::

Re: [Haskell-cafe] Re: Memoization

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 apfelmus wrote: Mark Engelberg wrote: I'd like to write a memoization utility. Ideally, it would look something like this: memoize :: (a-b) - (a-b) memoize f gives you back a function that maintains a cache of previously computed values, so

Re: [Haskell-cafe] More on the random idea

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: I've listed the mechanisms we use, and exploits that have been thought of, or discovered, over the years, on the page: http://haskell.org/haskellwiki/Safely_running_untrusted_Haskell_code (Maybe some of the

Re: [Haskell-cafe] More on the random idea

2007-05-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Isaac Dupree wrote: The expression is bound to a random top level identifier (harmless to guess) What about the non-recursive case ...expr... of x - take 2048 (show x) this way expr can't refer to x (it doesn't at all need to be randomly

Re: [Haskell-cafe] Yet another top-level state proposal

2007-05-26 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Judah Jacobson wrote: Hi all, Given the recent discussion about adding top-level mutable state to Haskell, I thought it might be a good time to throw my own proposal into the ring. If enough people think it's worth considering, I can add it to

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: Lambdabot uses 1) type guarantee of no-IO at the top level, along with 2) a trusted module base (pure module only, that are trusted to not export evil things), as well as 3) restricting only to H98-language only (things

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: isaacdupree: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: Lambdabot uses 1) type guarantee of no-IO at the top level, along with 2) a trusted module base (pure module only, that are

Re: [Haskell-cafe] Bug in GADT Implementation?

2007-05-26 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 26/05/07, Dominic Steinitz [EMAIL PROTECTED] wrote: This seems even worse to me. A is not inhabited so how can 42 be of type A? I think it should work. The context on the F constructor says that A is an instance of Num, so

[Haskell-cafe] Re: [Haskell] New book: Real-World Haskell!

2007-05-24 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donald Bruce Stewart wrote: Finally, a very exciting aspect of this project is that O'Reilly has agreed to publish chapters online, under a Creative Commons License! Neat! Which one? (see e.g. Creative Commons in

Re: [Haskell-cafe] global variables

2007-05-22 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Isaac Dupree wrote: Maybe some sort of ISOLATE, DON'T_OPTIMIZE (but CAF), or USED_AS_GLOBAL_VARIABLE pragma instead of just the insufficient NOINLINE would be a good first step... if successful it would remove the occasional need for -fno-cse

Re: [Haskell-cafe] global variables

2007-05-20 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adrian Hey wrote: [cc'ing HPrime] Isaac Dupree wrote: The unsafePerformIO hack being used is not very satisfactory given how many optimizations make it difficult to use safely in practice. This hack is also used many places. I would

[Haskell-cafe] HaskellWiki XHTML not well-formed or valid

2007-05-20 Thread Isaac Dupree
I mentioned this a few months ago in a place no-one noticed, it seems... http://www.haskell.org/haskellwiki/Talk:Haskell#Well-formedness_.2F_validity Please fix, or tell me who to contact (and how), or how to fix it myself? :-) Isaac ___ Haskell-Cafe

Re: [Haskell-cafe] global variables

2007-05-18 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adrian Hey wrote: Furthermore, if it is going to take this state handle as an explicit argument then you need to provide some way for users to get this state handle. This could be by.. 1 - Making it an argument of main. 2 - Exposing a

Re: [Haskell-cafe] global variables

2007-05-17 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adrian Hey wrote: They are necessary because they are the only way to ensure important safety properties of many IO APIs. That's a bold claim. It's very hard to prove that things don't exist. (That is, that other ways to ensure these safety

Re: [Haskell-cafe] IO Monad operation madness

2007-05-17 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 linkedListToHaskellStringList :: LinkedList - IO [String] linkedListToHaskellStringList listPtr = let convertList' ptr = convertList' :: LinkedList - [IO String], I infer? if listIsNull ptr then []

Re: [Haskell-cafe] IO Monad operation madness

2007-05-17 Thread Isaac Dupree
Rob Hoelz wrote: The problem I have with that is that I'd have to do something like this: str - peekCString = (linked_list_getdata ptr) next - linked_list_next ptr rest - linkedListToHaskellStringList next return (str : rest) Exactly! That's normal Haskell code! I don't like this

Re: [Haskell-cafe] 'Proper' use of the State monad

2007-04-30 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Denis Volk wrote: There are difficulties with the first option, including keeping even more state about what we're doing (for instance, are we in a menu?), and adding stuff later would possibly require substantial rewrites. Other than the fact

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: G'day all. Quoting Isaac Dupree [EMAIL PROTECTED]: Okay, looking at that code: The comments before the type definitions are mostly good... now it looks like I'm going into critique mode :) BTW, for the record, I

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-19 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: I updated the diff example a bit: http://andrew.bromage.org/darcs/diff/ It now features TWO newtype synonyms. This illustrates a crucial feature of Haskell: Abstractions are cheap. Okay, looking at that code: The

Re: [Haskell-cafe] Re: Writing guards shorthand

2007-04-19 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jón Fairbairn wrote: Is there some reason why you don't want data Op = Aop Aop | Bop Bop data Aop = Minus | Plus | Mul data Bop = LT | GT or similar? I would agree that it's a shame one cannot just write data Op = Aop (Minus |

Re: [Haskell-cafe] Why the Prelude must die

2007-04-01 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 24/03/07, Stefan O'Rear [EMAIL PROTECTED] wrote: This is a ranty request for comments, and the more replies the better. Without responding to any particular comment, my opinion is that we should have a minimal Prelude with

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-19 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pete Kazmier wrote: Bryan O'Sullivan [EMAIL PROTECTED] writes: Pete Kazmier wrote: I understand the intent of this code, but I am having a hard time understanding the implementation, specifically the combination of 'fix', 'flip', and

[Haskell-cafe] Does inlinePerformIO = unsafePerformIO . unsafeInterleaveIO semantically?

2007-03-18 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Compare the guarantees (in practice and/or theoretically) of inlinePerformIO and unsafePerformIO . unsafeInterleaveIO (i.e. function composition) (aside from inlinePerformIO being better optimized). Are they the same, or if not, what do they mean -

Re: [Haskell-cafe] Re: idea for avoiding temporaries

2007-03-11 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simon Marlow wrote: GHC doesn't have any kind of uniqueness analysis right now. It's pretty hard to do in general: imagine a function that takes an array as an argument and delivers an array as a result. It'll probably need two versions: one

Re: [Haskell-cafe] Haskell File reading

2007-03-07 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 cornmouse wrote: I have a txt file, which contains a paragraph. I am trying to read the file, and pass the contents of the file as a string to another function called createIndex. createIndex is a function to generate index of the input string.

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-03-06 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Douglas Philips wrote: On 2007 Mar 3, at 7:43 AM, Ross Paterson indited: but oddly doesn't seem to have been clarified in the report. We should definitely make sure that Haskell' does so! Or perhaps we should get rid of \begin{code} and

Re: [Haskell-cafe] MPTCs and rigid variables

2007-03-06 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 too complicated? more explanation isn't always more helpful. the user is confused at this point, and more information might mean more confusion. That is true, but my experience is that when an error message perplexes me I need all the suggestions

Re: [Haskell-cafe] Implementation of Dynamic datatype

2007-03-03 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stefan O'Rear wrote: On Sat, Mar 03, 2007 at 09:18:00AM +, Lennart Augustsson wrote: Why would there be an extra function? Because the compiler can't statically prove that the typeRep field of the dictionary doesn't depend on its argument.

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-03-03 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Isaac Dupree wrote: we don't have standards-quality wording yet Okay, here's a first attempt at formalizing it. It's really messy yet, and doesn't incorporate narrative material from the Haskell 98 literate comments section yet. Feedback so far

[Haskell-cafe] instance Eq Exception??

2007-03-03 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It seems the Exception datatype is currently an instance of Eq, that does not even satisfy reflexivity (for Dynamic exceptions). Does anybody use this? What is it good for? Why is it there? What if we delete the instance because it doesn't make sense?

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-03-02 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nice, I pretty much agree with you on everything :) Ian Lynagh wrote: On Wed, Feb 28, 2007 at 05:48:09PM -0500, Isaac Dupree wrote: Trying to implement literate haskell[*], I realized several ways in which the correct behavior for unliterating

[Haskell-cafe] Implementation of Dynamic datatype

2007-03-02 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Currently we have data Dynamic = Dynamic TypeRep Obj where Obj is {-in GHC up to 6.6-} type Obj = forall a . a {-in GHC 6.7.something-} type Obj = Any -- Use GHC's primitive 'Any' type to hold the dynamically typed value. {-in some other compilers

Re: [Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas Hartman wrote: Thanks. I incorporated these changes, and it cranks longer now before failing. But still fails, now with a seg fault. Does this just mean I don't have enough ram, or cpu, or ... Any ideas? [...] gcc: Internal error:

<    1   2