Now the ICFP contest is now over, several of the entrants have been
interested in seeing if we can't write a decent universal machine (the
'hardware' of this year's contest), in Haskell.
This is an interesting problem for Haskell, since the spec encourages
the use of mutable variables and mutable
Lemmih wrote:
On 7/25/06, mvanier [EMAIL PROTECTED] wrote:
Hi,
I was playing around with runhaskell (runghc to be precise), and I
discovered
the limitation wherein you have to use the file suffix .hs. Don't
get me
wrong, runhaskell is great, but if you didn't have that restriction it
would
Bulat Ziganshin-2 wrote:
Hello Matthew,
Sunday, July 23, 2006, 10:35:41 AM, you wrote:
sequence $ [ reffill b s | s - [0..(fi temits)-1], b - [0..(fi
nc)-1]]
Now thats interesting. I can see that this function is more appropriate
since I do not need to retrieve data from the
On 7/26/06, Neil Mitchell [EMAIL PROTECTED] wrote:
The main purpose of canoncialPath is to fix the case on Windows, so
c:\my documents\file.doc becomes C:\My Documents\file.doc if that
is the case correct version of the file. I think this function will
not actually change the file with relation
Neil Mitchell wrote:
I'm not sure about canonicalPath. This interface seems to suffer from
the same
race conditions as the temporary file interface: the answer is
immediately
invalid, so you can't rely on it.
The main purpose of canoncialPath is to fix the case on Windows, so
c:\my
Hello Krasimir,
Wednesday, July 26, 2006, 10:46:13 AM, you wrote:
The FilePath abstraction was discussed a number of times and it
seems that people prefer an ADT representation instead of plain
String. I tend to agree. Maybe such ADT based library can be
integrated with some new IO
Hi, Im trying to use Frantk from winhughs but i dont know how to
import the file, where to put the sources to work, how to import other
libaries, etc.
If i wanto to import Frantk.lh where i have to place (somo folder,
inside the winhugs tree, where?) it or import it?
Thanks in advance.
Alvaro.
Hi Alvaro,
WinHugs has a search path, click on options to change it, and add the
directory that corresponds to the copy of Frantk.
Or alternatively put it in C:\Program
Files\WinHugs\packages\frantk\your code here , which is already on
the search path.
Thanks
Neil
On Wed, Jul 26, 2006 at 03:36:13AM +0100, Neil Mitchell wrote:
pathSeparator :: Char
The character that seperates directories.
So what do I do with this? If I need it, it seems like the module has
failed.
Hopefully no one will ever use it. Its part of the low level functions
that the
Donn Cave [EMAIL PROTECTED] writes:
Now that I look at what I did with ldap_set_option, I recall that
s actually a little difficult to assign a type, since the third
parameter is sometimes Int, Enum, TimeVal, String, and LDAP_OPT_*
values overlap in a way that doesn't really say enum to me.
I'd just point out that I'm not aware of an operating system that GHC
runs on that doesn't accept '/' as a path separator. It may be that
you could fine an OS where you could compile with jhc or run with hugs
that doesn't use '/' (e.g. MacOS 9), but support for MacOS 9 at this
stage I wouldn't
On 7/25/06, Jared Updike [EMAIL PROTECTED] wrote:
I am trying to derive MyOrd class from Eq (Prelude):
class Eq a = MyOrd a where
(%=), (%), (%=) :: a - a - Bool
x %= y = (x y || x == y)
x % y = y x
x %= y = (y x || x == y)
Q: What's wrong? Why 'Ord'
Andrew Pimlott wrote:
The drive functions stand on their own as a chunk, and are possibly
not well suited to a Posix system, but are critical for a Windows
system.
Why are they critical for portable code? I am fine with
Windows-specific functions, but I think it's a mistake to bundle
Hi Dmitri,
I don't have answers for all your questions. But some, at least.
--- Dmitri O.Kondratiev [EMAIL PROTECTED] wrote:
-- Ok, then I can
derive MyOrd class directly from Ord:
class Ord a = MyOrd a where
(%), (%=), (%), (%=) :: a - a - Bool
x % y = x y
x %=
y =
On Wed, 2006-07-26 at 15:29 +0200, Udo Stenzel wrote:
My criticism is that your properties are all specified in terms of
string manipulation.
Exactly. I believe, a FilePath should be an algebraic datatype.
Most operations on that don't have to be specified, because they are
simple and
On 7/26/06, SevenThunders [EMAIL PROTECTED] wrote:
Bulat Ziganshin-2 wrote:
Hello Matthew,
Sunday, July 23, 2006, 10:35:41 AM, you wrote:
sequence $ [ reffill b s | s - [0..(fi temits)-1], b - [0..(fi
nc)-1]]
Now thats interesting. I can see that this function is more
yes, 9am or 10am. Probably the former.
S
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Fitzgerald
Sent: 25 July 2006 18:31
To: Haskell Cafe
Subject: [Haskell-cafe] ghc hackathon start time?
What time on September 14th will the GHC Hackathon
begin? I
Looks possible. But it'd depend on using '' not '= \_ - ...', so a
bit fragile.
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Neil
| Mitchell
| Sent: 23 July 2006 13:57
| To: Bulat Ziganshin
| Cc: haskell-cafe@haskell.org
| Subject: Re:
Am Mittwoch, 26. Juli 2006 16:20 schrieb Dmitri O.Kondratiev:
On 7/25/06, Jared Updike [EMAIL PROTECTED] wrote:
I am trying to derive MyOrd class from Eq (Prelude):
class Eq a = MyOrd a where
(%=), (%), (%=) :: a - a - Bool
x %= y = (x y || x == y)
x % y
Hi,
Perhaps instead:
directoryOf :: FilePath - String
filenameOf :: FilePath - String
extensionOf :: FilePath - String
basenaneOf :: FilePath - String
replaceFilename = joinFilePath . directoryOf
replaceDirectory = flip joinFilePath . filenameOf
Trying to design a
On Wed, 26 Jul 2006, Ferenc Wagner wrote:
...
I ended up binding ldap_initialize, which supports ldaps:
URL-s, and was achievable in a 10 line absolutely
nonintrusive patch (darcs sent). Good enough for me ATM.
Yes, actually that's not just a good solution to your problem but
a good idea
On Jul 26, 2006, at 1:47 PM, Neil Mitchell wrote:
Hi,
Perhaps instead:
directoryOf :: FilePath - String
filenameOf :: FilePath - String
extensionOf :: FilePath - String
basenaneOf :: FilePath - String
replaceFilename = joinFilePath . directoryOf
replaceDirectory = flip
Duncan Coutts wrote:
On Wed, 2006-07-26 at 15:29 +0200, Udo Stenzel wrote:
Exactly. I believe, a FilePath should be an algebraic datatype.
We've had this discussion before. The main problem is that all the
current IO functions (readFile, etc) use the FilePath type, which is
just a
On Wed, Jul 26, 2006 at 03:36:13AM +0100, Neil Mitchell wrote:
Its a rats nest to do it properly, but some very basic idea of does
this path have things which there is no way could possibly be in a
file - for example c:\|file is a useful thing to have.
This seems to encourage the classic
On Wed, Jul 26, 2006 at 03:29:01PM +0200, Udo Stenzel wrote:
Andrew Pimlott wrote:
Also, it looks from this that you treat paths differently depending on
whether they end in a separator. Yet this makes no difference to the
system. That seems wrong to me.
Not to the system, but some
On Wed, Jul 26, 2006 at 04:34:50PM +0100, Duncan Coutts wrote:
On Wed, 2006-07-26 at 15:29 +0200, Udo Stenzel wrote:
Exactly. I believe, a FilePath should be an algebraic datatype.
Most operations on that don't have to be specified, because they are
simple and have an obvious effect. Add
Hi
So what's better?
- use an ADT (correct and portable by construction), convert to String
when calling the IO library
- fumble with Strings, use an unholy mix of specialized and general
functions, trip over a corner case
Or provide an ADT, demand people marshal to and from this ADT
Hi
Ok, this is a good use case. What should wget do if isValid fails?
isValid (makeValid x) == True
makeValid is system dependant, and unspecified in its behaviour,
although obviously some kind of closeness to the original would be
ideal. So what if isValid fails and we don't have this?
Hello Udo,
Wednesday, July 26, 2006, 9:41:58 PM, you wrote:
- parameterize the FilePath ADT on the character type, you get (FilePath
Word16) on Windows (which uses UCS-2, not UCS-4 and not UTF-16) and
if i correctly understand, UCS-2 uses 2 bytes for ANY char, while
UTF-16 uses 2 or 4
Hello Duncan,
Wednesday, July 26, 2006, 7:34:50 PM, you wrote:
Exactly. I believe, a FilePath should be an algebraic datatype.
Most operations on that don't have to be specified, because they are
simple and have an obvious effect. Add a system specific parser and a
system specific
On Wed, 2006-07-26 at 19:41 +0200, Udo Stenzel wrote:
Duncan Coutts wrote:
On Wed, 2006-07-26 at 15:29 +0200, Udo Stenzel wrote:
Exactly. I believe, a FilePath should be an algebraic datatype.
We've had this discussion before. The main problem is that all the
current IO functions
On Wed, 2006-07-26 at 11:32 -0700, Andrew Pimlott wrote:
On Wed, Jul 26, 2006 at 03:36:13AM +0100, Neil Mitchell wrote:
Its a rats nest to do it properly, but some very basic idea of does
this path have things which there is no way could possibly be in a
file - for example c:\|file is a
On Wed, Jul 26, 2006 at 08:19:47PM +0100, Neil Mitchell wrote:
Ok, this is a good use case. What should wget do if isValid fails?
makeValid is system dependant, and unspecified in its behaviour,
although obviously some kind of closeness to the original would be
ideal. So what if isValid
On Wed, Jul 26, 2006 at 11:39:40AM -0700, Andrew Pimlott wrote:
On Wed, Jul 26, 2006 at 03:29:01PM +0200, Udo Stenzel wrote:
Andrew Pimlott wrote:
Also, it looks from this that you treat paths differently depending on
whether they end in a separator. Yet this makes no difference to the
Hi
re: isValid
Perhaps we should be more specific and make it talk about illegal file
name characters if that is indeed the use case. Perhaps we should
provide a system-dependent list of characters that are not allowed in
file names. For example, on windows that would include '?'.
Then an
Andrew Pimlott wrote:
Maybe the trailing slash is important enough to take into account.
No, not the trailing slash. The difference between a directory and its
contents is important enough. This is ususally encoded using a trailing
slash, but I'd rather not worry about that detail in a
On Wed, Jul 26, 2006 at 10:32:02PM +0100, Neil Mitchell wrote:
Sorry, I meant to say what I think wget should do. IMO, it should have
a conservative set of allowed characters, encode the filename into that
Not enough, because of the LPT1 issue - unless you add L as a
disallowed letter :)
Udo Stenzel [EMAIL PROTECTED] writes:
No, not the trailing slash. The difference between a directory and its
contents is important enough. This is ususally encoded using a trailing
slash, but I'd rather not worry about that detail in a program.
What does Emacs do with double separators?
At Wed, 26 Jul 2006 23:07:36 +0200,
Udo Stenzel wrote:
What does Emacs do with double separators? I'm at a loss thinking of
anything they could denote, but it could be useful.
You mean like,
/path/to/somewhere//with/double/seperator
If so, it treats it as if you had typed in:
First, http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html may be useful
to compare to. I learned C:\ is an absolute and C: is a relative path.
What are the use cases? I can see four different types of file paths that one
will want to manipulate. The following are all pure functions:
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
___
Haskell-Cafe mailing list
As opposed to what?
Mike
Mike Gunter wrote:
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
On 7/27/06, mvanier [EMAIL PROTECTED] wrote:
As opposed to what?
For example case-of, guards (in combination with let or where), or
just a function:
if :: Bool - a - a - a
if True t _ = t
if False _ e = e
-- example usage
myAbs x = if (x 0) (negate x) x
/S
--
Sebastian Sylvan
Quoth Sebastian Sylvan [EMAIL PROTECTED]:
| On 7/27/06, mvanier [EMAIL PROTECTED] wrote:
| As opposed to what?
|
| For example case-of, guards (in combination with let or where), or
| just a function:
|
| if :: Bool - a - a - a
| if True t _ = t
| if False _ e = e
|
| -- example usage
| myAbs x =
On 7/26/06, Donn Cave [EMAIL PROTECTED] wrote:
That looks to me like a different way to spell if then else, but maybe
that's the answer to the question - conceptually, for every then there
really is an else, however you spell it, and only in a procedural language
does it make any sense to leave
On 7/27/06, Dan Doel [EMAIL PROTECTED] wrote:
On 7/26/06, Donn Cave [EMAIL PROTECTED] wrote:
That looks to me like a different way to spell if then else, but maybe
that's the answer to the question - conceptually, for every then there
really is an else, however you spell it, and only in a
Mike Gunter wrote:
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
Thanks for asking about this -- it probably should be in the paper.
47 matches
Mail list logo