Hallo,
On 10/21/09, Tim Wawrzynczak inforichl...@gmail.com wrote:
Here's an example in the IO monad:
import Data.IORef
import System.IO.Unsafe
counter = unsafePerformIO $ newIORef 0
next = do
modifyIORef counter (+1)
readIORef counter
Naturally, this uses unsafePerformIO, which as
Hallo,
On Tue, Oct 6, 2009 at 11:01 PM, michael rice nowg...@yahoo.com wrote:
How do I create an alias for a function, like giving CAR the same
functionality as HEAD. I know I can do it by creating a definition (see
below), but is there a better way, like Scheme's
(define head car)
car
Hallo,
On 9/30/09, ed...@ymonad.com ed...@ymonad.com wrote:
Hi,
I will give a seminar to physicists at USP (Universidade de São Paulo,
Brazil) university and they asked me for a good title, something that can
attract physicists. Anyone has some suggestions? (Will be
a seminar about the
Hallo,
On 5/20/09, Diego Souza paravinic...@yahoo.com.br wrote:
Not exactly São Carlos: São Paulo - SP.
Me too, Sao Paulo - SP.
Cheers,
--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hallo,
On 4/24/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote:
so, if you just need haskell-C++ interaction, you may look into using
FFI [1,2]. if you believe that you can compile some
java/ruby/haskellwhatever code down to C++ and incorporate it into
your function - sorry, they all
Hallo,
On 4/24/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote:
and it supports lazy lists? :) all compiled languages has some FFI, the
problem is that FFI limited to common subset of all those languages -
i.e. primitive types and pointers
I am not saying that Scheme is Haskell.
Hallo,
On 4/24/09, Donn Cave d...@avvanta.com wrote:
Quoth Alex Queiroz asand...@gmail.com,
Actually some Scheme compilers have a c-declare form that lets
you create C functions, which can be called from C, Haskell, Java,
Ruby etc.
That would be like what you get with Haskell
Hallo,
On 4/14/09, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
The short answer is: You cannot. The longer answer is: Only put
things in the IO monad when you need
Hallo,
On Fri, Mar 13, 2009 at 1:23 PM, Benjamin L. Russell
dekudekup...@yahoo.com wrote:
On Fri, 13 Mar 2009 12:29:25 +0100, Achim Schneider bars...@web.de
Water overcomes stone:
Shapeless, it requires no opening:
The benefit of taking no action.
Yet benefit without action,
And experience
Hallo,
On Wed, Jan 14, 2009 at 5:06 PM, Max Rabkin max.rab...@gmail.com wrote:
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order functions and laziness?
I believe I do: one macro I found
Hallo,
On Wed, Jan 14, 2009 at 5:16 PM, Max Rabkin max.rab...@gmail.com wrote:
On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz asand...@gmail.com wrote:
I have one for binding GET/POST variables to regular variables
transparently and with error checking, just inside the body of the
macro
Hallo,
On Wed, Jan 14, 2009 at 8:47 PM, Dougal Stanton ith...@gmail.com wrote:
(defun avg (rest args)
(/ (apply #'+ args) (length args)))
Or as a macro like this:
(defmacro avg (rest args)
`(/ (+ ,@args) ,(length args)))
The reason the macro is better is that the length of the list
Hallo,
On Fri, Oct 10, 2008 at 5:48 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Don Stewart wrote:
This could be a game changer.
In what way? As far as I'm aware, .NET never really caught on and has long
since become obsolete. Or do you just mean the type system machinery that
has been
Hallo,
On Dec 19, 2007 9:25 PM, John Meacham [EMAIL PROTECTED] wrote:
Actually, it is a pretty fundamental feature of the lisp-derived
languages that they can self modify their own source, and hence keep
their own source representation all the way through runtime.
This is not actually
Hallo,
On 10/3/07, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote:
Hi Alex,
I hope not to spoil your fun but have you had a look at this:
Write Yourself a Scheme in 48 Hours
http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html
Yes, I'm actually using it as a
Hallo,
For fun and learning I'm trying to parse R5RS Scheme with Parsec.
The code to parse lists follows:
--
-- Lists
--
parseLeftList :: Parser [SchDatum]
parseLeftList = do
char '('
many parseDatum = return . filter (/= SchAtmosphere)
parseDottedList :: [SchDatum] - Parser SchDatum
Hallo,
On 10/2/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
On Oct 2, 2007, at 9:52 , Alex Queiroz wrote:
(parseDottedList ls) | (parseProperList ls)
I've factored out the common left sub-expression in
parseLeftList. The problem is that ... is a valid identifier so when
Hallo,
On 10/2/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
Sorry, just woke up and still not quite tracking right, so I modified
the wrong snippet of code. The trick is to wrap parseLeftList in a
try, so the parser retries the next alternative when it fails.
Since ... can
Hallo,
On 8/14/07, Jeff Polakow [EMAIL PROTECTED] wrote:
Hello,
There is clearly a problem with the Haskell/monad tutorials out there...
The tutorials seriously need to step back and start with
something like, To enforce order of evaluation we evaluate
closures* returning a defined
Hallo,
On 7/16/07, Malcolm Wallace [EMAIL PROTECTED] wrote:
OK, so I'm not genuinely suggesting that you must possess or be studying
for a PhD, to grok Haskell. But I find nothing alarming about the
suggestion that one needs a fairly high level of intelligence, and some
training, in order to
Hallo,
On 7/14/07, Michael T. Richter [EMAIL PROTECTED] wrote:
While it is understandable, given the intense interest most grognards of any language
have in playing with the language, for people to enjoy conversations that go into the
ever-more-esoteric, it is decidedly not helpful to the
Hallo,
On 7/11/07, Andrew Coppin [EMAIL PROTECTED] wrote:
When I tell the editor to save UTF-8, it inserts some weird BOM
character at the start of the file - and thus, any attempt at
programatically processing that file instantly fails. :-(
Are you sure it's not UTF-16?
Cheers,
--
Hallo,
On 7/10/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Last time I looked, everything treats text as being 8 bits per
character. (Or, more commonly, 7, and if the MSB isn't 0, weird things
happen...) That's why (for example) HTML has lots of weird constructs
such as hellip; in it, instead
Hallo,
On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
I highly doubt that. For two reasons:
1. People can only cling to unproductive and clumsy tools for so long
(we don't write much assembly any more...). Capitalism works to ensure
this; people who are willing to switch to more
Hallo,
On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
That might eliminate the concurrency imperative (for a while!), but it
doesn't adress the productivity point. My hypothesis is this: People
don't like using unproductive tools, and if they don't have to, they
won't.
So you
Hallo,
On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
The revolution (tm) won't come at the same time for all domains. C is
probably used/supported in embedded devices mostly because it's
popular for non-embedded devices (not because C is somehow uniquely
suited for embedded devices).
Hallo,
On 6/19/07, Andrew Coppin [EMAIL PROTECTED] wrote:
However, Haskell only has 1 type of collection: linked lists. (And only
single-linked at that.) While other normal programming languages spend
huge amounts of effort trying to select exactly the right collection
type for the task in
Hallo,
On 6/18/07, Michael T. Richter [EMAIL PROTECTED] wrote:
Screenshots are worthless if they don't match my screen, aren't they? I guess
I can open up exactly the same file that's in your screenshot and then use your
screenshot as a background to my screen so I have the illusion of
Hallo,
On 6/18/07, Andrew Coppin [EMAIL PROTECTED] wrote:
OTOH... how the heck do you write an operating system in a language that
doesn't even support I/O? :-S
You can start from here: http://programatica.cs.pdx.edu/House/
Cheers,
--
-alex
http://www.ventonegro.org/
Hallo,
On 5/30/07, Andrew Coppin [EMAIL PROTECTED] wrote:
OK, so you're saying that in 4 days you wrote something that
out-performs Mathematica, a program that has existed for decades and has
a vast, highly-funded RD effort behind it featuring some of the
brightest minds in the field?
I'm in
Hallo,
On 5/21/07, Michael T. Richter [EMAIL PROTECTED] wrote:
Oh, and of course it wasn't just the config files I showed problems with, now,
was it? I seem to remember something about modality and bad syntax
highlighting. Maybe I was tripping. It happens.
You may not like
Hallo,
On 4/27/07, Fernando Cassia [EMAIL PROTECTED] wrote:
Goodbye Haskell, I just wanted to compile a MP3 player, and perhaps if the
compiler installed OK with no issues, I'd have taken a look at the language.
But as of right now, I don't have time to waste with broken compiler
installers.
Hallo,
On 4/26/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Like the cpp will choke and die :) Multiline string literals were one
of the motivations for cpphs.
Does cpphs allow me to include a whole file into a Haskell source
file, inserting automatically the string gaps?
--
-alex
Hallo,
On 4/26/07, Neil Mitchell [EMAIL PROTECTED] wrote:
No, but Hugs does with Here documents.
Unfortunately I'm using GHC but thanks!
Cheers,
--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hallo,
On 4/12/07, kynn [EMAIL PROTECTED] wrote:
Hi. I can't find that post. Could you point it to me please?
It's in here:
http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10#programmable-semicolons
--
-alex
http://www.ventonegro.org/
___
Hallo,
On 4/11/07, riccardo cagnasso [EMAIL PROTECTED] wrote:
The post on dons' blog about the cpu scaler is a great example on how
haskell can easily used in the day-to-day hacking!
Just read it, it's a very nice post. I'm not afraid of math, but
it's a relief to see some code I can
Hallo,
On 3/29/07, Nicolas Frisby [EMAIL PROTECTED] wrote:
A wee bit off topic... but bear with me.
More off-topic... but bear with me. :-)
I'm starting with Haskell. I'm writing a real application with Gtk2hs
and HDBC for a small furniture shop. I have enjoyed it very much so
far, and I
Hallo list,
I don't quite get how ($!) works. I have this function:
dbCreateIndices con dtn dof = do
let dummy = newDbItem
let query = SELECT id FROM ++ (dtn dummy) ++ ORDER BY ++ (dof dummy)
ids - liftM (map fromSql . concat ) $! quickQuery con query []
return $ IntMap.fromList
Hallo,
On 3/20/07, Jules Bean [EMAIL PROTECTED] wrote:
What $! does is force its arguments into WHNF before applying the
function. WHNF means, roughly, either a lambda or a constructor at the
top-level.
I think I got it now.
However that's a bit clumsy. What kind of error are you
Hallo,
On 3/20/07, Jules Bean [EMAIL PROTECTED] wrote:
Personally I'd inclined to suggest use of the strict FetchRow which the
library provides than struggle with explicit uses of seq to fight an
over-lazy IO action.
Sounds like a good suggestion. Thanks very much for the help!
Cheers,
Hallo,
On 3/14/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
Ah, a fine idea. I'll do that anyway; maybe others will have even better
ideas, but that's a good start
Ah! So now I knows what it means. I've also been beaten by this
error message a couple of days ago.
Cheers,
--
-alex
Hallo,
On 3/6/07, John Goerzen [EMAIL PROTECTED] wrote:
I should add, though, that you were pointing to the old HDBC site.
Please download HDBC from http://software.complete.org/hdbc/downloads
The Sqlite3 driver is at
http://software.complete.org/hdbc-sqlite3/downloads
The quux.org download
Hallo list,
I guess the subject line says it all. Can anybody help me?
--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hallo,
On 3/5/07, ArtemGr [EMAIL PROTECTED] wrote:
My instructions (i made it for myself! provided as is):
Worked after some tweaks for my system. It was actually much
easier than I thought. Thanks very much!
--
-alex
http://www.ventonegro.org/
Hallo,
Gtk2Hs and HDBC are both LGPL licensed, but aren't they always
static linked? Is there a way to use them in closed-source programs?
Cheers,
--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hallo,
On 3/5/07, Duncan Coutts [EMAIL PROTECTED] wrote:
If you're really worried (but I wouldn't be) then do recall that the
static linking thing only requires that the end user be able to relink
with a different version that preserves the same ABI. So you don't have
to provide source for
Hallo,
On 1/24/07, jamin1001 [EMAIL PROTECTED] wrote:
So then how should this be done? What if I want to do something like
data Chair = Chair {pos:: Int, color :: Int}
data Table = Table {pos:: Int, color :: Int}
data Chair = Chair { chairPos :: Int, chairColor :: Int }
Also, could
Hallo,
On 1/24/07, Ketil Malde [EMAIL PROTECTED] wrote:
jamin1001 wrote:
What if I want to do something like
data Chair = Chair {pos:: Int, color :: Int}
data Table = Table {pos:: Int, color :: Int}
data Properties = Props { pos, color :: Int }
data Chair = Chair Props
data Table = Table
Hallo,
On 1/8/07, Hans van Thiel [EMAIL PROTECTED] wrote:
Thanks, I didn't know that. What other widget libraries are supported at
this time?
Only GTK+. :-)
--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Hallo,
On 1/8/07, Hans van Thiel [EMAIL PROTECTED] wrote:
Hello All,
The beta of the 'Gtk2Hs:Getting Started' short tutorial for beginners,
Haskell GUI for Dummies, if you like :-) can be viewed at
http://j-van-thiel.speedlinq.nl/gtk2hs/gtk2hsGetStart.html
Nitpicking: Glade does not
Hallo,
On 12/14/06, Paul Moore [EMAIL PROTECTED] wrote:
But overall I'd agree, this is a very helpful community - it's just
that you all seem so much cleverer than I, so I'm not sure I'll ever
be smart enough to write Haskell programs :-) (50% joke...)
I know the feeling. :-)
--
-alex
Hallo,
On 12/13/06, Claus Reinke [EMAIL PROTECTED] wrote:
we have had lots of languages that were intended to be well-designed
(good, beautiful, ..), but never much used in practice, and we have also
had lots of languages that were intended to be pragmatic (practical,
useful, ..), without much
Hallo,
On 12/11/06, Matthew Brecknell [EMAIL PROTECTED] wrote:
Yes. Take a look at Data.Map. This data structure provides various
operations which create a new map from an old one in O(log n) time, by
splicing bits of the old map into the new one. Importantly, performing
any of these
Hallo,
On 12/12/06, Benjamin Franksen [EMAIL PROTECTED] wrote:
Alex Queiroz wrote:
On 12/11/06, Stefan O'Rear [EMAIL PROTECTED] wrote:
No. Haskell's lists are linked lists, enlarge creates a single new link
without modifying (and copying) the original.
Thanks. Is there a way to mimic
Hi all,
I'm considering the use of Haskell to manipulate large data
structures for Computer Graphics (large geometric datasets). I'm
wondering what's the best way to do it. As objects (not in the OO
sense) in Haskell are immutable, how can I add a vertex to a large
mesh without using obscene
Hallo,
On 12/11/06, Stefan O'Rear [EMAIL PROTECTED] wrote:
No. Haskell's lists are linked lists, enlarge creates a single new link
without modifying (and copying) the original.
___
Thanks. Is there a way to mimic this behaviour with my own
Hallo,
On 11/27/06, Max Vasin [EMAIL PROTECTED] wrote:
A small addition: some GPLed libraries (libstdc++ AFAIK) allow
linking with proprietary software by adding clause to lisence
which relaxes GPL requirements.
Nope, it's LGPL with an extra binary linking permission.
Cheers,
--
-alex
Hallo,
On 11/13/06, Mark T.B. Carroll [EMAIL PROTECTED] wrote:
How up to date will Debian unstable's GHC be kept, though? It seems
pretty good at the moment, but there have been times when we've had to
install from source instead of via Debian earlier this year so that we
had GHC features and
Hallo,
On 9/25/06, Ch. A. Herrmann [EMAIL PROTECTED] wrote:
Hi,
Henning Thielemann wrote:
assembly language (Assembler ist deutsch :-)
for mysterious reasons it entered the English world.
'Assembly' is a language. 'Assembler' is a program.
--
-alex
http://www.ventonegro.org/
Hallo,
On 9/21/06, Bill Wood [EMAIL PROTECTED] wrote:
I have only recently started accessing some web fora, but I've noticed
that some of those powered by phpBB are vulnerable to spamming,
whereas the news groups seem to be less so. For example, the
python-forum has nearly lost it's General
Hallo,
On 9/6/06, Tamas K Papp [EMAIL PROTECTED] wrote:
PS: I realize that I am asking a lot of newbie questions, and I would
like to thank everybody for their patience and elucidating replies.
I am a newbie myself (second week of learning Haskell), but I'll
give it a shot: Since
Hallo,
On 9/6/06, Lennart Augustsson [EMAIL PROTECTED] wrote:
Furthermore, doing that optimization (common subexpression
elimination) can lead to space leaks. So you should not count on the
compiler doing it. Besides, I often find it more readable and less
error prone to name a common
62 matches
Mail list logo