MY bad!!!
I was trying to open "/dev/cdrom/" and not "dev/cdrom"!!! and hence
"/dev/cdrom/" was correctly treated as a directory ...
Vasili
On Jan 30, 2008 11:25 PM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]>
wrote:
>
> On Jan 30, 2008, at 23:23 , Galchin Vasili wrote:
>
> > I am trying to do
On Jan 30, 2008, at 23:23 , Galchin Vasili wrote:
I am trying to do the following on RedHat RHEL 5.0:
main = do
fs <- openFd "/dev/cdrom" ReadOnly (Just ???) defaultFileFlags
putStrLn (show fd)
what should (Just ???) be ???
I think you can pass Nothing instead of a Just, since that
i.e. only the Linux CDROM device driver in read-only mode
V.
On Jan 30, 2008 11:23 PM, Galchin Vasili <[EMAIL PROTECTED]> wrote:
> I am trying to do the following on RedHat RHEL 5.0:
>
> main = do
> fs <- openFd "/dev/cdrom" ReadOnly (Just ???) defaultFileFlags
> putStrLn (show fd)
>
I am trying to do the following on RedHat RHEL 5.0:
main = do
fs <- openFd "/dev/cdrom" ReadOnly (Just ???) defaultFileFlags
putStrLn (show fd)
what should (Just ???) be ???
Regards, Vasili
On Jan 30, 2008 11:10 PM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]>
wrote:
>
> On Jan 30, 200
On Jan 30, 2008, at 23:05 , Galchin Vasili wrote:
Hello,
The signature for openFD is
openFd: FilePath
-> OpenMode
-> Maybe FileMode
-> OpenFileFlags
-> IO Fd
I am currently reading http://www.haskell.org/ghc/docs/latest/html/
libraries/
Hello,
The signature for openFD is
openFd: FilePath
-> OpenMode
-> Maybe FileMode
-> OpenFileFlags
-> IO Fd
I am currently reading
http://www.haskell.org/ghc/docs/latest/html/libraries/unix/System-Posix-Files.html
and diving down into links
On Wed, 2008-01-30 at 22:19 -0500, Anton van Straaten wrote:
> Derek Elkins wrote:
> > On Thu, 2008-01-31 at 02:18 +, Neil Mitchell wrote:
> ...
> >> It isn't something that would throw a C programmer off, but it is
> >> something that could confuse a pure Haskell programmer. And the only
> >>
On 30 Jan 2008, at 7:19 PM, Anton van Straaten wrote:
Derek Elkins wrote:
On Thu, 2008-01-31 at 02:18 +, Neil Mitchell wrote:
...
It isn't something that would throw a C programmer off, but it is
something that could confuse a pure Haskell programmer. And the only
way I could be sure of r
Derek Elkins wrote:
On Thu, 2008-01-31 at 02:18 +, Neil Mitchell wrote:
...
It isn't something that would throw a C programmer off, but it is
something that could confuse a pure Haskell programmer. And the only
way I could be sure of radians versus degrees was by trying it out,
not a great
On Wed, 2008-01-30 at 19:32 -0600, Derek Elkins wrote:
> Uh, why not? Often that's exactly what I do as checking even
> conveniently located documentation is more time consuming than just
> trying it.
>
I find it agreeable that there always be documentation for exported
functions.
In my undergr
Johan Tibell wrote:
I imagine the laziness here was because these all match their names in
the traditional libc, accessable via manpages.
You may not consider that an excuse :)
I don't! To do something about it I'll adopt Network.Socket and
document that (I did the same with some other base mo
David's post looks like it has cleared up what I was wondering about. I
think it was the specific contents of Ob(Hask) and Haskell functions as
arrows in Hask that I was unclear on. With that in mind I understand
and agree with Miguel's explanations. Thanks, guys.
Dan Weston wrote:
I assum
On Thu, 2008-01-31 at 02:18 +, Neil Mitchell wrote:
> Hi
>
> > > Neil is on Windows. Windows doesn't have man pages (or libc).
> >
> > Standard C math library does always contain trigonometric functions -
> > doesn't it?
>
> My libc (as installed by Visual Studio, and called msvscrt) comes wi
Hi
> > Neil is on Windows. Windows doesn't have man pages (or libc).
>
> Standard C math library does always contain trigonometric functions -
> doesn't it?
My libc (as installed by Visual Studio, and called msvscrt) comes with
all these functions, but no manpages, and the MSDN (manpages for
Wind
On Wed, 2008-01-30 at 16:23 -0800, [EMAIL PROTECTED] wrote:
> Category theory seems to have an inconsistent relationship to Haskell
> - both documentation and the language's implementations of categorical
> concepts. I come from a math background that makes the Haskell's
> tight coupling to
I assume you have read the references in
http://www.haskell.org/haskellwiki/Research_papers/Monads_and_arrows
The penultimate sentence in question 1 below (role of adjoint functors
in Haskell monads) was addressed by David Menendez in a recent post to
this list:
http://www.haskell.org/piperma
1. Are Haskell monads useful in a truly categorical sense?
2. Is Haskell's functor class misnamed?
3. Haskell arrows and Haskell monads have a misleading relationship
I'm confused. It seems for me that either I don't understand math or I
don't understand you.
1. Categorical monads are a clas
Category theory seems to have an inconsistent relationship to Haskell
- both documentation and the language's implementations of categorical
concepts. I come from a math background that makes the Haskell's
tight coupling to its mathematical foundation very appealing. But, I
may have found
> PS: I would love to see an immutable filesystem that does not allow writing
> to files, it only creates new files and garbage collects files that have no
> incoming reference anymore... Just like a garbage collected heap, and a bit
> like an OLAP databases (as far as I remember my DB theory...
Dan Weston wrote:
Now I'm confused (which happens quite a lot, I'm afraid!)
Prelude> readFile undefined
*** Exception: Prelude.undefined
Prelude> readFile undefined >>= \cs -> putStrLn "Hello"
*** Exception: Prelude.undefined
It seems that readFile is strict in its argument. As for getLine, it
Peter Verswyvelen wrote:
main = do
cs <- getLine
putStrLn ("Hello "++cs)
looks so much like
main = do
cs <- readFile "foo"
writeFile "foo" cs
but in the first one cs is strict, while the second it is lazy... But that's
not obvious.
Now I'm confused (which hap
> And even better is
>
> main = do
>cs <- strictReadFile "L:/Foo.txt"
>writeFile "L:/Foo.txt" cs
Yes. By making these mistakes I understand the problem very well now. But it
*is* hard to see if the function in question is strict or lazy.
For example, the problem to me appears to be that
Adam Langley wrote:
> On Jan 30, 2008 1:07 PM, Adam Langley <[EMAIL PROTECTED]> wrote:
>> So, if I don't hear otherwise soon, I'll probably push a new version
>> of binary-strict later on today with the interface above.
>
> It's in the darcs now, http://darcs.imperialviolet.org/binary-strict
Than
On Jan 30, 2008 1:07 PM, Adam Langley <[EMAIL PROTECTED]> wrote:
> So, if I don't hear otherwise soon, I'll probably push a new version
> of binary-strict later on today with the interface above.
It's in the darcs now, http://darcs.imperialviolet.org/binary-strict
AGL
--
Adam Langley
On Jan 30, 2008 12:04 PM, Bryan O'Sullivan <[EMAIL PROTECTED]> wrote:
> Adam Langley wrote:
> I'd have expected it to look more like this:
>
> data Result a = Failed String
> | Finished B.ByteString a
> | Partial (B.ByteString -> Result a)
>
> (The change here is from a
Adam Langley wrote:
> Also, if you want the above approach (read a bit, see if it's enough),
> see IncrementalGet in the binary-strict package which is a Get with a
> continuation monad that stops when it runs out of bytes and returns a
> continuation that you can give more data to in the future.
My apologies for the cryptic email below - I meant it for the
haskell-db users list. And now I have to apologize for this spam too.
Should I send yet another email? ;)
Justin
-- Forwarded message --
From: Justin Bailey <[EMAIL PROTECTED]>
Date: Jan 30, 2008 10:00 AM
Subject: Impr
Don Stewart wrote:
stephan.friedrichs:
[...]
We [1] implemented an ad-hoc chat system in Haskell in the SEP [2] at
the TU-Braunschweig.
Wow!
Looks like lots of great code in there,
http://sep07.mroot.net/documentation/barracuda/
Text.ParserCombinators.Parsec.XML
Codec.Encryption.P
One rather funky but effective solution might be to use the tftp
protocol. No security, but simple, flexible and efficient. I think
there are C libraries that implement it. This would take care of
handshaking binary data. I have no idea if anyone has ever used it in
Haskell.
GB
On Wed, 2008-01
The opposite can also happen.
"Tobacco" (mid-16th century Spanish) is rendered as "tabako" in
Japanese, in fact a very Japanese-sounding word (perhaps from, ta +
hako). This may explain why, unlike almost all foreign words in Japanese
that are written in katakana (a sort of simpler-looking con
All,
project doesn't easily let me add a few columns to an existing query
(or take a few columns away). Instead, each use of project requires me
to build the entire list of columns I'd like to pass on by hand.
Before I go further, if there is a way to do that, please let me know.
An example of wh
Judah Jacobson wrote:
On Jan 30, 2008 8:31 AM, Bryan O'Sullivan <[EMAIL PROTECTED]> wrote:
Peter Verswyvelen wrote:
Then I tried the "seq" hack to force the handle opened by readFile to be
closed, but that did not seem to work either. For example, the following still gave
access denied:
mai
On Jan 30, 2008 8:31 AM, Bryan O'Sullivan <[EMAIL PROTECTED]> wrote:
> Peter Verswyvelen wrote:
>
> > Then I tried the "seq" hack to force the handle opened by readFile to be
> > closed, but that did not seem to work either. For example, the following
> > still gave access denied:
> >
> > main =
On Jan 30, 2008 5:16 AM, Federico Squartini
<[EMAIL PROTECTED]> wrote:
> foreign import ccall "print_couple_ptr" printCouple::Ptr Couple->IO Int
>
> But not the first, as a struct it's not an atomic type.
> So how does one solve this issue?
(This applies to x86-64 only!)
In the case of your struc
On Wed, 2008-01-30 at 13:15 +, Jules Bean wrote:
> Neil Mitchell wrote:
> > For a start, its probably a good idea to mention that cos is an
> > abbreviation of cosine (most people will know, but its handy to state
> > it). Secondly, and much more importantly, it should state whether
> > these m
On Jan 30, 2008 4:32 AM, Jules Bean <[EMAIL PROTECTED]> wrote:
> The third, but more sophisticated answer is to use non-blocking IO, read
> 'only what is available', decide if it's enough to process, if not
> store it in some local buffer until next time. This is much more work
> and easy to impl
Neil Mitchell wrote:
> For a start, its probably a good idea to mention that cos is an
> abbreviation of cosine (most people will know, but its handy to state
> it). Secondly, and much more importantly, it should state whether
> these measurements are in degrees or radians. It should also state
>
Peter Verswyvelen wrote:
> Then I tried the "seq" hack to force the handle opened by readFile to be
> closed, but that did not seem to work either. For example, the following
> still gave access denied:
>
> main = do
> cs <- readFile "L:/Foo.txt"
> writeFile "L:/Foo.txt" $ seq (length cs) c
Roman Leshchinskiy wrote:
[...]
You should make clean in ndp/examples. Sorry this doesn't happen
automatically, the whole setup is a bit of a mess at the moment.
Now it works, thanks a lot :)
Sorry for the German make output, but I'm no admin on this machine
No worries, I actually speak
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Peter
> Verswyvelen
>
> As a newbie I made a nice little program that called readFile
> and writeFile on the same filename, but of course the file
> handle of the readFile was not closed yet => access denied. A
> nice case of
On Jan 30, 2008 12:44 AM, Adam Smyczek <[EMAIL PROTECTED]> wrote:
> Hi,
>
> My application has to manage a data set. I assume the state monad is
> designed for this.
> The state changes in functions that:
> a. perform IO actions and
> b. return execution status and execution trace (right now I'm u
Stephan Friedrichs wrote:
dotp.hs:13:0:
Bad interface file: ../lib/Bench/Benchmark.hi
mismatched interface file versions: expected 60920080126, found
60920080124
make: *** [dotp.o] Fehler 1
You should make clean in ndp/examples. Sorry this doesn't happen
automatically, the whole
Gracjan Polak wrote:
Data.List.foldr (Data.Set.delete) s [1,3,5]
or
Data.List.foldl' (flip Data.Set.delete) s [1,3,5]
There will be a day when I finally grasp foldr/foldl :)
Maybe
http://en.wikibooks.org/wiki/Haskell/Performance_Introduction
http://www.haskell.org/haskellwiki/Stack_overf
Roman Leshchinskiy wrote:
[...]
OK: I've recompiled the current ghc-head version:
darcs pull -a
./darcs-all pull -a
make clean
sh boot && ./configure && make -j5 && echo ok
cd libraries/ndp/
darcs pull -a
make clean
cd ..
make make.library.ndp
# works up to this point
cd ndp/examples/dotp
m
Duncan Coutts worc.ox.ac.uk> writes:
> Data.List.foldr (Data.Set.delete) s [1,3,5]
> or
> Data.List.foldl' (flip Data.Set.delete) s [1,3,5]
There will be a day when I finally grasp foldr/foldl :)
>
> which is O (n + m * log m) rather than O(m * log n) or if the elements
> you're deleting are alr
On Wed, 30 Jan 2008, Robin Green wrote:
> On Wed, 30 Jan 2008 13:15:41 +
> Jules Bean <[EMAIL PROTECTED]> wrote:
>
> > Neil Mitchell wrote:
> > > For a start, its probably a good idea to mention that cos is an
> > > abbreviation of cosine (most people will know, but its handy to
> > > state i
On Wed, 30 Jan 2008 13:15:41 +
Jules Bean <[EMAIL PROTECTED]> wrote:
> Neil Mitchell wrote:
> > For a start, its probably a good idea to mention that cos is an
> > abbreviation of cosine (most people will know, but its handy to
> > state it). Secondly, and much more importantly, it should stat
Yes, and if I'm correct this hGetContents is used by many other functions, such
as readFile...
As a newbie I made a nice little program that called readFile and writeFile on
the same filename, but of course the file handle of the readFile was not closed
yet => access denied. A nice case of gett
> I imagine the laziness here was because these all match their names in
> the traditional libc, accessable via manpages.
>
> You may not consider that an excuse :)
I don't! To do something about it I'll adopt Network.Socket and
document that (I did the same with some other base module half a year
On Wed, 30 Jan 2008, Jules Bean wrote:
> Neil Mitchell wrote:
> > For a start, its probably a good idea to mention that cos is an
> > abbreviation of cosine (most people will know, but its handy to state
> > it). Secondly, and much more importantly, it should state whether
> > these measurements
On Wednesday 30 January 2008 14:09:31 you wrote:
> > This sounds good, but don't I throw away all (possible) performance gains
> > of transmitting ByteStrings directly when using show/read to convert them
> > to ordinary strings and back?
>
> Probably not all of them, but some of them, definitely.
Is there a way in the foreign function interface to pass to a function
a struct by value? I explain it better.
There are two ways in c to pass structs, as in the following example:
/* begin c code */
struct couple{
int a;
int b;
};
//by value
int print_couple (struct couple cpl)
{
printf(
Neil Mitchell wrote:
For a start, its probably a good idea to mention that cos is an
abbreviation of cosine (most people will know, but its handy to state
it). Secondly, and much more importantly, it should state whether
these measurements are in degrees or radians. It should also state
things li
Timo B. Hübel wrote:
On Wednesday 30 January 2008 13:51:58 you wrote:
Okay, but then I have to make sure that my strings won't contain any
newline characters, right? If this is the case, another question raises
up: I am using Data.Binary to do the serialization of my data structures
to ByteStrin
On Wednesday 30 January 2008 13:51:58 you wrote:
> > Okay, but then I have to make sure that my strings won't contain any
> > newline characters, right? If this is the case, another question raises
> > up: I am using Data.Binary to do the serialization of my data structures
> > to ByteString, so do
Timo B. Hübel wrote:
On Wednesday 30 January 2008 13:32:42 you wrote:
Timo B. Hübel wrote:
On Wednesday 30 January 2008 13:03:27 you wrote:
Just don't use hGetContents in any serious code, or any program longer
than 4 lines.
What else do you suggest? I just want to read something out of the s
On Wednesday 30 January 2008 13:32:42 you wrote:
> Timo B. Hübel wrote:
> > On Wednesday 30 January 2008 13:03:27 you wrote:
> >> Just don't use hGetContents in any serious code, or any program longer
> >> than 4 lines.
> >
> > What else do you suggest? I just want to read something out of the sock
Hi,
I went looking for the the function in Haskell to calculate cos^{-1},
inverse cosine. Unfortunately, the poor documentation in the libraries
hampered my attempts. The documentation for the trig functions in
Haskell is completely non-existent:
http://haskell.org/ghc/docs/latest/html/libraries/
Timo B. Hübel wrote:
On Wednesday 30 January 2008 13:03:27 you wrote:
Just don't use hGetContents in any serious code, or any program longer
than 4 lines.
What else do you suggest? I just want to read something out of the socket
without knowing it's length beforehand (my example here used ord
Timo B. Hübel wrote:
On Wednesday 30 January 2008 13:03:27 you wrote:
Just don't use hGetContents in any serious code, or any program longer
than 4 lines.
What else do you suggest? I just want to read something out of the socket
without knowing it's length beforehand (my example here
On Wednesday 30 January 2008 13:03:27 you wrote:
> Just don't use hGetContents in any serious code, or any program longer
> than 4 lines.
What else do you suggest? I just want to read something out of the socket
without knowing it's length beforehand (my example here used ordinary
Strings, but a
Your bug here is hGetContents.
Don't use it.
Lazy IO gremlins bite once again.
Your client is waiting for the server to close the socket before it
prints anything. But your server is waiting for the client to close the
socket before *it* prints anything.
Just don't use hGetContents in any s
On Wed, 2008-01-30 at 11:05 +, Gracjan Polak wrote:
>
> My strictness analyser in my brain hurts. Which one (foldl,foldl',foldr) is
> the
> best way?
>
> Prelude Data.Set Data.List> let s = fromList [1,2,3,4,5]
> Loading package array-0.1.0.0 ... linking ... done.
> Loading package containe
The PCRE library has just fixed a buffer overflow (related to UTF-8 mode).
There are several haskell wrappers for the pcre library.
If you use a wrapper for the PCRE library (libpcre) then you may want to upgrade
the underlying library.
http://pcre.org/news.txt states:
News about PCRE release
On Jan 30, 2008 11:05 AM, Gracjan Polak <[EMAIL PROTECTED]> wrote:
> My strictness analyser in my brain hurts. Which one (foldl,foldl',foldr) is
> the
> best way?
>
> Prelude Data.Set Data.List> let s = fromList [1,2,3,4,5]
> Loading package array-0.1.0.0 ... linking ... done.
> Loading package co
My strictness analyser in my brain hurts. Which one (foldl,foldl',foldr) is the
best way?
Prelude Data.Set Data.List> let s = fromList [1,2,3,4,5]
Loading package array-0.1.0.0 ... linking ... done.
Loading package containers-0.1.0.0 ... linking ... done.
Prelude Data.Set Data.List> foldl (.) i
Roman Leshchinskiy wrote:
[...]
Yes, me :-) Sorry for the late reply, it's been a long weekend here in
Australia.
Wow, Australia :)
[...]
I suspect that "cd examples; make" doesn't quite work at the moment
because some of the examples are broken. I'll try to fix that soon. But
"cd examp
> Are monad stacks with 3 and more monads common?
> How could an example implementation look like?
I found reading the xmonad code (http://code.haskell.org/xmonad/)
enlightening. The X monad definition can be found in
http://code.haskell.org/xmonad/XMonad/Core.hs
-- | The X monad, a StateT transf
Chung-chieh Shan corrects me:
PS. If you think that "arigato" is a genuine Japanese word, well, check
how the appropriately translated word is spelled in Portuguese...
I'm not sure what you mean by "genuine", but I suspect that whether
"arigato" is genuine does not depend on Portuguese.
http:
69 matches
Mail list logo