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
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
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
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
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
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
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
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
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 <
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
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
-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
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
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
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
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
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
> >
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
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
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
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
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
++ 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
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
' 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
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
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
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]>
) 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
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
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
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
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
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
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.
--
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
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
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
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
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
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
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
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
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
ead in
binary mode (without EOL/EOF translations).
--
Glynn Clements <[EMAIL PROTECTED]>
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
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
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
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
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
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
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
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
rresponding libc functions (or their Windows equivalents). I.e.:
Haskell C
getClockTimegettimeofday
toCalendarTime localtime
toUTCTime gmtime
toClockTime mktime
--
Gl
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
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
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
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
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
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
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
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
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
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
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
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
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
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]>
67 matches
Mail list logo