Hi, I copied the program below from a reddit post of dons'. I have a dual
core laptop with ubuntu hardy and ghc 6.10.1. I can see the difference when
I run the program with +RTS -N2 but CPU always says 100%. I'd like an
example that shows 100 -- is it not showing 100 because of my timeformat
or
Jeff Heard wrote:
Jim, I'm actually not sure that time will report greater than 100% cpu
on ubuntu hardy. (really not sure, and don't have it available right
this moment to check). I would however try making a computation that
will take a little longer and use the system monitor or /proc
Hi, I will be a TA on a comparative PL course and I'm looking for
small examples (ammunition) which motivate the use of Haskell and
functional programming generally. The course is for 1st year Software
Engineers, none of whom are likely to have used a functional
language. They will all have
strongly-typed database access can help them.
Jim
Am 20.01.2009 um 11:07 schrieb Jim Burton:
Hi, I will be a TA on a comparative PL course and I'm looking for
small examples (ammunition) which motivate the use of Haskell and
functional programming generally. The course is for 1st year
Jim Burton wrote:
Adrian Neumann wrote:
There was a thread about that:
http://www.haskell.org/pipermail/haskell-cafe/2007-September/
031402.html
Thanks! I didn't literally mean elevator pitch and if I knew that thread
existed would have phrased my post differently, because a list
sorting a million numbers but can't find it.
Jim
Prelude let z = zipWith (+) (0:1:z) (0:z) in take 10 z
[0,1,1,2,3,5,8,13,21,34]
Try doing that in one line of C++.
See also e.g.
http://sigfpe.blogspot.com/2006/12/tying-knots-generically.html
Dan
Jim Burton wrote:
Jim Burton
At Tue, 20 Jan 2009 22:08:55 +0100,
Henning Thielemann wrote:
Jim Burton schrieb:
Well, I might but they definitely do not :-) We are talking about some
maths-averse people and you would not have got to the final syllable
of 'fibonacci' before all hope was lost. But I am sure
, 2009 at 2:07 AM, Jim Burton j...@sdf-eu.org wrote:
Hi, I will be a TA on a comparative PL course and I'm looking for
small examples (ammunition) which motivate the use of Haskell and
functional programming generally. The course is for 1st year Software
Engineers, none of whom are likely
Don Stewart-2 wrote:
[...]
Haskell was in the nice position
of already having such a process underway,
http://haskell.org/haskellwiki/Haskell_Platform
Hi Don, I'm curious -- what do the images on that page represent? Can you
link to readable versions? Thanks,
Jim
Enjoy!
At Mon, 21 Jul 2008 13:21:06 +0100,
=?ISO-8859-1?Q?Chadda=EF_Fouch=E9?= wrote:
2008/7/19 Jim Burton [EMAIL PROTECTED]:
opts = [CurlEncoding text/xml
, CurlHttpHeaders [X-EBAY-API-COMPATIBILITY-LEVEL=++compatLevel
, X-EBAY-API-DEV-NAME=++devName
I tried to translate that using the Network.Curl docs and ended up with the
following code, but it's not sending the post data correctly (an ebay
api error re an unsupported verb, which I am told means a malformed
request). Any ideas? The code from a perl tutorial (which works for
me, making me
I want to convert this code (a Hello World with the ebay API)
to the curl binding in the hope that it will handle SSL and
redirections etc better. Can someone give me some pointers please, or
a link to an example? I haven't used libcurl or Network.Curl and
can't find anything helpful...Thanks!
PR Stanley wrote:
[...]
Paul: I rest my case! :-)
you cowardly hypocrit!
Please take your own advice now, and rest your case. Like it or not (I think
most people do like it), haskell-cafe has norms of behaviour that make it
different to many pl mailing lists. Your sarky comments would
PR Stanley wrote:
PR Stanley wrote:
[...]
Paul: I rest my case! :-)
you cowardly hypocrit!
Paul: Why did you remove Jonathan Cast's message? Afraid somebody
might understand why I responded the way I did?
Please take your own advice now, and rest your case. Like it or not
Building array from cabal with ghc6.6:
~/array-0.1.0.0$ runhaskell Setup.hs configure
Configuring array-0.1.0.0...
~/array-0.1.0.0$ runhaskell Setup.hs build
Preprocessing library array-0.1.0.0...
Building array-0.1.0.0...
[ 1 of 10] Compiling Data.Array.Base ( Data/Array/Base.hs,
Hoogling (-) (=) gives
Error, your search was invalid:
Parse Error: Unexpected character '=)'
Is there a way to escape the input so it would work? (I wasn't really
expecting the right results BTW as I think hoogle searches type
signatures not patterns in definitions, right?)
Thanks,
Jim
On Thu, 2007-12-13 at 20:16 +, Neil Mitchell wrote:
Hi
Hoogling (-) (=) gives
Error, your search was invalid:
Parse Error: Unexpected character '=)'
Is there a way to escape the input so it would work? (I wasn't really
expecting the right results BTW as I think hoogle searches
I have some type-level sets using fundeps working whereby equality and
membership etc are predicate functions. This seems to leads to an explosion
of ugly code, with `If' class constraints etc getting out of hand -- I want
to treat these as relations instead so providing the definition describes
On Fri, 2007-12-07 at 12:49 -0500, Jeff Polakow wrote:
Hello,
You should be able to use fundeps to do exactly what you describe
below.
Can you make a relatively small self-contained example which
exemplifies the ugliness you see?
Hi Jeff, as well as a minor code explosion if
Thank you, that's perfect.
Jim
stefan kersten-2 wrote:
On 16.11.2007, at 13:55, Jim Burton wrote:
The docs say Should be of the form http://host:port, host,
host:port, or
http://host; but none of the variations work. Any ideas where I
might find
an example of code that does
Justin Bailey wrote:
I think it needs to be a real URL:
setProxy (Proxy http://myproxy:80; Nothing)
Justin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
The docs say
How would I go about converting the little get program at
http://darcs.haskell.org/http/test/get.hs to use a proxy server? I tried
adding a call to setProxy like this but it doesn't work:
get :: URI - IO String
get uri =
do
browse $ setProxy (Proxy myproxy:80 Nothing)
eresp -
On Sun, 2007-11-11 at 12:44 -0500, Brent Yorgey wrote:
I think you need to run autoconf autoheader (or autoreconf) first,
before running Setup configure? I could be confused, but see if that
helps. If that's what the problem is, the documentation definitely
needs updating.
-Brent
I have X11 1.2.2 installed and wanted to upgrade to 1.3 (to satisfy the
dependencies of another package), but Setup configure tells me I don't
have the headers installed. I do, and when I configure 1.2.2 they're
detected. Is this due to the newer version of Cabal? I have ghc 6.6, Cabal
1.1.6.
Animesh Sharma wrote:
[...]
Now I have to dig deeper into the release note
(http://www.haskell.org/ghc/docs/6.8.1/html/users_guide/release-6-8-1.html
), one thing which has really got me interested is the introduction of
debugger to GHCi. Any tutorials on how to go about it?
Hi Animesh,
I am trying to rewrite sentences in a logical language into DNF, and wonder
if someone would point out where I'm going wrong. My dim understanding of it
is that I need to move And and Not inwards and Or out, but the function
below fails, for example:
dnf (Or (And A B) (Or (And C D) E))
Derek Elkins wrote:
On Tue, 2007-07-31 at 23:04 -0700, Stefan O'Rear wrote:
On Wed, Aug 01, 2007 at 03:44:32PM +1000, Thomas Conway wrote:
This sounds like a common problem type. Is there a well known solution
to this sort of problem?
Mmm... logic programming?
Ronald Guida wrote:
Hi, again.
I started looking at the Euler problems [1]. I had no trouble with
problems 1 through 10, but I'm stuck on problem 11. I am aware that
the solutions are available ([2]), but I would rather not look just
yet.
[...]
FWIW I used a 2D array and a
Jim Burton wrote:
Ronald Guida wrote:
Hi, again.
I started looking at the Euler problems [1]. I had no trouble with
problems 1 through 10, but I'm stuck on problem 11. I am aware that
the solutions are available ([2]), but I would rather not look just
yet.
[...]
FWIW I
Simon Peyton-Jones wrote:
[...]
We need at least one forum in which it's acceptable to ask anything, no
matter how naive, and get polite replies. (RTFM isn't polite; but The
answer is supposed to be documented here (\url); let us know if that
doesn't answer your qn is fine.) I'd be
Jules Bean wrote:
Jim Burton wrote:
Very timely! It's sad that haskell-cafe has so much noise now.
I disagree with that characterisation. I don't mean to be pedantic, but
I don't think haskell-cafe has lots of noise. I think it has lots of
signal! Quite different.
I think you're
Donald Bruce Stewart wrote:
As we sit here riding the Haskell wave:
[...]
* Give tips on how to answer questions
Answering politely, and in detail, explaining common
misunderstandings
is better than one word replies.
* Adopt a near-zero-tolerance Be Nice
Andrew Coppin wrote:
Jim Burton wrote:
Andrew Coppin wrote:
On the one hand, it feels exciting to be around a programming language
where there are deep theoretical discoveries and new design territories
to be explored. (Compared to Haskell, the whole C / C++ / Java /
JavaScript
Andrew Coppin wrote:
Greetings.
Can somebody write a trivial (as in: small) program so I can test my CGI
stuff without having to actually install and configure Apache?
[...]
You could adapt the TCP server from this tutorial -
http://sequence.complete.org/node/258
Regards,
--
Andrew Coppin wrote:
On the one hand, it feels exciting to be around a programming language
where there are deep theoretical discoveries and new design territories
to be explored. (Compared to Haskell, the whole C / C++ / Java /
JavaScript / Delphi / VisualBasic / Perl / Python thing
If I try a function to make a point-free version of the function in this
fold --
foldr (\x ys - ys ++ map (x:) ys) [[]]
:pl gives me
GOA Control.Monad :pl (\x ys - ys ++ map (x:) ys)
ap (++) . map . (:)
GOA Control.Monad :t ap (++) . map . (:)
ap (++) . map . (:) :: (Monad ((-) [[a]])) = a
poop wrote:
So I'm working my way thorough haskell, doing some programming problems,
and I have this one so far:
Hi, I haven't spotted the problem in your code but there's an alternative
solution to Euler Problem 14 on the wiki:
Tomasz Zielonka wrote:
On Fri, Jun 15, 2007 at 11:31:36PM +0100, Jim Burton wrote:
I think that would only work if there was one column per line...I didn't
make it clear that as well as being comma separated, the delimiter is
around each column, of which there are several on a line so
Tomasz Zielonka wrote:
I guess you've tried to convince Oracle to produce the right format in
the first place, so there would be no need for post-processing...?
We don't control that job or the first db.
I wonder what would you get if you set the delimiter to be a newline ;-)
eek! ;-)
I need to remove newlines from csv files (within columns, not at the end of
entire lines). This is prior to importing into a database and was being done
at my workplace by a java class for quite a while until the files processed
got bigger and it proved to be too slow. (The files are up to ~250MB
Thomas Schilling wrote:
On 15 jun 2007, at 18.13, Jim Burton wrote:
import qualified Data.ByteString.Char8 as B
Have you tried
import qualified Data.ByteString.Lazy.Char8 as B
?
No -- I'll give it a try and compare them. Is laziness preferable here?
Thanks
Sebastian Sylvan wrote:
On 15/06/07, Jim Burton [EMAIL PROTECTED] wrote:
[snip]
Hi,
Hi Sebastian,
I haven't compiled this, but you get the general idea:
import qualified Data.ByteString.Lazy.Char8 as B
-- takes a bytestring representing the file, concats the lines
-- then splits it up
Jason Dagit wrote:
[snip]
I love to see people using Haskell, especially professionally, but I
have to wonder if the real tool for this job is sed? :-)
Jason
Maybe it is -- I've never used sed. (cue oohs and ahhs from the
gallery?) But from the (unquantified) gains so far haskell may
Sebastian Sylvan wrote:
A sorry, I thought the delimiter was a line delimiter. I'm trying to get to
that fusion goodness by using built-in functions as much as possible...
How about this one:
clean del = B.map ( B.filter (/='\n') ) . B.groupBy (\x y - (x,y) /=
(del,'\n'))
That groupBy will
Andrew Coppin wrote:
Haskell 98 does an excellent job of being extremely simple, yet almost
unbelievably powerful. Almost every day, I am blown away by how powerful
it is. I suppose it just defies belief that you could possibly need even
*more* power than is already in the
Andrew Coppin wrote:
[snip]
You're missing a lot of the conceptual background
Possibly. I find that most of what is written about Haskell tends to be
aimed at absolute beginners, or at people with multiple PhDs. (As in,
people to whom arcane terms like denotational semantics
Andrew Coppin wrote:
...
Likewise...
Oh, by the way, thanks for the extra syntax. It's really annoying having
to locate Notepad.exe on the start menu, type import Blah, save it as
Thing.hs, open Windoze Explorer, locate Thing.hs, and then
double-click it just so that I can try
Andrew Coppin wrote:
[...]
Anyway... long ramble over... Emacs isn't my operating system of choice.
I prefer to use SciTE (which is *just* a text editor - as in, it doesn't
also come with an integrated toaster and alarm clock). One SciTE window
open, one command prompt pointing at the
Adrian Neumann wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
Are there any good books about intermediate to advanced Haskell? The
descriptions here http://haskell.org/haskellwiki/Books_and_tutorials
aren't very helpful.
Adrian
I think The Fun of Programming fits
Chris Kuklewicz wrote:
[snip]
There are other modules that come with Haskell than
Text.ParserCombinators.Parsec
such as
Text.ParserCombinators.ReadP
The solution with ReadP makes for a very short 'parse' function. Note that
reader is built in a recursive manner.
module Morse where
import
I have a couple of questions about my first use of Parsec, which is trying
to read morse code symbols from a string. I have a map of symbols:
import qualified Data.Map as M
morsemap = M.fromList [('A', .-)
...
, ('Z', --..)]
a string to parse,
Dougal Stanton wrote:
This may be relevant or not, but I thought morse required a delimiting
character between letters, because otherwise the message was
ambiguous? I seem to recall somewhere that Parsec didn't handle
non-deterministic parsings very well (or at all).
D.
Jim Burton wrote:
Dougal Stanton wrote:
This may be relevant or not, but I thought morse required a delimiting
character between letters, because otherwise the message was
ambiguous? I seem to recall somewhere that Parsec didn't handle
non-deterministic parsings very well
kynn wrote:
Perl is a large, ugly, messy language filled with quirks and
eccentricities, while Haskell is an extremely elegant language whose
design is guided by a few overriding ideas. (Or so I'm told.)
[snip]
May I ask why you want to learn it so much, if you find it so hard? I'm
Dave-86 wrote:
Given the amount of material posted at haskell.org and elsewhere
explaining IO, monads and functors, has anyone considered publishing
a comprehensive book explaining those subjects? (I am trying to
read all the material online, but books are easier to read and don't
I am reading Hudak's paper Modular Domain Specific Languages and Tools
[1] and am confused by his use of the term `Partial Evaluation'. I
understand it to mean supplying some but not all arguments to a
function, e.g. (+3) but it seems to mean something else too. This is in
the context of
Bjorn Bringert-2 wrote:
Use the time package (Data.Time.*). time-1.0 is in GHC 6.6 extralibs,
and available from Hackage
(http://hackage.haskell.org/cgi-bin/hackage-scripts/package/time-1.0)
and the development version lives at
http://darcs.haskell.org/packages/time/
Thanks
It seems that CalendarTime is for dates since the epoch...what do I use to
handle dates before that? Sorry if this is an FAQ, I looked on the wiki and
tried to find MissingH since I thought it might be in there, but don't know
where to find it. I also found this from 2003 -
This code produces a stack overflow in ghci when I call `makeSpiral' with
large values, e.g. big enough to produce a 1001x1001 spiral. (makeSpiral
produces a list of lists which form a clockwise 'spiral', it's a puzzle from
mathschallenge.net.)
I'm sure there is a way to increase the stack space
Sebastian Sylvan-2 wrote:
I'm not sure I completely understand what you want, and if it needs to
be cute (i.e. some clever one liner usage of a library function).
But here's my get-the-job-done-solution (assuming I understood what
you want):
import Data.List
import Data.Ord
I'm a beginner having a go at implementing the Solitaire cipher
(http://www.rubyquiz.com/quiz1.html as mentioned in another post) and I'd be
really grateful if you could help me improve the code to be neater use
more functions from the Prelude etc, or errors (eg at the moment I can't
work out
Cybertronic wrote:
Hi all, I'm pretty much new to Haskell however I'm stuck on something
which is that I'm trying to create a function called display where I type
in a DVD name, e.g. dvd1, it returns d (String) and the multiplication of
q (Int) and i (Double)
Here's what I've done so
Chris Kuklewicz wrote:
There are several problems with the behavior:
*Main encrypt
X
*Main decrypt $ encrypt
TANZP X
So fixing this case would be the first thing to do, followed by:
*Main encrypt hello
LBVJW X
*Main decrypt $ encrypt hello
HELLO YFRTQ X
Jón Fairbairn-2 wrote:
jim burton [EMAIL PROTECTED] writes:
In addition to Chris's comments, here are some more:
[snip]
Thanks for your comments Jon. I thought about making Cards an instance of
Enum but didn't realise how helpful it would be in various places.
I will use the shorter
I want to split a string into 5 parts of equal length, with the last fifth
padded if necessary, but can't get it right - here's what I've got -
fifths :: String - String
fifths s = fifths' 0 s
where l = (length s) `div` 5
fifths' xs c [] = xs ++ (replicate (l-c) 'X')
Paul Brown-4 wrote:
Cool idea! Can you post a link for the puzzles?
Thankyou! It's http://www.rubyquiz.com - They are mostly well suited to
haskell, lot of mazes etc. I've done 5 or 6 with varying degrees of success
but have learned a lot. This thing about strings in fifths is from #1,
Mark T.B. Carroll-2 wrote:
FWIW this unholy thing works for me,
fifths :: String - String
fifths = splitIntoN 5
[snip]
Thanks Mark.
--
View this message in context:
http://www.nabble.com/split-string-into-n-parts-tf2496941.html#a6961461
Sent from the Haskell - Haskell-Cafe
Jón Fairbairn-2 wrote:
At a quick glance I can't see which bit needs it. The only
mention of five is where it asks to split the string into
groups of five characters (not into five equal parts),
padded with Xs.
Oh dear, you're right. Sorry, I read in a rush. Thanks for the solution
tweak to in_fives
in_fives l = unfoldr (splitAtMb 5)
(l ++ replicate (5 - length l `mod` 5) 'X')
--
View this message in context:
http://www.nabble.com/split-string-into-n-parts-tf2496941.html#a6961912
Sent from the Haskell - Haskell-Cafe mailing list archive at
69 matches
Mail list logo