Re: [Haskell-cafe] Alex and Flex

2008-10-03 Thread Brandon S. Allbery KF8NH
On Oct 3, 2008, at 09:24 , Manlio Perillo wrote: Manlio Perillo ha scritto: However I have noted that there are some difference in the syntax between Alex and Flex? What is the rationale? By the way, here is the list of differences between Alex and Flex I have found, for people

Re: [Haskell-cafe] Stacking monads

2008-10-03 Thread Brandon S. Allbery KF8NH
On Oct 3, 2008, at 15:10 , Andrew Coppin wrote: The reason for the separation of the two for many functions is so that types which are instances of only one of the two can still take advantage of the functionality. Well, that makes sense once you assume two seperate, unconnected classes.

Re: [Haskell-cafe] Health effects

2008-10-03 Thread Brandon S. Allbery KF8NH
On Oct 3, 2008, at 15:38 , Paul Johnson wrote: Andrew Coppin wrote: Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something... My Dad once ate two bars of dark cooking chocolate. He said he got some odd visual

Re: [Haskell-cafe] Building gtkhs, OpenSolaris x86

2008-10-03 Thread Brandon S. Allbery KF8NH
On 2008 Oct 3, at 16:08, Lally Singh wrote: I know it seems an obtuse OS to build on, but trust me, it's pretty nice despite the hassles. I'm getting these three errors (repeated a few times) while building gtkhs-0.9.13 on ghc 6.8.3, and was hoping for any suggestions on where to go from

Re: [Haskell-cafe] Health effects

2008-10-03 Thread Brandon S. Allbery KF8NH
On 2008 Oct 3, at 15:50, Andrew Coppin wrote: Paul Johnson wrote: Andrew Coppin wrote: Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something... My Dad once ate two bars of dark cooking chocolate. He said he

Re: [Haskell-cafe] Haskell-cafe-cafe? Was: Re: Health effects

2008-10-03 Thread Brandon S. Allbery KF8NH
On 2008 Oct 3, at 21:01, Christopher Lane Hinson wrote: What /is/ it with haskell-cafe lately? Do we need a haskell-blah mailing list? I would subscribe to that. Hell, I would post to it probably more than I post to haskell-cafe. But I'd also divert it to a separate mailbox for when I

Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Brandon S. Allbery KF8NH
On 2008 Oct 2, at 19:00, Jason Dagit wrote: On Thu, Oct 2, 2008 at 2:46 PM, Jason Dusek [EMAIL PROTECTED] wrote: John Dorsey [EMAIL PROTECTED] wrote: Now you can: * Solve any of the software problems that cannot be solved without the singleton tuple ! What would those be? I'm still

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Brandon S. Allbery KF8NH
On Oct 1, 2008, at 15:51 , Andrew Coppin wrote: wman wrote: Long story short, I promised him a one-liner to show the power and beauty of Haskell. (writeFile output.csv) = (liftM printCSV $ liftM (map updateLine) $ parseCSVFromFile input.csv) Is there room for improvement ? Um... Does

Re: [Haskell-cafe] Re: Health effects

2008-10-01 Thread Brandon S. Allbery KF8NH
On 2008 Oct 1, at 15:56, Andrew Coppin wrote: Benjamin L.Russell wrote: On Tue, 30 Sep 2008 19:54:17 +0200, Adrian Neumann [EMAIL PROTECTED] wrote: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But

Re: [Haskell-cafe] Haskell versus F#, OCaml, et. al. ...

2008-09-30 Thread Brandon S. Allbery KF8NH
On 2008 Sep 30, at 10:25, John Goerzen wrote: Galchin, Vasili wrote: Frank mode on ... ;^) In terms of functionality, where is Haskell superior vs inferior to ML, Caml, OCaml, F#, Erlang, etc.? E.g. in terms of library functionality? * Two list-like types. Standard list was strict,

Re: [Haskell-cafe] postmortem question about xmonad

2008-09-30 Thread Brandon S. Allbery KF8NH
On 2008 Sep 30, at 17:59, Derek Elkins wrote: On Tue, 2008-09-30 at 13:20 -0700, Don Stewart wrote: noteed: I'd like to know, now that time got by a bit, what the writers of the X monad think about the use of the ReaderT/WriterT/IO brought to them (to isolate Configuration data and dynamic

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Brandon S. Allbery KF8NH
On Sep 29, 2008, at 15:49 , Andrew Coppin wrote: Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just like to set an environment variable while each command runs... But alas no, the only way to do that

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Brandon S. Allbery KF8NH
On Sep 29, 2008, at 15:59 , Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: On Sep 29, 2008, at 15:49 , Andrew Coppin wrote: Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just like to set

Re: [Haskell-cafe] Type-level programming [The container problem]

2008-09-28 Thread Brandon S. Allbery KF8NH
On 2008 Sep 28, at 4:47, Andrew Coppin wrote: By the way... I've seen a lot of type-level programs that allow you to express (and therefore verify) some pretty extreme properties of your code. In other words, you can make the compiler do more checking than it normally would. But the actual

Re: [Haskell-cafe] bug in number reading?

2008-09-28 Thread Brandon S. Allbery KF8NH
On 2008 Sep 28, at 18:42, Jason Dusek wrote: Maybe I'm missing something, but this doesn't seem right... :; ghc -e '10e4' interactive:1:0: Warning: Defaulting the following constraint(s) to type `Double' `Fractional a' arising from a use of `it' at interactive:1:0-3 In

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 9:24, Andrew Coppin wrote: David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself.

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

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 11:59, Simon Marlow wrote: Magnus Therning wrote: Wolfgang Jeltsch wrote: Am Freitag, 26. September 2008 09:24 schrieb Magnus Therning: Recently I received an email with a question regarding the licensing of a module I've written and uploaded to Hackage. I released it

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 12:41, Andrew Coppin wrote: I'm not sure how that qualifies set as not really a true monad anyway - but then, I don't know what a monad is, originally. I only know what it means in Haskell. I think you read him backwards: Map and Set are category-theory (true) monads,

Re: [Haskell-cafe] cabal upgrade

2008-09-26 Thread Brandon S. Allbery KF8NH
On 2008 Sep 26, at 4:49, Achim Schneider wrote: Well, I might be spoiled by portage but shouldn't there be a thing like cabal upgrade pureMD5 and cabal upgrade --all snuffy:502 Z$ cabal help upgrade Usage: cabal upgrade [FLAGS] or: cabal upgrade [PACKAGES] -- brandon s. allbery

Re: [Haskell-cafe] Kind-of-off-Topic: Random thoughts on language design

2008-09-26 Thread Brandon S. Allbery KF8NH
On Sep 26, 2008, at 12:30 , Rafael Gustavo da Cunha Pereira Pinto wrote: While studying Haskell, the functional bug bit me and I realized that this architecture is somewhat not well suited for traditional compilers. I suddenly started thinking on how one could implement some kind of

Re: [Haskell-cafe] Re: The container problem

2008-09-26 Thread Brandon S. Allbery KF8NH
On 2008 Sep 26, at 15:42, John Van Enk wrote: Lets start donating a specific quantity of pizzas to Don every week, but vary the quality of the pizza. We'll check his Hackage submissions and then tune the pizza algorithm to the desired output. :) Premature optimization is the root of all

Re: [Haskell-cafe] Re: Microsoft's Craig Mundie outlines the future of computing

2008-09-25 Thread Brandon S. Allbery KF8NH
On Sep 25, 2008, at 13:50 , Achim Schneider wrote: Lihn, Steve [EMAIL PROTECTED] wrote: Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, Just curious: What'd happen if I forward this message to

Re: Re[8]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Brandon S. Allbery KF8NH
On Sep 24, 2008, at 13:44 , Bulat Ziganshin wrote: (note how he keeps trying to run dons out of the discussion because he has proof to the contrary). Don os free to present such examples. unfortunately all examples i've seen was due to use of slow C code which easily can be made faster. in

Re: Re[10]: [Haskell-cafe] Climbing up the shootout...

2008-09-24 Thread Brandon S. Allbery KF8NH
On Sep 24, 2008, at 15:20 , Bulat Ziganshin wrote: Wednesday, September 24, 2008, 11:13:14 PM, you wrote: can come up with, including amorphous and vacuous ones (you can almost always write something faster, but with how much effort?) as i said, eddorts to optimize Haskell code is several

Re: [Haskell-cafe] Random question

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 17:44, Iain Barnett wrote: On 24 Sep 2008, at 10:13 pm, Evan Laforge wrote: For one approach, check out 'replicate' to make copies of something, and then 'sequence' to run them and return a list. Thanks, I haven't found anything that explains 'sequence' well yet, but

Re: [Haskell-cafe] [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 20:14, Stephane Bortzmeyer wrote: % ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 You probably have 6.8.2's Cabal (in the 1.2 series), while the package requires 1.4 (and 1.2 isn't smart enough to check versions). -- brandon s. allbery

[Haskell-cafe] Re: [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 20:30, Stephane Bortzmeyer wrote: On Wed, Sep 24, 2008 at 08:24:09PM -0400, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote a message of 13 lines which said: You probably have 6.8.2's Cabal (in the 1.2 series), while the package requires 1.4 (and 1.2 isn't smart enough

Re: [Haskell-cafe] need help making sense of the type ...

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 24, at 22:51, Daryoush Mehrtash wrote: I am having hard time making sense of the types in the following example from the Applicative Programming paper: http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf ap :: Monad m ⇒ m (a → b ) → m a → m b ap mf mx = do f ← mf x ← mx return

Re: [Haskell-cafe] if - then - else layout

2008-09-24 Thread Brandon S. Allbery KF8NH
On 2008 Sep 25, at 0:47, leledumbo wrote: consider this partial program: if n5 then putStrLn big else putStrLn small this works fine in hugs, but in ghc I must change it to: if n5 then putStrLn big else putStrLn small Actually, this also works: if n 5 then putStrLn big

Re: [Haskell-cafe] piping to system call

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 23, at 7:55, Marc Weber wrote: On Tue, Sep 23, 2008 at 01:37:56PM +0200, Janis Voigtlaender wrote: assume I have a program taking input from stdin. How do I call it from Haskell while feeding to it a string as input. Sure, have a look at

Re: [Haskell-cafe] Line noise

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 21, at 15:10, Andrew Coppin wrote: Philippa Cowderoy wrote: On Sun, 21 Sep 2008, Andrew Coppin wrote: - Several standard library functions have names which clash badly with the usual meanings of those names - e.g., break, return, id. For this one, I'm inclined to say welcome to

Re: [Haskell-cafe] Re: [m..n] question

2008-09-23 Thread Brandon S. Allbery KF8NH
On 2008 Sep 22, at 5:46, Jon Fairbairn wrote: Richard A. O'Keefe [EMAIL PROTECTED] writes: It is being claimed that the reason for this is that exceptions are problematic in Hasell, so the Haskell designers went out of their way to make this function total whether it made sense or not. I'm

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 12:57, Donnie Jones wrote: checking GL/gl.h usability... yes checking GL/gl.h presence... yes checking for GL/gl.h... yes checking OpenGL/gl.h usability... no checking OpenGL/gl.h presence... no checking for OpenGL/gl.h... no checking GL/glu.h usability... yes checking

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 21:47, Donnie Jones wrote: However, when building the Haskell GLUT 'Hello World' it uses, -lGLU to link GLUT, but that does not work; however, from the config.log output configure seems to think that -lGL should work. Is there a way I can change the build to use -lglut?

Re: SOLVED. Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 22:10, Donnie Jones wrote: ghc -package GLUT -lglut Hello1.hs -o Hello1 --- works! :) I'm not sure why I must specify -package GLUT and -lglut but that prevents the linker errors. Also, shouldn't configure correctly figure out how to link the GLUT libraries? Can

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-19 Thread Brandon S. Allbery KF8NH
On 2008 Sep 19, at 17:14, Manlio Perillo wrote: Brandon S. Allbery KF8NH ha scritto: There are two ways to handle a growable stack; both start with allocating each stack in a separate part of the address space with room to grow it downward. The simpler way uses stack probes on function

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Brandon S. Allbery KF8NH
On Sep 18, 2008, at 15:10 , Manlio Perillo wrote: Allocation areas are per-CPU, not per-thread. A Concurrent Haskell thread consists of a TSO (thread state object, currently 11 machine words), and a stack, which we currently start with 1KB and grow on demand. How is this implemented? I

Re: [Haskell-cafe] about openTempFile

2008-09-17 Thread Brandon S. Allbery KF8NH
On 2008 Sep 17, at 8:17, Manlio Perillo wrote: The Python tempfile module, as an example, implements a wrapper around mkstemp function that does exactly this, and the code is portable; on Windows it uses O_TEMPORARY_FILE flag, on POSIX systems the file is unlink-ed as soon as it is created

Re: [Haskell-cafe] How to check if two Haskell files are the same?

2008-09-17 Thread Brandon S. Allbery KF8NH
On 2008 Sep 17, at 14:17, Alfonso Acosta wrote: On Wed, Sep 17, 2008 at 1:03 AM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On 2008 Sep 16, at 10:30, Mauricio wrote: I would like to write a Haskell pretty-printer, using standard libraries for that. How can I check if the original

Re: [Haskell-cafe] Re: Float instance of 'read'

2008-09-17 Thread Brandon S. Allbery KF8NH
On 2008 Sep 17, at 14:38, Aaron Denney wrote: On 2008-09-17, Mauricio [EMAIL PROTECTED] wrote: Localized reading should be somewhere else, perhaps related to Locales. No! If we had that, string from a program would not be readable by some program running in other machine, or other locale.

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Brandon S. Allbery KF8NH
On 2008 Sep 17, at 16:44, Evan Laforge wrote: The fast context switching part seems orthogonal to me. Why is it that getting the OS involved for context switches kills the performance? Is it that the ghc RTS can switch faster because it knows more about the code it's running (i.e. the OS

Re: [Haskell-cafe] Re: about openTempFile

2008-09-17 Thread Brandon S. Allbery KF8NH
On 2008 Sep 17, at 18:20, Aaron Denney wrote: On 2008-09-17, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On 2008 Sep 17, at 8:17, Manlio Perillo wrote: The Python tempfile module, as an example, implements a wrapper around mkstemp function that does exactly this, and the code is portable

Re: [Haskell-cafe] How to check if two Haskell files are the same?

2008-09-16 Thread Brandon S. Allbery KF8NH
On 2008 Sep 16, at 10:30, Mauricio wrote: I would like to write a Haskell pretty-printer, using standard libraries for that. How can I check if the original and the pretty-printed versions are the same? For instance, is there a file generated by GHC at the compilation pipe that is always

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

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 1:24, Daryoush Mehrtash wrote: What I am trying to figure out is that say on the code for the IRC bot that is show here http://www.haskell.org/haskellwiki/Roll_your_own_IRC_bot/Source What would theorem proofs do for me? Assurance of correct operation; for example, a

Re: [Haskell-cafe] ask

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 20:47, Brandon S. Allbery KF8NH wrote: On 2008 Sep 14, at 20:24, Cetin Sert wrote: Hi why do I get? [EMAIL PROTECTED]:~/lab/exp/1 ./eq 23 23 3 a = b = c = n1-0.8457820374040622n2-0.1542179625959377 As is typical for Unix, filehandles including standard input and standard

Re: [Haskell-cafe] ask

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 20:24, Cetin Sert wrote: Hi why do I get? [EMAIL PROTECTED]:~/lab/exp/1 ./eq 23 23 3 a = b = c = n1-0.8457820374040622n2-0.1542179625959377 As is typical for Unix, filehandles including standard input and standard output are line buffered. See hSetBuffering (

Re: [Haskell-cafe] random colors, stack space overflow, mersenne and mersenne.pure64

2008-09-12 Thread Brandon S. Allbery KF8NH
On 2008 Sep 12, at 21:57, Don Stewart wrote: cetin.sert: random = color2 randomR = colorR color2 :: RandomGen g .$BM.(B g .$B*.(B (RGB,g) color2 = colorR (minRGB,maxRGB) color :: RandomGen g .$BM.(B g .$B*.(B (RGB,g) color s0 = ((r,g,b),s3) where There's some corruption

Re: [Haskell-cafe] Windows console

2008-09-12 Thread Brandon S. Allbery KF8NH
On 2008 Sep 12, at 22:29, Curt Sampson wrote: On 2008-09-12 20:29 +0100 (Fri), Andrew Coppin wrote: Looks like the only thing it doesn't do is let you change the title on the console window. (Because, obviously, that's only possible on Windows.) Right. Unless you send an ^[^H]0;foo^G

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-11 Thread Brandon S. Allbery KF8NH
On 2008 Sep 12, at 0:24, Donnie Jones wrote: I am trying to test do some OpenGL / GLUT programming in Haskell, but I had linker issues testing the 'Hello World' OpenGL Haskell program. I believe the linker issues were caused because the Haskell GLUT package couldn't find the GLUT C

Re: [Haskell-cafe] Hackage policy question

2008-09-10 Thread Brandon S. Allbery KF8NH
On 2008 Sep 10, at 6:48, Wolfgang Jeltsch wrote: Am Mittwoch, 10. September 2008 11:47 schrieben Sie: So we should think about how to make it less confusing. Perhaps like distributors use an extra revision number we should do the same. Yes, maybe this is the way to go. Everyone who manages

Re: [Haskell-cafe] Re: Field names

2008-09-10 Thread Brandon S. Allbery KF8NH
On 2008 Sep 10, at 8:53, Bulat Ziganshin wrote: Wednesday, September 10, 2008, 4:07:41 PM, you wrote: Do you have any reference for that use of infixing constructors by start their name with ':'? That's interesting, and I didn't know about it. really? ;) sum (x:xs) = x + sum xs sum [] =

Re: [Haskell-cafe] Hackage policy question

2008-09-10 Thread Brandon S. Allbery KF8NH
On 2008 Sep 10, at 17:51, Duncan Coutts wrote: dependent packages don't get confused when it's re-released. If we're considering modifying hackage's versioning, we should probably decide if we want/need this now instead of having to add it in later when something major goes *boom*. We've

Re: [Haskell-cafe] Hackage policy question

2008-09-10 Thread Brandon S. Allbery KF8NH
On 2008 Sep 10, at 18:43, Duncan Coutts wrote: On Wed, 2008-09-10 at 18:35 -0400, Brandon S. Allbery KF8NH wrote: On 2008 Sep 10, at 17:51, Duncan Coutts wrote: dependent packages don't get confused when it's re-released. If we're considering modifying hackage's versioning, we should probably

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-08 Thread Brandon S. Allbery KF8NH
On 2008 Sep 8, at 21:00, Timothy Goddard wrote: I am not a mathematician, I can't prove it, but I can't think of circumstances where I would need to put mutable references in a data structure except where the language and compiler can't handle immutable structures efficiently. The status

Re: [Haskell-cafe] Re: Top Level -

2008-09-07 Thread Brandon S. Allbery KF8NH
On 2008 Sep 7, at 6:23, Ganesh Sittampalam wrote: On Sat, 6 Sep 2008, Ashley Yakeley wrote: Ganesh Sittampalam wrote: The set of ACIO expressions exp is the static initialisers of M. The RTS must note when each static initialiser is run, and cache its result val. Let's call this cache of

Re: [Haskell-cafe] Re: Top Level -

2008-09-07 Thread Brandon S. Allbery KF8NH
On 2008 Sep 7, at 12:10, Ganesh Sittampalam wrote: On Sun, 7 Sep 2008, Brandon S. Allbery KF8NH wrote: Since you consider memory leaks to be worse than correct behavior, Not leaking memory is *part* of correct behaviour. If - is to be created at all, it should be created with restrictions

Re: [Haskell-cafe] Re: language proposal: ad-hoc overloading

2008-09-07 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 19:09, John Smith wrote: Ryan Ingram wrote: module Prob where import qualified Data.Map as M newtype Prob p a = Prob { runProb :: [(a,p)] } combine :: (Num p, Ord a) = Prob p a - Prob p a combine m = Prob $ M.assocs $ foldl' (flip $ uncurry $ M.insertWith (+))

Re: [Haskell-cafe] Re: Top Level -

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 6:10, Ashley Yakeley wrote: Ganesh Sittampalam wrote: I would call it a leak if something that is no longer being used cannot be reclaimed. The endless stream of different modules is possible in long-running systems where the code being run evolves or changes over time

Re: [Haskell-cafe] What's the best way to give up?

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 7:30, David F. Place wrote: Say I have a function solve which is a constraint solver. It reconfigures its input to be a solution. If there is no solution, it returns the input. solve :: a - Either a a solve input output = maybe (Left input) Right $ solve' input If there

Re: [Haskell-cafe] Re: Top Level -

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 11:22, Ganesh Sittampalam wrote: On Sat, 6 Sep 2008, Brandon S. Allbery KF8NH wrote: On 2008 Sep 6, at 6:10, Ashley Yakeley wrote: The set of ACIO expressions exp is the static initialisers of M. The RTS must note when each static initialiser is run, and cache its result

Re: [Haskell-cafe] Re: Top Level -

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 18:06, Ashley Yakeley wrote: Ganesh Sittampalam wrote: The set of ACIO expressions exp is the static initialisers of M. The RTS must note when each static initialiser is run, and cache its result val. Let's call this cache of vals the static results cache of M. When M

Re: [Haskell-cafe] Re: Top Level -

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 18:25, Ashley Yakeley wrote: 1. Results from initialisers cannot be GC'd even if they become otherwise unreachable, because the dynamic loader might re-load the module (and then we'd need those original results). 2. If the dynamic loader loads an endless stream of different

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Brandon S. Allbery KF8NH
On 2008 Sep 5, at 12:45, Bryan O'Sullivan wrote: On Fri, Sep 5, 2008 at 5:04 AM, Claus Reinke [EMAIL PROTECTED] wrote: Seriously, though, what is the RWH authors' plan for tackling the eternal frustration of Haskell book authors, a moving target? Other tech books face the same problem,

Re: [Haskell-cafe] Re: 2 modules in one file

2008-09-05 Thread Brandon S. Allbery KF8NH
On 2008 Sep 5, at 19:36, Aaron Denney wrote: On 2008-08-30, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On 2008 Aug 30, at 4:22, Aaron Denney wrote: On 2008-08-27, Henrik Nilsson [EMAIL PROTECTED] wrote: And there are also potential issues with not every legal module name being

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Brandon S. Allbery KF8NH
On Sep 4, 2008, at 13:41 , Andrew Coppin wrote: Ryan Ingram wrote: It's pretty simple, I think. type ExpGen = ReaderT [String] Gen arbExp :: ExpGen Expression -- exercise for the reader instance Arbitrary Expression where arbitrary = runReaderT arbExp [] coarbitrary = coarbExp

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Brandon S. Allbery KF8NH
On 2008 Sep 4, at 18:00, Justin Bailey wrote: On Thu, Sep 4, 2008 at 2:52 PM, Philippa Cowderoy [EMAIL PROTECTED] wrote: Would writing Haskell to generate the C via Language.C be an option? Effectively you'd be using Haskell as a typeful macro system. Interesting idea, and I've done similar

Re: [Haskell-cafe] Hackage - MacPorts?

2008-09-04 Thread Brandon S. Allbery KF8NH
On 2008 Sep 4, at 20:08, David Menendez wrote: What happens when you upgrade GHC? The problem MacPorts has is that the libraries are still listed as installed, even though they are no longer registered or useable. MacPorts has the same problem with Perl (XS code is dependent on the exact

Re: [Haskell-cafe] Compiler's bane

2008-09-03 Thread Brandon S. Allbery KF8NH
On 2008 Sep 3, at 14:34, Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: You can define a set of valid transformations, have the interpreter log each transformation, and verify that all are correct (that is, that both the transformation and the logged result are correct. This assumes

Re: [Haskell-cafe] Top Level -

2008-09-01 Thread Brandon S. Allbery KF8NH
On 2008 Sep 1, at 1:33, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 13:20, Ganesh Sittampalam wrote: I'm afraid I don't see how this generalises to sharing something across an entire process where the things that want to do the sharing

Re: [Haskell-cafe] Compiler's bane

2008-09-01 Thread Brandon S. Allbery KF8NH
On 2008 Sep 1, at 14:47, Andrew Coppin wrote: I wonder - how do the GHC developers check that GHC works properly? (I guess by compiling stuff and running it... It's a bit harder to check that a lambda interpretter is working right.) GHC has a comprehensive test suite (not included in the

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-09-01 Thread Brandon S. Allbery KF8NH
On 2008 Sep 1, at 18:08, Ganesh Sittampalam wrote: On Mon, 1 Sep 2008, John Meacham wrote: On Mon, Sep 01, 2008 at 10:45:05PM +0100, Ganesh Sittampalam wrote: Actually all this use of the tainted and derogatory term global variable is causing me to be imprecise. All MVars/IORefs have global

Re: [Haskell-cafe] Compiler's bane

2008-09-01 Thread Brandon S. Allbery KF8NH
On 2008 Sep 1, at 20:06, Tillmann Rendel wrote: Andrew Coppin wrote: Any hints? Just how *do* you check something large like this? You could write a lot of test cases, calculating the correct answers by hand. You could check that during evaluation, you have always wellformed terms (e.g.

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: On Sat, 30 Aug 2008, Adrian Hey wrote: But then again, I'm sure that some that will be adamant that any way of making global variables is a hack. But they'll still be happy to go on using file IO, sockets etc regardless, blissfully unaware of

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:29, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what you mean here, but stdin, stdout and stderr are things provided by the OS to a process. That's what

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:34, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:29, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:44, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:34, Ganesh Sittampalam wrote: I don't follow what you mean. stdin, stdout and stderr are just file descriptors 0, 1 and 2, aren't they? You can create them as many

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:44, Ganesh Sittampalam wrote: In that case it seems that any library that might be used from a runtime that isn't the top-level of a process should avoid doing IO

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 12:01, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle structures live in the latter case? The place you clearly think so little of that you need to ask: process

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 14:58, Daniel Fischer wrote: Am Sonntag, 31. August 2008 20:21 schrieb Ryan Ingram: Do you see it? All those M. just seem dirty to me, especially because the compiler should be able to deduce them from the types of the arguments. Another Con is that the compiler can catch

Re: [Haskell-cafe] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 13:20, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 12:01, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle

Re: [Haskell-cafe] Re: 2 modules in one file

2008-08-30 Thread Brandon S. Allbery KF8NH
On 2008 Aug 30, at 4:22, Aaron Denney wrote: On 2008-08-27, Henrik Nilsson [EMAIL PROTECTED] wrote: And there are also potential issues with not every legal module name being a legal file name across all possible file systems. I find this unconvincing. Broken file systems need to be fixed.

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-30 Thread Brandon S. Allbery KF8NH
On 2008 Aug 30, at 6:28, Adrian Hey wrote: Ganesh Sittampalam wrote: How do the implementers of Data.Unique know that they musn't let them be serialised/deserialised? Because if you could take a String and convert it to a Unique there would be no guarantee that result was *unique*. What

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-29 Thread Brandon S. Allbery KF8NH
On 2008 Aug 29, at 4:22, Adrian Hey wrote: Brandon S. Allbery KF8NH wrote: On 2008 Aug 28, at 20:45, Adrian Hey wrote: Lennart Augustsson wrote: If Haskell had always taken the pragmatic path of adding what seems easiest and most in line with imperative practice it would

Re: [Haskell-cafe] Named field syntax

2008-08-29 Thread Brandon S. Allbery KF8NH
On 2008 Aug 29, at 9:30, Maurí cio wrote: However, this doesn't: data Test = Test Integer {b::String} Is there some way to name only a single, or a few, of some data type fields? There's no shorthand for it, no (and therefore you can't get one that works for pattern matching).

Re: [Haskell-cafe] Haskell Propeganda

2008-08-28 Thread Brandon S. Allbery KF8NH
On 2008 Aug 28, at 2:41, Don Stewart wrote: ketil: The great thing about Maybe is that once I've checked it isn't Nothing, I can extract the value and dispense with further checks. foo mbx = maybe default (bar x) mbx And GHC will warn me when I forget to check all cases, and prevent me from

Re: [Haskell-cafe] Haskell Propeganda

2008-08-28 Thread Brandon S. Allbery KF8NH
On 2008 Aug 28, at 13:21, Tim Newsham wrote: GNU ld supports pragmas which cause the use of certain functions to output warnings at link time (try compiling a C program that uses gets()). It occurs to me that this, either in compiler or linker, would be a nice thing for ghc to do when

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-28 Thread Brandon S. Allbery KF8NH
On 2008 Aug 28, at 17:01, John Meacham wrote: On Thu, Aug 28, 2008 at 09:00:41AM +0100, Lennart Augustsson wrote: I'm certain you can write a kernel in Haskell where the only use of global variables is those that hardware interfacing forces you to use. OS provided one? What if you have an

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-28 Thread Brandon S. Allbery KF8NH
On 2008 Aug 28, at 20:45, Adrian Hey wrote: Lennart Augustsson wrote: If Haskell had always taken the pragmatic path of adding what seems easiest and most in line with imperative practice it would not be the language it is today. It would be Perl, ML, or Java. The Haskell philosophy has

Re: [Haskell-cafe] Re: apparent minor bug in Getting started tutorial at Haskell Hacking: a journal of Haskell programming

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 3:28, Benjamin L.Russell wrote: On Wed, 27 Aug 2008 16:22:56 +0900, Benjamin L.Russell [EMAIL PROTECTED] wrote: Sorry, what I really meant was not to update the reference to a.out to be changed to main.exe, but to change the following line: This produces a new executable,

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 14:23, Maurí cio wrote: What does '~' mean in Haskell? I read in haskell.org/haskellwiki/Keywords that “(...) Matching the pattern ~pat against a value always suceeds, and matching will only diverge when one of the variables bound in the pattern is used.” Isn't that true for

[Haskell-cafe] timer_create revisited

2008-08-27 Thread Brandon S. Allbery KF8NH
I'm trying to build GHC 6.8.2 (6.8.3 once I get all this nailed down...) from an old bootstrap ghc on SuSE 9.3-64 (yes, I know) because the 6.6.1 and newer binary tarballs for amd64 Linux doesn't work with the timer_create issue. The problem is, having built a shiny new 6.8.2 both stage1

Re: [Haskell-cafe] Haskell Propaganda

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 16:49, Daniel Fischer wrote: Am Mittwoch, 27. August 2008 22:34 schrieb Aaron Tomb: When you do use Maybe, you have to explicitly handle the Just and Nothing cases separately. Pattern matching reminds you that both are possible. I tend to view fromJust as a function you

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 16:39, Jonathan Cast wrote: The last `case' is a catch-all, so you do know the result of the mplus's is a Just, but you still need the Maybe. I have to admit my thought here is that the problem isn't the Maybe, it's the fromJust. Make it go away, force people to

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 12:12, Jonathan Cast wrote: * I wonder why that name was chosen? The design doesn't seem to have anything to do with IO, it's more of a `we have this in C so we want it in Haskell too' monad. As I understand it, IO means anything not encompassed by

Re: [Haskell-cafe] dangling symbolic links

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 28, at 0:46, Nicolas Frisby wrote: I think I've exhausted my options without catching exceptions. If I have an invalid symbolic link, how can I identify that it exists? getSymbolicLinkStatus vs. getFileStatus? The former will return if the link exists, the latter if its target

Re: [Haskell-cafe] contributing to standard library

2008-08-26 Thread Brandon S. Allbery KF8NH
On 2008 Aug 26, at 17:49, Tim Newsham wrote: Like everyone else who has used Haskell for a while, I'm accumulating functions which I feel should have already been in the standard libraries. What's the normal path to contributing functions for consideration in future standard libraries? Is

Re: [Haskell-cafe] can the default instances in GHC be recompiled with overlap?

2008-08-25 Thread Brandon S. Allbery KF8NH
On Aug 25, 2008, at 15:00 , Jason Dusek wrote: It is inconvenient for certain things. If I want to declare a special `instance Show [MyType] where...` I am out of luck. In this particular case, can't you just define showList? -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL

Re: [Haskell-cafe] Haskell Propeganda

2008-08-24 Thread Brandon S. Allbery KF8NH
On 2008 Aug 24, at 4:00, Thomas Davie wrote: On 24 Aug 2008, at 05:04, Albert Y. C. Lai wrote: Dear friends, Haskell prevents more errors and earlier. This is honest, relevant, good advocacy. Dear friends, segfaults are type errors, not logical errors. Why would you indulge in this? It's

Re: [Haskell-cafe] Haskell Propeganda

2008-08-24 Thread Brandon S. Allbery KF8NH
On 2008 Aug 24, at 7:16, C.M.Brown wrote: OK, so you're basically saying that segfaults can be eliminated with a strong type system, whereas pattern matching errors is the result of some Not really, no. A sufficiently strong type system will eliminate segfaults (modulo bugs in the

Re: [Haskell-cafe] Re: Haskell Propeganda

2008-08-24 Thread Brandon S. Allbery KF8NH
On 2008 Aug 25, at 0:33, Ashley Yakeley wrote: Don Stewart wrote: You just wrote unsafeCoere# a different way: typeOf T = typeOf (undefined :: IORef ()) Right. It's straightforward to write unsafe segfaulting code in apparently safe Haskell. typeOf / Typeable is itself an ugly

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