Re: [Haskell] Re: haskell.org Public Domain

2006-01-11 Thread Glynn Clements
of attribution and to prohibit "defacement") which are inalienable, i.e. any statement waiving or rescinding such rights is void and unenforceable. IOW, no matter what language the licence uses, the author retains the right to sue for violations of their moral rights. -- G

Re: [Haskell] haskell.org Public Domain

2006-01-09 Thread Glynn Clements
that you can actually identify and locate the author, which isn't always easy for projects with a long history and many contributors). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] GHC and GLUT

2006-01-06 Thread Glynn Clements
ug, it's in the dependency list for GLUT. Ultimately, the correct dependency list for the Haskell GLUT package is "GLUT, plus whatever GLUT happens to require on your particular system". But I don't know whether the dependency list can be generated dynamically. -- Glynn Clemen

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread Glynn Clements
ite a Lisp interpreter in Haskell. But it's a lot easier to do it in Lisp. That, in a nutshell, is Lisp's key strength. It uses the same structure for code as for data, which makes it very easy to add new language features. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Glynn Clements
am trying to learn > a bit of it. One of the things that puts me off is the attitude of its > community - it seems to be very close minded. Hmm. That depends upon which faction of the community you're dealing with. If you get into discussions about the merits of Lisp on public fora, you&#

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Glynn Clements
he ground floor. You get stuck with Lisp's token syntax, and the semantics of its core primitives, but you can replace anything else. Every other language (including Haskell) tends to have the problem that eventually you will encounter a situation where the language's own worldview gets i

Re: [Haskell] mailing list headaches

2005-09-08 Thread Glynn Clements
ge mail clients which don't > insert "References" headers. It isn't so much that there are a large number of such users, but that two of the core developers are among them (and are both employed by Microsoft, so RFC-conformance probably isn&#

Re: [Haskell] ST/STRef vs. IO/IORef

2005-08-03 Thread Glynn Clements
onad is like a "trap"; once your inside, you can't get out. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Should inet_ntoa Be Pure?

2005-05-07 Thread Glynn Clements
ons in Haskell. Apart from the re-entrancy issues with inet_ntoa(), many implementations of inet_addr() have misfeatures, e.g. allowing octets to be expressed in octal or hex, or allowing numbers outside of the 0-255 range (in which case, the top bits overflow into the next octet). -- Glynn Clements <

Re: [Haskell] Memoization in Haskell

2005-04-03 Thread Glynn Clements
me calculation repeatedly. You can implement droploop as a fold, e.g.: droploop ns xs = foldr drop xs ns -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] URLs in haskell module namespace

2005-03-24 Thread Glynn Clements
RLs, it would make more sense to extend GHC's -i switch, i.e. ghc -i http://module.org/ ... -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Re: xemacs & haskell major mode

2005-02-02 Thread Glynn Clements
-jisx0208) So charsetp should only be called if the make-char function exists, and that function should also only exist if XEmacs was built with the MuLE option. It may be that you have a version of XEmacs which has make-char but which doesn't have charsetp. In any case, I have CC'd th

[Haskell] Re: ANNOUNCE: GHC version 6.2.2

2004-10-15 Thread Glynn Clements
ver aborted]: cannot write /cvs/CVSROOT/val-tags: Read-only file system -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] threading mutable state through callbacks

2004-10-12 Thread Glynn Clements
ink > (but I am not an expert as you see). Am I wrong? In the former, the variables have global scope, and may be exported from the module. Also, what if you do this in a module other than Main? -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] lazy printing

2004-09-10 Thread Glynn Clements
fered by default, so writeFile would generate the output in blocks. If you wanted to change the buffering, you would have to open the file yourself so that you could get at the descriptor, e.g. handle <- openFile "log" AppendMode hSetBuffering handle NoBuffer

Re: [Haskell] 2-D Plots, graphical representation of massive data

2004-08-28 Thread Glynn Clements
ely clear (at least, from the second post) how much of the process was meant to be done in Haskell. Going back to the first post, it seems likely that Yuliya may be willing to hand the task off at an earlier stage. If that is the case, using something like G

Re: [Haskell] Re: 2-D Plots, graphical representation of massive data

2004-08-27 Thread Glynn Clements
karczma wrote: > Glynn Clements proposes to: > > > Zabiyaka, Yuliya > who wants > ... > >> 2) display result of the analysis (pie charts, histograms, plots) > > > > If you don't need to interact with the display, the simplest solution > >

RE: [Haskell] 2-D Plots, graphical representation of massive data

2004-08-27 Thread Glynn Clements
to generate graphics files. Personally, I would use PostScript, as I'm reasonably familiar with it and the Ghostscript interpreter is freely available. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Sequencing of input and output, troubles in kdevelop

2004-08-27 Thread Glynn Clements
reams are flushed automatically. The Haskell I/O library doesn't mimic this aspect of C, so you have to add explicit hFlush calls if you want partial lines (strings which don't end with a newline character) to be displayed immediately. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] image writing library

2004-08-06 Thread Glynn Clements
1 ((x0,y0),(x1,y1)) = bounds cm maxval = maximum $ concatMap unRGB (elems cm) showRGB (r,g,b) = unwords [show r, show g, show b] unRGB (r,g,b) = [r,g,b] -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] randomgen for foreign random functions

2004-06-25 Thread Glynn Clements
seedgam seed x <- c_gengam lo hi (seed, g') = next g [Although, in the second approach, I presume that you would need addtional code for multi-threaded use.] -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Reading a directory tree

2004-06-22 Thread Glynn Clements
ical implementations because this capability may produce loops in the file hierarchy or otherwise corrupt the file system. This volume of IEEE Std 1003.1-2001 continues that philosophy by prohibiting link() and unlink() from doing this. Other funct

Re: [Haskell] Reading a directory tree

2004-06-22 Thread Glynn Clements
++ concat rest One caveat: (scanDir "/") isn't handled correctly; you will get an extra slash, i.e. "//usr", "//bin" etc. Not that I'd recommend using this code for scanning an entire filesystem, due to performance issues. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Reading a directory tree

2004-06-22 Thread Glynn Clements
ectoryReallyExist :: FilePath -> IO Bool > doesDirectoryReallyExist path = do > stat <- getSymbolicLinkStatus > return $ isDirectory stat -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Mixing monadic and non-monadic functions

2004-03-24 Thread Glynn Clements
' b') } One consequence of this is that, even if (==) is an equivalence relation, "liftM2 (==)" may not be, as the order of the arguments is significant. More generally, lifted functions may have semantics which differ greatly from the underlying function. Personally, I'm quite happy that Haskell doesn't allow this to be hidden by implicit lifting. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] System.Random

2004-03-02 Thread Glynn Clements
t MonadState. Note that the choice of monad is "contagious", due to the presence of randomIO and randomRIO in the definition of Random. These should probably be plain functions rather than class methods. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] regular expression syntax - perl ain't got nothin on haskell

2004-02-24 Thread Glynn Clements
ough that's primarily in writing tokenisers. IMHO, try to do everything (or, at least, too much) using s/pattern/replacement/ constructs seems to be a favourite recipe for buggy code. Case in point: the regular occurrence of cross-site scripting, SQL injection, printf() and similar issues

Re: [Haskell] behavioral difference between GHC and GHCi

2004-02-08 Thread Glynn Clements
stderr is always unbuffered). Either: 1. Use putStrLn instead of putStr. 2. Call "hFlush stdout" after each call to putStr. 3. Call "hSetBuffering stdout NoBuffering" before the first call to putStr. -- Glynn Clements <[EMAIL PROTECTED]>

Re: [Haskell] Gallopping Tab characters

2004-01-26 Thread Glynn Clements
) then it would not change the meaning of a "well-indented" program. Yeah, but it probably won't. More likely, it will only perform the replacement on the lines which you actually edit, and leave the rest of them alone. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: [Haskell] Re: Use of tab characters in indentation-sensitive code

2004-01-26 Thread Glynn Clements
e compiler > doesn't understand the option. Using "pr -T -e4" is less work than writing a sed script (you can't just replace each tab with 4 spaces; you need to use between 1 and 4 spaces depending upon the column in which the tab character occ

Re: Compiling HXML toolbox under Hugs/Windows

2004-01-22 Thread Glynn Clements
7;m more likely to find > that elsewhere. > > Does anyone have any helpful pointers to offer? hslibs/win32/Win32Spawn.hs [These are all from 5.04.2; the paths may have changed to somewhere beneath libraries/ in 6.x, but the filenames will probably be the same.] -- Glynn Clement

Re: getting the path to the executing program

2004-01-09 Thread Glynn Clements
longer refer to the same executable, or where argv[0] doesn't contain the filename used, but it's likely to be close enough for the cases where someone isn't deliberately trying to make it fail. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Why are strings linked lists?

2003-11-29 Thread Glynn Clements
rface: either all of the relevant functions use a default encoding (which will probably be the wrong one as often as not), or the "right" functions have to have their names bastardised because the "wrong" functions have already stolen the obvious names. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Why are strings linked lists?

2003-11-29 Thread Glynn Clements
to be able to handle data where the encoding is unknown, or which isn't correctly encoded. This isn't something which can be hidden; at least, not without reducing Haskell to a toy language (e.g. only handles UTF-8, or only handles the encoding specified

Re: Why are strings linked lists?

2003-11-29 Thread Glynn Clements
provides is that Char is 4 bytes. If you use Char to store anything other than ISO Latin-1 characters, none of the Haskell functions with Char in their signature will be of any use. You could just as easily have added "type WChar = Word32", and made your library use that instead of Char. --

Re: Why are strings linked lists?

2003-11-29 Thread Glynn Clements
t that won't fail quite so badly if you use e.g. toUpper on a string which is actually in e.g. ISO Latin-2; the case may be wrong, but at least it will be the correct letter. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Why are strings linked lists?

2003-11-28 Thread Glynn Clements
it; while you *could* just force the use of a specific encoding, the result of doing so would be an I/O system which was almost worthless for real use). Right now, values of type Char are, in reality, ISO Latin-1 codepoints padded out to 4 bytes per char. It isn't

Re: Wrapping Code

2003-10-25 Thread Glynn Clements
except that exceptions would be handled correctly, i.e. withHandle would throw the exception rather than just treating it as EOF. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Enum on Float/Double

2003-10-22 Thread Glynn Clements
nt by 1 gives 0.0: Prelude> encodeFloat 1 (fst (floatRange (0 :: Float)) - floatDigits (0 :: Float) - 1) :: Float 0.0 Prelude> encodeFloat 1 (fst (floatRange (0 :: Double)) - floatDigits (0 :: Double) - 1) :: Double

Re: Text I/O library proposal, first draft

2003-07-31 Thread Glynn Clements
thin the IO monad. It shouldn't be necessary, even for stateful encodings. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: System.Directory (was RE: Proposal for a new I/O library design)

2003-07-28 Thread Glynn Clements
racters. Windows treats filenames as lists of characters; VFAT and NTFS use Unicode, while FAT filesystems may have an associated codepage. OTOH, Unix treats filenames as lists of bytes; while applications may impose an (arbitrary) encoding on filenames, the OS doesn't. -- Gly

Re: Unicode + Re: Reading/Writing Binary Data in Haskell

2003-07-14 Thread Glynn Clements
is that we need a standard mechanism for reading and writing *octets*, so that Haskell programs can communicate with the rest of the world. As things stand, if you want to read/write files which were written by another program, you have to rely either upon extensions, or upon beha

Re: Reading/Writing Binary Data in Haskell

2003-07-09 Thread Glynn Clements
nary", i.e. characters 0-255 get read and written "as-is" and anything else breaks, and changing that would probably break a fair amount of existing code. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: How overload operator in Haskell?

2003-07-09 Thread Glynn Clements
Hal Daume wrote: > What you want to do is make your Vector an instance of the Num(eric) > type class. For instance: > > instance Num Vector where Except that class instances have to be algebraic datatypes ("data") or renamed datatypes ("newtype"), but not ty

Re: Reading/Writing Binary Data in Haskell

2003-07-09 Thread Glynn Clements
ead in binary mode (without EOL/EOF translations). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Reading/Writing Binary Data in Haskell

2003-07-08 Thread Glynn Clements
Win32 equivalent) to read directly into memory (Ptr/Addr), or even write an import declaration for mmap(). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: foldr in terms of map

2003-07-03 Thread Glynn Clements
ty sure that we aren't getting primitive recursion for free, and I can't see it coming from references (there's nothing PR about the get/put operations for a simple state transformer monad). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: foldr in terms of map

2003-07-01 Thread Glynn Clements
t;run" operation, e.g. runST). An implementation using a simple state-transformer monad (s -> (a, s)) wouldn't look significantly different to one using IORef/STRef. > but it also seems impossible to remove this dependence on the > sequencing operation. Yep. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: LOOP + HANDLE

2003-06-11 Thread Glynn Clements
Filip wrote: > So how to write function that will wait until Handle is ready for reading ?? hWaitForInput :: Handle -> Int -> IO Bool hWaitForInput h t = ... Waits until Handle h is ready for reading or t milliseconds have elapsed. -- Glynn Clements <[EMA

Re: Bits Problem

2003-04-06 Thread Glynn Clements
e also instances of Num. This constraint is required for the default implementations of bit and testBit: bit i = 1 `shift` i x `testBit` i = (x .&. bit i) /= 0 -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Printing in Haskell

2003-03-26 Thread Glynn Clements
ow" to convert a value to a string. See: http://www.haskell.org/tutorial/io.html for more information about I/O in Haskell. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: How to force UNIX text files as output instead of DOS text files??

2003-03-02 Thread Glynn Clements
file in UNIX format??? Use openFileEx, e.g.: import IOExts ... handle <- openFileEx filename (BinaryMode WriteMode) -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell

Re: time since the epoch

2003-02-07 Thread Glynn Clements
rresponding libc functions (or their Windows equivalents). I.e.: Haskell C getClockTimegettimeofday toCalendarTime localtime toUTCTime gmtime toClockTime mktime -- Gl

Re: A problem about hGetContents

2003-01-19 Thread Glynn Clements
gt; hClose h > return (lines l) > > I obviously always get the empty list as a result. How should I code the > function? Just omit the hClose; hGetContents will automatically close the handle once all of the data has actually been read. See ยง11.2.1 of the library re

Re: dynamic types

2003-01-14 Thread Glynn Clements
table accessors would be preferable to having to parse the result of "show". -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Questions from New-Old User

2003-01-02 Thread Glynn Clements
conj = conjugate instance MaybeComplex Float where conj = id instance MaybeComplex Double where conj = id -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Question About Random Module

2002-12-25 Thread Glynn Clements
get an IO monad from randomIO and randomRIO or if you use the "global" RNG (getStdGen, getStdRandom etc). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Glynn Clements
referential transparency. > Maybe someone has to suggest some simple article on monads. "What the hell are Monads?" http://www.dcs.gla.ac.uk/~nww/Monad.html -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing

Re: how to convert IO String to string

2002-11-24 Thread Glynn Clements
didn't work for me Read the section of the Haskell tutorial regarding I/O: http://www.haskell.org/tutorial/io.html I guarantee that you will not be able to figure out how I/O works in Haskell by guessing. You need to actually read

Re: Implementing forward refs in monadic assembler and interpreter

2002-11-15 Thread Glynn Clements
rward branch would have to store the label in a "variable" to indicates that instructions are just to be skipped until that label is reached. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Evidence Elimination

2002-10-25 Thread Glynn Clements
AICT, this is a consequence of the monomorphism restriction, which is discussed in section 4.5.5 of the Haskell report: http://haskell.org/onlinereport/decls.html#sect4.5.5 -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: Haskell 98: Behaviour of hClose

2002-09-20 Thread Glynn Clements
e program terminates or is suspended (via SIGTSTP). However, in C, you would have to have explicitly change the terminal settings (with e.g. tcsetattr()), whereas Haskell does this "under the hood". -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: Haskell 98: Behaviour of hClose

2002-09-18 Thread Glynn Clements
t point out that hSetBuffering may change the terminal driver's settings. Because it looks so similar to ANSI C's setvbuf(), someone who is migrating from C to Haskell may assume that it's roughly equivalent (i.e. that it only affects the user-space stream, and not the underlying OS descriptor). -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: Haskell 98: Behaviour of hClose

2002-09-18 Thread Glynn Clements
ehaviour. A conforming implementation should *not* do whatever it pleases. If necessary, it should be explictly specified that the terminal settings are left untouched. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: Haskell 98: Behaviour of hClose

2002-09-17 Thread Glynn Clements
n general, "magic" behaviour (e.g. clearing the ICANON flag when disabling buffering) should at least be documented, otherwise it's likely to confuse experienced programmers. Particularly when functions appear to mirror common C functions. Some of Haskell's IO module

RE: H98 Report: input functions

2002-09-09 Thread Glynn Clements
report. > > Does that seem right? No. A terminal device may echo or it may not. Even if the run-time explicitly enables echoing, there is no guarantee that it won't subsequently be disabled. Certainly, the existing statement is wrong, though. -- Glynn Clements <[EMAIL PROTECTED]> ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: haskell-mode and XEmacs

2000-04-30 Thread Glynn Clements
his mode in XEmacs (XEmacs 21.1.9). For every buffer I open > in haskell mode I receive the message > > (error/warning) Error in `post-command-hook' (setting hook to nil): (void-variable >imenu--index-alist) Try putting (require 'imenu) in your ~/.emacs. -- Glynn Clements <[EMAIL PROTECTED]>