Thanks both for the the explanation and the link. The wikibook is really
growing fast!
Abhay
On Wed, May 7, 2008 at 5:05 PM, apfelmus [EMAIL PROTECTED] wrote:
Abhay Parvate wrote:
Just for curiocity, is there a practically useful computation that uses
'seq' in an essential manner, i.e.
On 7 May 2008, at 19:56, Andrew Coppin wrote:
Wouter Swierstra wrote:
Please consider writing something for the next issue of The
Monad.Reader.
You know, I'm actually tempted to do just that...
Please do! We've had lots of excellent articles written by people who
were just learning
Hi,
Personnaly, I started to learn Haskell with A Gentle Introduction and
(from what I recall) really enjoyed it.
I find The Haskell School of Expression a bit problematic because it
interleaves information about the language with (although nice) large
running-through-all-the-chapter examples.
Hi Mads,
Not only pictures, but also code can say more than a thousands words.
Therefore, I have been implementing a proof of concept. The code is
attached in two files.
Nice! I have to admit, it's much nicer than I expected it to be. Just
out of curiousity, what happens when you write:
Thanks for this list.
On Thu, May 8, 2008 at 12:29 PM, Benjamin L. Russell [EMAIL PROTECTED]
wrote:
One hint that is not (at least to my knowledge) listed on haskell.org is
that, according to at least one user (see The Programmers' Stone » Blog
Archive » A First Haskell Experience at
Hello,
I am just learning Haskell. Now, I encountered something that I cannot solve
by myself. Your advice will be greatly appreciated.
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified number shall stay within certain
Madoc wrote:
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified number shall stay within certain
bounds, given by the integers minValue and maxValue. After that, I want to
continue computation with the resulting list of type
On Wed, May 7, 2008 at 6:28 AM, patrik osgnach [EMAIL PROTECTED]
wrote:
Daniel Fischer ha scritto:
Am Dienstag, 6. Mai 2008 22:40 schrieb patrik osgnach:
Brent Yorgey ha scritto:
On Tue, May 6, 2008 at 8:20 AM, patrik osgnach
[EMAIL PROTECTED]
wrote:
Hi. I'm learning haskell but i'm
On Wed, May 7, 2008 at 8:01 PM, PR Stanley [EMAIL PROTECTED] wrote:
So, when you apply the function to the first element in the set - e.g. Zero
or Nil in the case of lists - you're actually testing to see the function
works. Then in the inductive step you base everything on the assumption that
Madoc wrote:
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified number shall stay within certain
bounds, given by the integers minValue and maxValue. After that, I want to
continue computation with the resulting list of type
2008/5/8 Thomas Dinsdale-Young [EMAIL PROTECTED]:
Madoc wrote:
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified number shall stay within certain
bounds, given by the integers minValue and maxValue. After that, I want to
David Waern wrote:
2008/5/2 Claus Reinke [EMAIL PROTECTED]:
2008/5/2 Simon Marlow [EMAIL PROTECTED]:
David Waern wrote:
No it doesn't, but it's on the TODO list. It needs a fix in GHC.
By the way, I'm going to experiment with doing the parsing of comments
on the Haddock side instead of in
On Thu, 8 May 2008, Madoc wrote:
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified number shall stay within certain
bounds, given by the integers minValue and maxValue. After that, I want to
continue computation with the
Hey,
I am studying Haskell as a unit at University. I find the concept and design
idea's of Haskell interesting but I am finding my self struggling to
understand the relationship between the normal state and IO state of
Haskell. This is my situation:
I have created 12 functions for a program
On Thu, 8 May 2008, Mark Wallsgrove wrote:
Problem now is reading the data back into the program. When I read the data
back into the program it comes as IO [Track]. This is the code I have been
using to load the data:
loadData :: String - Catalogue
loadData fileName = do x - readFile
Thank you very much for your fast response!
Ok, that is now changed, but everything else in my program is expecting
Catalogue without IO. Is there a way to change IO Catalogue into Catalogue?
Henning Thielemann wrote:
On Thu, 8 May 2008, Mark Wallsgrove wrote:
Problem now is reading the
Am Donnerstag, 8. Mai 2008 14:59 schrieb Mark Wallsgrove:
Thank you very much for your fast response!
Ok, that is now changed, but everything else in my program is expecting
Catalogue without IO. Is there a way to change IO Catalogue into Catalogue?
Not a recommendable way. But there's no
Hi I have a bit of a dilemma.I have a list of lists, eg,
[[1,2,3],[4,5,6],[7,8,9]]. Imagine they represent a grid with 0-2 on the x axis
and 0-2 on the y axis, eg, (0,0) is 1, (1,0) is 2, (2,1) is 6, etc and (2,3) is
9. I want to be able to put in the list of lists, and the (x,y) coordinate,
2008/5/8 Madoc [EMAIL PROTECTED]:
Hello,
I am just learning Haskell. Now, I encountered something that I cannot
solve by myself. Your advice will be greatly appreciated.
Given a list of numbers, I want to modify each of those numbers by adding a
random offset. However, each such modified
On Thu, 8 May 2008, Mark Wallsgrove wrote:
Thank you very much for your fast response!
Ok, that is now changed, but everything else in my program is expecting
Catalogue without IO. Is there a way to change IO Catalogue into Catalogue?
Yes, but you do not want that. You will go on writing
Am Donnerstag, 8. Mai 2008 15:36 schrieb [EMAIL PROTECTED]:
Hi I have a bit of a dilemma.I have a list of lists, eg,
[[1,2,3],[4,5,6],[7,8,9]]. Imagine they represent a grid with 0-2 on the x
axis and 0-2 on the y axis, eg, (0,0) is 1, (1,0) is 2, (2,1) is 6, etc and
(2,3) is 9. I want to be
[EMAIL PROTECTED] wrote:
Hi I have a bit of a dilemma.I have a list of lists, eg,
[[1,2,3],[4,5,6],[7,8,9]]. Imagine they represent a grid with 0-2 on
the x axis and 0-2 on the y axis, eg, (0,0) is 1, (1,0) is 2, (2,1)
is 6, etc and (2,3) is 9. I want to be able to put in the list of
lists,
On Thu, 8 May 2008, Mark Wallsgrove wrote:
Thank you very much for your fast response!
Ok, that is now changed, but everything else in my program is expecting
Catalogue without IO. Is there a way to change IO Catalogue into Catalogue?
Btw. there was a nice article precisely about the issue
Thanks for helping me! Your fast and accurate responses helped me to solve
this issue. I am not so angry at IO any more. You showed me more than one
way in which I can solve the problem.
In addition, the answers to the other thread IO Help helped me too. It
seems that Mr. Wallsgrove had a very
Was there? I have been google'ing that problem for ages..
Just one more thing. I have to make a menu system where the user chooses
what functionality they want. Because you cannot change a value once it
is set I have used recursion so that when something changes it then
calls the menu back
On 8 May 2008, at 16:31, Mark Wallsgrove wrote:
Was there? I have been google'ing that problem for ages..
Just one more thing. I have to make a menu system where the user
chooses what functionality they want. Because you cannot change a
value once it is set I have used recursion so that
Thank you all for your help, you have been invaluable
Thomas Davie wrote:
On 8 May 2008, at 16:31, Mark Wallsgrove wrote:
Was there? I have been google'ing that problem for ages..
Just one more thing. I have to make a menu system where the user
chooses what functionality they want. Because
On Thu, May 8, 2008 at 2:59 AM, Benjamin L. Russell
[EMAIL PROTECTED] wrote:
* Kees Doets and Jan van Eijck: The Haskell Road to Logic, Maths and
Programming,
As someone approaching haskell with very rusty math skills, this book
has been invaluable. My haskell skills are (mostly) beyond what
Hi Wouter,
Wouter Swierstra wrote:
Nice! I have to admit, it's much nicer than I expected it to be. Just
out of curiousity, what happens when you write:
selectTupleList :: Connection - IO [Integer]
instead of
selectTupleList :: Connection - IO [(Integer, String, String)]
What
Don Stewart dons at galois.com writes:
[interesting quote...]
Which I think really captures the joy of being able to write algebraic
and data structure transformations, via rewrite rules, without having to
extend the compiler -- all thanks to purity, laziness, and static
typing.
This makes me
2008/5/8 Simon Marlow [EMAIL PROTECTED]:
So basically you want to run a lexer over the source again to collect all
the comments?
Yes.
You really want to use GHC's lexer, because otherwise you
have to write another lexer.
I don't mind writing a lexer that just collects the comments. It
Chad Scherrer [EMAIL PROTECTED] wrote:
Don Stewart dons at galois.com writes:
[Stuff where I totally agree]
Now, I don't know much about lisp, but aren't code transformations
like this the whole point of macros? What makes is difficult to do
the same thing in this context?
Proof of
Achim Schneider wrote:
Some years or decades ahead, perhaps Haskell will not be able to avoid
being successful anymore, and that is the time where you'll see things
that look like Java, feel like Java, work like Java, but still use a
Haskell RTS.
I'm told they're calling it F#...
[No, I
Chad Scherrer wrote:
PS - the link now gives a 500 server error - did our traffic overwhelm it? Is
the cafe the next slashdot? ;)
Hell, I can't even get a TCP SYN-ACK packet out of it... :-/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Henning Thielemann wrote:
On Thu, 8 May 2008, Madoc wrote:
minValue = 0::Int
maxValue = 1000::Int
normalize a | a minValue = minValue
| a maxValue = maxValue
| otherwise = a
normalize' = min maxValue . max minValue
There is a curiosity here. The functions
Hello,
I pasted a copy of the article below for those that cannot access the site.
I would be interested to see an article on Haskell in the same light as this
Ocaml article, aka a constructive criticism of Haskell.
Enjoy!
__
Donnie
### Begin Article ###
Why Ocaml
CALL FOR PAPERS
Workshop on Generic Programming 2008
Victoria, Canada, 20th September 2008
http://www.comlab.ox.ac.uk/ralf.hinze/wgp2008/cfp.{html,pdf,ps,txt}
The Workshop on Generic Programming is sponsored by
Wouter Swierstra wrote:
On 7 May 2008, at 19:56, Andrew Coppin wrote:
Wouter Swierstra wrote:
Please consider writing something for the next issue of The
Monad.Reader.
You know, I'm actually tempted to do just that...
Please do! We've had lots of excellent articles written by people who
Hello Wei,
Thursday, May 8, 2008, 11:10:08 PM, you wrote:
test :: a - Int - a
shift is defined as a - Int - a
not exactly ;) this type signature is given inside class Bits, where
'a' isn't a free variable (as in standalone signature declaration),
but means 'a' from type class header:
class
Op Thursday 08 May 2008 21:10:08 schreef Wei Yuan Cai:
shift is defined as a - Int - a
It's not. It's defined as (Bits a) = a - Int - a or something along those
lines. So there is a restriction that the type a must be a member of the Bits
typeclass.
Because test is essentially just shift, its
Ambrish Bhargava bhargava.ambrish at gmail.com writes:
Hi All,I am new to Haskell. Can anyone guide me how can I start on it (Like
getting binaries, some tutorials)?Thanks in advance.-- Regards,Ambrish Bhargava
Ambrish,
When I started learning Haskell I had no previous exposure to functional
Bjorn Buckwalter bjorn.buckwalter at gmail.com writes:
I found the Gentle Introduction... mentioned elsewhere in this thread to be
not-so-gentle as described on the tutorials wiki page. I'd avoid it unless
you're already comfortable with functional programming.
Let me modify that statement.
Without reading through every issue ever published, do you have any
specific examples of this that I [or anybody else in cafe] could
take a look at?
The following two articles spring to mind:
* Kenneth Hoste wrote a gtk2hs tutorial, after having just started
using it:
2008/5/8 Donnie Jones [EMAIL PROTECTED]:
I would be interested to see an article on Haskell in the same light as this
Ocaml article, aka a constructive criticism of Haskell.
http://www.drmaciver.com/2008/02/tell-us-why-your-language-sucks/
--
Darrin
andrewcoppin:
Wouter Swierstra wrote:
On 7 May 2008, at 19:56, Andrew Coppin wrote:
Wouter Swierstra wrote:
Please consider writing something for the next issue of The
Monad.Reader.
You know, I'm actually tempted to do just that...
Please do! We've had lots of excellent articles
Don Stewart wrote:
You should read through every issue ever published though -- there's a
lot of interesting lessons in TMR for the practical Haskeller.
That would be entertaining sometime, but how many issues have ac... oh,
wait... this is issue 11? Hmm, I hadn't realised that this
Speaking of old Monad.Reader issues... the wiki says,
Issues 2 through 5 http://www.haskell.org/tmrwiki/ can be found on the
special tmrwiki – they haven't been included here for licensing reasons. I
hope to move over most of the content soon.
Any chance of those issues being moved over still?
You've got the right idea.
Paul: At long last! :-)
I should point out that it doesn't make sense to say p(Succ n) =
Succ(p(n)), p(x) represents some statement that is either true or
false, so it doesn't make sense to say Succ(p(n)). .
Paul: okay, da capo: We prove/test
Hi,
I'm in the process of writing a C program, but I can't stop thinking
about how some functions would be much nicer implemented in Haskell.
Is there a way to write some of the functions in Haskell and then use
them in my C code via some kind of interface?
BTW yes, I have been thinking
Am Freitag, 9. Mai 2008 00:04 schrieb PR Stanley:
You've got the right idea.
Paul: At long last! :-)
I should point out that it doesn't make sense to say p(Succ n) =
Succ(p(n)), p(x) represents some statement that is either true or
false, so it doesn't make sense to say
Philip Müller [EMAIL PROTECTED] wrote:
Is there a way to write some of the functions in Haskell and then use
them in my C code via some kind of interface?
The beast you are looking for is called the FFI: Foreign Function
Interface.
C doesn't make IO any easier, though. More verbose and
Hi,
How can I know whether something will be stack or heap allocated? For
example, in the standard example of why
foldl (+) 0
will fail to evaluate a long list of integers due to a stack overflow,
but foldl' won't, it is pointed out that foldl starts building up
unevaluated thunks. So,
Hello Philip,
Friday, May 9, 2008, 2:17:41 AM, you wrote:
Is there a way to write some of the functions in Haskell and then use
them in my C code via some kind of interface?
http://haskell.org/haskellwiki/IO_inside#Interfacing_with_foreign_evil_.28under_development.29
and then entries 1,6,7
mail:
Is there a way to write some of the functions in Haskell and then use
them in my C code via some kind of interface?
Using C just for IO is a bit weird -- perhaps you could illustrate
the kind of IO you're doing? Learning how to do IO in Haskell is
a much safer solution that linking the
On Thu, 2008-05-08 at 23:29 +0100, Edsko de Vries wrote:
Hi,
How can I know whether something will be stack or heap allocated? For
example, in the standard example of why
foldl (+) 0
will fail to evaluate a long list of integers due to a stack overflow,
but foldl' won't, it is pointed
Thanks for all the answers. I'm testing this right now and simples cases
work as expected. However from what I've read it seems it'll get ugly
once I try to pass a C array to a Haskell function.
Well, maybe arrays in C have been ugly before trying to pass them to
Haskell functions ;)
To
On 5/8/08, Daniel Fischer [EMAIL PROTECTED] wrote:
No. In the induction step, we prove that
IF p(j) holds, THEN p(j+1) holds, too.
p(j) is the assumption, and we prove that *given that assumption*, p(j+1)
follows.
Then we have proved
(*) p(j) implies p(j+1), for all j.
To formalize this,
mail:
Thanks for all the answers. I'm testing this right now and simples
cases work as expected. However from what I've read it seems it'll
get ugly once I try to pass a C array to a Haskell function.
Right, passing arrays back and forth is going to get tiring.
Well, maybe arrays in C
Edsko de Vries wrote:
sum :: Tree - Int
sum t = sum' [t] 0
where
sum' [] acc = acc
sum' (Leaf i : ts) acc = sum' ts $! (i + acc)
sum' (Node l r : ts) acc = sum' (l : r : ts) acc
Because of $!, you should compare the Leaf case to foldl', not foldl.
The Node case can be said to
Hello Philip,
Friday, May 9, 2008, 3:09:33 AM, you wrote:
Thanks for all the answers. I'm testing this right now and simples cases
work as expected. However from what I've read it seems it'll get ugly
once I try to pass a C array to a Haskell function.
| An interesting critique of OCaml.
|
| http://enfranchisedmind.com/blog/2008/05/07/why-ocaml-sucks/
Interesting to me is that my pet ocaml peeve is not there: namely the
lack of convenient operator overloading. Admittedly I only used ocaml
for 6 months, but I never adapted to needing to write
Actually, it's (+) for ints and (+.) for floats. Which kind of proves your
point.
Mike
Tim Docker wrote:
| An interesting critique of OCaml.
|
| http://enfranchisedmind.com/blog/2008/05/07/why-ocaml-sucks/
Interesting to me is that my pet ocaml peeve is not there: namely the
lack of
62 matches
Mail list logo