Paul Johnson wrote:
For software developers who need to produce highly reliable software at
minimum cost, Haskell is a pure functional programming language that
reduces line count by 75% through reusable higher order functions and
detects latent defects with its powerful static type system.
On Wed, 2007-09-05 at 20:37 +0200, Henning Thielemann wrote:
Can someone explain me, why there are arrays with mutable but boxed
elements?
I, on the other hand, have always wondered why the strict arrays are
called unboxed, rather than, well, strict? Strictness seems to be
their observable
On Wed, 2007-09-05 at 09:54 -0700, Simon Michael wrote:
I agree actually. That picture, while very cool, won't help Haskell
marketing one bit. :)
Avoid success at all costs, remember?
Lisp's made with alien technology is much more inviting:
http://www.lisperati.com/logo.html .
True.
Hi,
Am Donnerstag, den 06.09.2007, 08:24 +0400 schrieb Max Vasin:
2007/9/5, Peter Verswyvelen [EMAIL PROTECTED]:
If so, would it be possible to integrate this into GTK2HS so it works as
a docking manager inside an application?
First of all, gtk is a cross platform toolkit and gtk2hs is just
| -- Hugs allows this. GHC rejects it on the grounds that a is unused
| -- on the right-hand side of the (=). I think this is arguably a bug
| -- in GHC.
| f3 :: (Show a, ?foo :: a) = String
| f3 = show ?foo
Hugs is right here. GHC 6.8 accepts this too, and has done for some time;
there's
G'day all.
Quoting Simon Peyton-Jones [EMAIL PROTECTED]:
| -- GHC rejects this. Hugs compiles it, but I can't call it as
| -- let ?foo = Hello in show Foo
| --
| -- Is there a good reason to disallow this?
| data Foo = Foo
|
| instance (?foo :: String) = Show Foo where
| showsPrec _ Foo =
Ketil Malde wrote:
On Wed, 2007-09-05 at 20:37 +0200, Henning Thielemann wrote:
Can someone explain me, why there are arrays with mutable but boxed
elements?
I, on the other hand, have always wondered why the strict arrays are
called unboxed, rather than, well, strict? Strictness seems to be
On 9/6/07, Simon Marlow [EMAIL PROTECTED] wrote:
Ketil Malde wrote:
I, on the other hand, have always wondered why the strict arrays are
called unboxed, rather than, well, strict? Strictness seems to be
their observable property, while unboxing is just an (admittedly
important)
On Wed, 5 Sep 2007, Thomas Hartman wrote:
I think you want something like this
{-# OPTIONS -fglasgow-exts #-}
Why glasgow-exts?
You may also want to read and extend the discussion generic number type
vs. distinct numeric types
http://www.haskell.org/haskellwiki/Generic_number_type
Hi all,
I am completely stuck with a problem involving a loop construct from
imperative programming, that I want to translate to Haskell code.
The problem goes as follows:
Based on a value u_n, I can calculate a new value u_{n+1} with a
function f(u). u_n was calculated from u_{n-1} and so on
On Wed, 5 Sep 2007, Jonathan Cast wrote:
On Wed, 2007-09-05 at 20:37 +0200, Henning Thielemann wrote:
Can someone explain me, why there are arrays with mutable but boxed
elements? I thought that boxing is only needed for lazy evaluation.
However if I access an element of an array that is the
On Thu, 6 Sep 2007, Axel Gerstenberger wrote:
module Main where
import System.IO
import Text.Printf
main :: IO ()
main = do
let all_results1 = take 2 $ step [1]
--print $ length all_results1 -- BTW: if not commented out,
-- all values of
On 06/09/07, Axel Gerstenberger [EMAIL PROTECTED] wrote:
module Main where
import System.IO
import Text.Printf
main :: IO ()
main = do
let all_results1 = take 2 $ step [1]
--print $ length all_results1 -- BTW: if not commented out,
--
Henning Thielemann wrote:
I'll see, if I understand it.
do writeArray arr 0 2
x - readArray arr 0
writeArray arr 0 (x+x)
If 'arr' is an STArray, the 'arr' will contain the unevaluated
expression 2+2 as zeroth element and with type STUArray it will
contain the evaluated 4 ?
Dougal Stanton wrote:
To create an infinite list where each f(u) depends on the previous u,
with a single seed value, use 'iterate':
main = mapM_ (uncurry (printf %d %f\n)) (zip [1..50] (iterate f 3))
How about
main = sequence_ $ zipWith (printf %d %f\n) [1..50] (iterate f 3)
Regards,
I think at some intermediate stage that flag helped me compile, but in the
final version it's unnecessary.
my bad.
Thomas Hartman [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
09/05/2007 06:29 PM
To
[EMAIL PROTECTED]
cc
[EMAIL PROTECTED], haskell-cafe@haskell.org, Tomi Owens
[EMAIL
Thanks to all of you. The suggestions work like a charm. Very nice.
I still need to digest the advices, but have already one further
question: How would I compute the new value based on the 2 (or even
more) last values instead of only the last one?
[ 2, 3 , f 3 2, f((f 3 2) 3), f ( f((f 3 2)
On Thu, Sep 06, 2007 at 06:49:21AM -0400, [EMAIL PROTECTED] wrote:
For completeness, here's the final solution, courtesy of int-e (whose
real name I don't know; sorry), which is much more elegant than I
Bertram Felgenhauer
bindString :: (forall s. StringAsType s = Mark s a) - String - a
Axel Gerstenberger wrote:
Thanks to all of you. The suggestions work like a charm. Very nice.
I still need to digest the advices, but have already one further
question: How would I compute the new value based on the 2 (or even
more) last values instead of only the last one?
[ 2, 3 , f 3 2,
On 06/09/07, Axel Gerstenberger [EMAIL PROTECTED] wrote:
Thanks to all of you. The suggestions work like a charm. Very nice.
I still need to digest the advices, but have already one further
question: How would I compute the new value based on the 2 (or even
more) last values instead of only
On 06/09/07, Axel Gerstenberger [EMAIL PROTECTED] wrote:
however,I don't get it this to work. Is it possible to see the
definition of the iterate function? The online help just shows it's usage...
The Haskell 98 report includes source for the standard prelude. Check 'em out...
[EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in
gmane.comp.lang.haskell.cafe:
That higher-rank type makes all the difference.
Yes. You can even do this portably, using nothing unsafe, with Dylan
Thurston's technique:
Oleg Kiselyov and Chung-chieh Shan. 2004. Functional pearl: Implicit
When you get to more than two arguments, it will probably be nicer to
do something like this:
fibs = map (\(a,b) - a) $ iterate (\(a,b) - (b, a+b)) (0,1)
or
fibs = unfoldr (\(a,b) - Just (a, (b, a+b))) (0,1) -- this uses
unfoldr to get rid of the map
This is essentially a translation of the
On 06/09/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
foo = 2 : 3 : zipWith f (drop 1 foo) foo
There's also zipWith3 etc. for functions with more arguments.
I think this is called taking a good thing too far, but cool too:
f1 u = u + 1
f2 u v = u + v
f3 u v w = u + v + w
-- functions
On Thu, 6 Sep 2007, Axel Gerstenberger wrote:
Thanks to all of you. The suggestions work like a charm. Very nice.
I still need to digest the advices, but have already one further question:
How would I compute the new value based on the 2 (or even more) last values
instead of only the last
I wish to learn Haskell. I purchased a book - An Introduction to Functional
Programming Systems Using Haskell but I think this might be too outdated.
I'm using GHC and it seems that some of the functions used in the book are
no longer a part of Haskell. I'm looking for advice on books or
No, that book is not outdated. Can you give an example of what's not
working for you?
On 9/6/07, Chris Saunders [EMAIL PROTECTED] wrote:
I wish to learn Haskell. I purchased a book – An Introduction to Functional
Programming Systems Using Haskell but I think this might be too outdated.
On 9/6/07, Dougal Stanton [EMAIL PROTECTED] wrote:
On 06/09/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
[2,3,4,9,16,29,54,99,182,335] -- what's this?
Two times this: http://www.research.att.com/~njas/sequences/A000213
plus this: http://www.research.att.com/~njas/sequences/A001590
plus two
Ketil Malde wrote:
On Wed, 2007-09-05 at 20:37 +0200, Henning Thielemann wrote:
Can someone explain me, why there are arrays with mutable but boxed
elements?
I, on the other hand, have always wondered why the strict arrays are
called unboxed, rather than, well, strict? Strictness seems to be
Hello Isaac,
Thursday, September 6, 2007, 9:41:34 PM, you wrote:
Unboxing is, unfortunately, observable: it is not so easy to make a
strict array of SomeArbitraryAlgebraicDataType, because it's not in
class Storable.
parallel arrays in GHC is just about it
--
Best regards,
Bulat
On 9/6/07, Chris Saunders [EMAIL PROTECTED] wrote:
So far I'm finding Haskell difficult – I may be too thick.
Once upon a time there was a young man who wanted to be a race car driver.
He bought an old, junky car with a souped-up engine (after all, that's what
all his friends were using). It
Perhaps your (admittedly young) colleague had other reasons to inquire...
It turns out that (in the US at least) the lambda symbol is one of the
symbols of gay pride since the 1970's:
http://en.wikipedia.org/wiki/LGBT_symbol#Lambda
If you google lambda gay you will find many more
Because you can play very clever tricks with DFS to make it efficient, time
and space.
On 9/5/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
On Wed, Sep 05, 2007 at 01:21:52PM +1000, Thomas Conway wrote:
but to interpret this as a *program* you have to consider how it will
be executed. In
On Thu, Sep 06, 2007 at 03:42:50PM +0200, apfelmus wrote:
Dougal Stanton wrote:
To create an infinite list where each f(u) depends on the previous u,
with a single seed value, use 'iterate':
main = mapM_ (uncurry (printf %d %f\n)) (zip [1..50] (iterate f 3))
How about
main = sequence_ $
Thanks Martin, that really helped.
After many days reading the source, I'm still trying to grok HAppS.
Meanwhile, here is a patch that adds examples to HAppS/Examples/HTTP1.hs
for combining state and io, based on your advice.
see especiallly the handler stateioH accepts an arbitrary state
On 9/5/07, Max Vasin [EMAIL PROTECTED] wrote:
2007/9/5, Peter Verswyvelen [EMAIL PROTECTED]:
Looks really nice, but if I understand it correctly it is specific for
X, so does not work on Windows?
This kind of programs is impossible in Windows. Of cause you can use X
server for Windows and
Don't bang your head against a wall too long. Like Brent said,
#haskell is quite a good resource. There's always (and I mean ALWAYS)
a group of people online at any given time that can answer your
questions.
On 9/6/07, Chris Saunders [EMAIL PROTECTED] wrote:
Thanks to all that responded (I
I'm writing a tokeniser for a legacy programming language in Haskell.
I started with the obvious
main = getContents = print . tokenise
where tokenise maps its way down a list of characters. This is very
simple, very pleasant, and worked like a charm.
However, the language has an INCLUDE
Hi,
I'm after some help understanding either what I'm doing wrong, or why this error
occurs.
I have a data type:
data T a = forall b. (Show b) = T b a
and I want to use/extract 'b' from this.
extShow (T b _) = b
This gives the following compilation error:
extest.hs:5:0:
Inferred
Levi Stephen:
I have a data type:
data T a = forall b. (Show b) = T b a
and I want to use/extract 'b' from this.
You can't. (Well, I believe you can if you have prior knowledge of the
actual type of the existentially wrapped b, and you're willing to use
an unsafe coerce, but I've never
On 9/7/07, Levi Stephen [EMAIL PROTECTED] wrote:
I'm after some help understanding either what I'm doing wrong, or why this
error
occurs.
I have a data type:
data T a = forall b. (Show b) = T b a
I should first point out that by mentioning b only on the RHS, you've
defined an
Thanks to all that responded (I enjoyed very much the story). From the
response below I think my thickness is showing too much and I'll try a little
harder on my own first.
Thanks again,
Chris Saunders
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
2007/9/7, Dan Piponi [EMAIL PROTECTED]:
That depends on your definition of this kind.
I meant window manager. I.e. a porgram which manages window size,
placement, focus, decorations, etc.
http://en.wikipedia.org/wiki/LiteStep
This is a shell (a replacement for explorer), not a window manager.
43 matches
Mail list logo