The program is written in Haskell, hence my shameless ad here:
http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html
GaBuZoMeu is a set of programs to parse and check language tags (see
the RFC 4646 produced by the IETF Working Group LTRU - Language Tag
Registry Update).
Language tags
Vivian McPhail wrote:
class Forkable a where
fork :: String - a - a - a
What I would like to be able to do is
differentiate between Forkable (m a -
b) and Forkable (function type - b).
Have you tried this combination of instances?
instance Forkable (IO a) where ...
--
On 2006-09-12, Brian Hulley [EMAIL PROTECTED] wrote:
Bryan Burgers wrote:
That being said, I'll have to play the other side of the coin: it
would probably be a little bit of a pain to have to define instances
of each data declaration (Integer, Int, Float, Matrix, Complex, etc.)
on each of
On 2006-09-12, Jacques Carette [EMAIL PROTECTED] wrote:
First, as already pointed out in
http://www.haskell.org/pipermail/haskell-cafe/2006-April/015404.html
there is a lot of relevant previous work in this area.
I'm afraid I don't see the relevance.
This is very easy to do in 'raw' category
I'm trying to write in Haskell a function that in Java would be something
like this:
char find_match (char[] l1, char[] l2, char e){
//l1 and l2 are not empty
int i = 0;
while (l2){
char aux = l2[i];
char[n] laux = l2;
crespi.albert:
I'm trying to write in Haskell a function that in Java would be something
like this:
char find_match (char[] l1, char[] l2, char e){
//l1 and l2 are not empty
int i = 0;
while (l2){
char aux = l2[i];
char[n] laux = l2;
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote:
I'm trying to write in Haskell a function that in Java would be something
like this:
char find_match (char[] l1, char[] l2, char e){
//l1 and l2 are not empty
int i = 0;
while (l2){
char aux =
dons:
crespi.albert:
I'm trying to write in Haskell a function that in Java would be something
like this:
char find_match (char[] l1, char[] l2, char e){
//l1 and l2 are not empty
int i = 0;
while (l2){
char aux = l2[i];
char[n] laux = l2;
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote:
compare function just compares the two lists and return true if they are
equal, or false if they are not.
it is really a simple function, but I've been thinking about it a lot of
time and I can't get the goal.
I forgot, obviously,
wow, the simpliest ever!
Andrea Rossato wrote:
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote:
compare function just compares the two lists and return true if they are
equal, or false if they are not.
it is really a simple function, but I've been thinking about it a lot of
mailing_list:
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote:
compare function just compares the two lists and return true if they are
equal, or false if they are not.
it is really a simple function, but I've been thinking about it a lot of
time and I can't get the goal.
I
That works good, but I have a problem with the return type, I forgot to
mention... can it be a [char]??
Donald Bruce Stewart wrote:
crespi.albert:
I'm trying to write in Haskell a function that in Java would be something
like this:
char find_match (char[] l1, char[] l2, char e){
Yes, they must be equal the whole way, I like this recursive solution :)
Ketil Malde-3 wrote:
Carajillu [EMAIL PROTECTED] writes:
compare function just compares the two lists and return true if they are
equal, or false if they are not.
find_match 4*ha 4*5a 'h' returns '5' (5
Andrea Rossato [EMAIL PROTECTED] writes:
I forgot, obviously, that lists are an instance of the Eq class...
so, this is enough:
comp l1 l2 = if l1 == l2 then True else False
Or why not:
comp l1 l2 = l1 == l2
Or simply:
comp = (==)
:-)
-k
--
If I haven't seen further, it is by
On Wed, Sep 20, 2006 at 07:20:23PM +1000, Donald Bruce Stewart wrote:
comp l1 l2 = if l1 == l2 then True else False
You never stop learning!
andrea
which you would just write as:
comp = (==)
and then you'd just use == anyway :)
this is why I came to love haskell: it remembers
On Tue, 2006-09-19 at 19:45 -0700, Lyle Kopnicky wrote:
Hi folks,
I'm working on a project for which the solution is highly
parallelizable. I've been writing it so far for GHC as a single-threaded
app. I'd like to be able to split the job into multiple pieces, and
spawn different system
On Tue, Sep 19, 2006 at 08:06:07PM +0200, [EMAIL PROTECTED] wrote:
For our optimization problem, it's only a matter of constructors on the
right hand side. They should pop out before do not look on any
arguments, so it's safe to cry so you just know, i'm a Just.
It seems the appropriate
Hello Tim,
Wednesday, September 20, 2006, 1:28:47 AM, you wrote:
rec {field=val}
but there is no settor function. It would be nice if there was some
sort of section-like syntax to access the settor function, like:
you can use DriFT which generates setter, isA and many other functions
Carajillu [EMAIL PROTECTED] writes:
That works good, but I have a problem with the return type, I forgot to
mention... can it be a [char]??
If that's what you want, how about this:
import Maybe
find_match l1 l2 c
= fmap catMaybes . sequence $ zipWith match l1 l2
where
... and if you want to search strings not single characters:
findmatch s t e = take m . drop n $ t
where
m' = length e
(n, m) = f 0 s
f i s | take m' s == e = (i, m')
| null s = (0, 0)
| otherwise = f (i+1) (tail s)
findmatch asdfasdf
Vivian McPhail wrote:
class Forkable a where
fork :: String - a - a - a
What I would like to be able to do is
differentiate between Forkable (m a -
b) and Forkable (function type - b).
Have you tried this combination of instances?
instance Forkable (IO a) where
Hello,
I'm trying to use haskell to put together a TCP proxy I can put
between my browser and my webserver.
This is as far as I got. The webserver isn't returning my request:
listen = withSocketsDo $ do
putStrLn Listening...
socket - listenOn $ PortNumber 8082
(handleToClient,
Actually, it blocks on:
putStrLn contents
It even blocks if I replace it with:
print $ length contents
Is there some kind of magic happening here?
-John
On 9/20/06, John Ky [EMAIL PROTECTED] wrote:
Hello,
I'm trying to use haskell to put together a TCP proxy I can put
between my
On Wed, 20 Sep 2006, John Ky wrote:
Actually, it blocks on:
putStrLn contents
It even blocks if I replace it with:
print $ length contents
Is there some kind of magic happening here?
No, but you're trying to do magic - it can't get all of contents until the
connection's
Hello John,
Wednesday, September 20, 2006, 3:59:36 PM, you wrote:
I'm trying to use haskell to put together a TCP proxy I can put
between my browser and my webserver.
This is as far as I got. The webserver isn't returning my request:
hSetBuffering handleToServer LineBuffering
may help
Hi Bulat,
Thanks. Yes it helps with an earlier implementation I wrote (below).
But surely there must be a better way to write this. My code is way
to verbose.
-John
---
doProxyServer handleToClient handleToServer = do
eof - hIsEOF handleToServer
if not eof
then do
ready -
Hi again,
Given that putStrLn contents did manage to print out the HTTP header
before blocking, am I correct in coming to the conlusion that
'contents' is evaluated lazily? So Monads don't actually eliminate
laziness?
-John
On 9/20/06, Philippa Cowderoy [EMAIL PROTECTED] wrote:
On Wed, 20
Malcolm Wallace has recorded the ICFP programming contest results
announcement as video, straight from the ICFP conference in Portland.
He's posted it to Google Video, and it's available to download (120M) or
stream from Google video, here:
How about something like this?
import Data.List
findMatch xs ys k = lookup k . concat $ zipWith zip (substrings xs)
(substrings ys)
where substrings = nonempty . map (nonempty . inits) . tails
where nonempty = filter (not . null)
On 20/09/06, Matthias Fischmann [EMAIL
Whenever people start discussing the Numeric type classes, the true
scope of what a refactoring can (and should?) be is frequently
under-estimated. The 'structure' of algebraic objects in mathematics
has been studied quite a lot (in mathematics and in CS, but not so much
by programming
On 2006-09-20, Jacques Carette [EMAIL PROTECTED] wrote:
[Hopefully this answers your 'relevance' question].
Yes. I was focusing on the more narrow aspect, rather than what had
started this thread.
In other words, the specification language people have been down this
road quite some time
On Thu, Sep 21, 2006 at 12:26:03AM +1000, John Ky wrote:
Given that putStrLn contents did manage to print out the HTTP header
before blocking, am I correct in coming to the conlusion that
'contents' is evaluated lazily?
hGetContents breaks the rules of the IO monad - it returns a value (the
Michael Shulman wrote:
Ah, excellent. So it sounds like at least in Haskell prime, I'll
probably be able to use MonadPlus to do what I want, because MaybeT
and ErrorT will be instances of MonadOr instead.
I'm not sure if this is part of Haskell Prime, though.
--
Ashley Yakeley
On Tuesday 19 September 2006 09:40, Deokhwan Kim wrote:
Albert Lai wrote:
Deokhwan Kim [EMAIL PROTECTED] writes:
Where is the Monad instance declaration of Either e?
It is in Control.Monad.Error as well. Strange: the doc doesn't state
it.
Thanks a lot, Albert! I found the
I'm just tried writing a function to allow convenient embedding of shell
commands, but I'm running into behavior I don't really understand
somewhere at the intersection of lazy evaluation, IO, and threading.
The function in question is:
sh :: String - String - IO String
sh cmd = \input -
I've written a function that looks similar to this one
getList = find 5 where
find 0 = return []
find n = do
ch - getChar
if ch `elem` ['a'..'e'] then do
tl - find (n-1)
return (ch : tl) else
find n
First, how do I fix the identation of the
br1:
I've written a function that looks similar to this one
getList = find 5 where
find 0 = return []
find n = do
ch - getChar
if ch `elem` ['a'..'e'] then do
tl - find (n-1)
return (ch : tl) else
find n
First, how do I fix the
dons:
br1:
Second, I want to test this function, without hitting the filesystem. In
C++ I would use a istringstream. I couldn't find a function that returns
a Handle from a String. The closer thing that may work that I could find
was making a pipe and convertind the file
dons:
br1:
Second, I want to test this function, without hitting the filesystem. In
C++ I would use a istringstream. I couldn't find a function that returns
a Handle from a String. The closer thing that may work that I could find
was making a pipe and convertind the file
39 matches
Mail list logo