Don Stewart [EMAIL PROTECTED] writes:
Data.ByteString is full of mutation-heavy inner loops.
I suspect you are missing Kyle's point, which I interpret to be more
like what Paul Graham talks about in ANSI Common Lisp:
[OO] provides a structured way to write spaghetti code. [...] For
http://okmij.org/ftp/Haskell/MySysOpen.hs
when I run the test case in the file, the first read_back gets until
count=9890,
then hangs (I don't see Doing it again) (CPU is idle) (with ghc-6.10.1)
___
Haskell-Cafe mailing list
Pieter Laeremans [EMAIL PROTECTED] writes:
Are there any good examples of open source projects which parse
ByteString data ?
Don't know about good, but here are some working examples that may
or may not be useful to you. Pointers are inside the darcs repo, you
can of course 'darcs get
Hi,
Is a formal proof that the Haskell language is referentially
transparent? Many people state haskell is RT without backing up that
claim. I know that, in practice, I can't write any counter-examples but
that's a bit handy-wavy. Is there a formal proof that, for all possible
haskell
Anatoly Yakovenko [EMAIL PROTECTED] wrote:
Has there been any progress in getting ghc set up for porting to non
x86/unix/windows platforms? Can it generate ropi code? It would also
be nice to be able to compile to C that rvct/arm tools can compile in
thumb mode.
AFAIK, you can bootstrap
Thanks Tom,
That is indeed a very elegant solution; I too often forget about the wonders of
list comprehension.
I guess one drawback compared to Neil's suggested use of any (and staying
with a separate isTypeB) is that your solution will iterate over the entire
list, regardless of an early
Hi Reinier,
On Wed, Nov 12, 2008 at 14:22, Reinier Lamers [EMAIL PROTECTED] wrote:
Also, in my experience Haskell is not so good at data structures where
you can't do structural recursion easily, like graphs. In such cases
you want a language with easy pointers and destructive updates. You
Lennart Augustsson wrote:
You can't write a straightforward dynamic semantics (in, say,
denotational style) for Haskell.
The problem is that with type classes you need to know the types
compute the values.
You could use a two step approach: first make a static semantics that
does type
On Tue, Nov 11, 2008 at 02:16:21PM -0600, Leonidas Fegaras wrote:
Seems that boolean splicing in haskell templates in ghc 6.10.1 does not
work correctly. If you do:
$((\b - [| b |]) True)
you get the error:
Can't find interface-file declaration for data constructor GHC.Base.True
I guess one drawback compared to Neil's suggested use of any (and
staying with a separate isTypeB) is that your solution will iterate
over the entire list, regardless of an early hit.
Nope, it will stop on the first one - Haskell is lazy like that :-)
Thanks, Neil
2008/11/11 Dave Tapley [EMAIL PROTECTED]:
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
Let's say something controversial: I think that Haskell's type system
gets in your way when
Hi folks,
I had some code using the oldtime package, and want to convert it to use the
time package.
One of the things I need to do is calculate the number of seconds since
midnight. The easy part is getting a TimeDiff result:
utc - getCurrentTime
tz - getCurrentTimeZone
let td =
Hi,
When previewing some package via the Hackage web interface, I get the
following warning:
Exposed modules use unallocated top-level names: AI assume that if you
define some module A.B, it expects the top-level name A to be a module.
Does this make sense?
Thanks,
hugo
--
On 2008 Nov 12, at 5:38, Alberto G. Corona wrote:
Is there any abstract container that permits the addition of new
types of data? I know how to simulate the extension of Algebraic
datatypes, but this does not permit the addition of data with new
types in the same container and recover
It's possible that there's some more direct approach that
represents types as some kind of runtime values, but nobody
(to my knowledge) has done that.
It don't think its possible - I tried it and failed.
Consider:
show (f [])
Where f has the semantics of id, but has either the return
containsTypeB ts = not $ null [x | (B x) - ts]
No need for the brackets on the left of the -:
not $ null [x | B x - ts]
findBs ts = [b | b@(B _) - ts]
or
findBs ts = [B x | (B x) - ts]
both of them compile but the first is ugly and the second is
inefficient (Tags a new T for
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Nov 12, 2008, at 7:09 AM, Lennart Augustsson wrote:
It's possible that there's some more direct approach that represents
types as some kind of runtime values, but nobody (to my knowledge) has
done that.
I think JHC passes types at runtime,
Hi Pedro,
You are right, it is a partial implementation. We chose not to propose
an implementation for associated datatypes and type families because it
is unknown if there is a demand for it.
But I don't think coming up with the TH AST modifications for associated
type synonyms and type
Andrew Birkett wrote:
Hi,
Is a formal proof that the Haskell language is referentially
transparent? Many people state haskell is RT without backing up that
claim. I know that, in practice, I can't write any counter-examples but
that's a bit handy-wavy. Is there a formal proof that, for
Hi Paul,
maybe False (\x - True) (find isTypeB ts)
This can be more neatly expressed as:
isJust (find isTypeB ts)
But your entire thing can be expressed as:
containsTypeB ts = any isTypeB ts
I recommend reading through the Prelude interface and the List
interface, it has many useful
Hi Colin
As an alternative you may consider using Thrift:
http://incubator.apache.org/thrift/
Cheers,
Dave
On Tue, 2008-11-11 at 16:45 +, Colin Paul Adams wrote:
Is there a way to call Haskell code from other languages? I have looked on
the wiki, and as far as I can see, it only talks
Hi All,
If I have an ADT, say
data T
= A String Integer
| B Double
| C
deriving(Eq)
and I want to find if a list (ts) of type T contains an element of subtype B
Double, must my containsTypeX function use a second isTypeX function as
follows:
isTypeB :: T - Bool
isTypeB (B _) = True
Correct Lennart. The below mentioned papers assume some
evidence translation of type class programs. If you need/want
a direct semantics/translation of programs you'll need to
impose some restrictions on the set of allowable type class programs.
For such an approach see
Martin Odersky,
2008/11/12 Lyle Kopnicky [EMAIL PROTECTED]
Hi folks,
I had some code using the oldtime package, and want to convert it to use
the time package.
One of the things I need to do is calculate the number of seconds since
midnight. The easy part is getting a TimeDiff result:
utc -
I want to use Data.Generics to write a function to turn all the Nothings in
a data structure into Just defaultValue, as shown below. I get the
following error because the compiler doesn't know enough about Maybe a for
mkT to create the generic function that everywhere requires, I guess.
I had a quick look at Stuckey and Sulzmann, A Theory of Overloading
and it looks to me like the semantics is given by evidence
translation. So first you do evidence translation, and then give
semantics to the translated program. So this looks like the two step
approach I first mentioned.
Or have
Andrew Birkett wrote:
Hi,
Is a formal proof that the Haskell language is referentially
transparent? Many people state haskell is RT without backing up that
claim. I know that, in practice, I can't write any counter-examples but
that's a bit handy-wavy. Is there a formal proof that, for
See What is a purely functional language by Sabry. Not quite a
formal proof about *Haskell*, but then we would first need a formal
semantics of Haskell to be able to do that proof ;-)
On 12 Nov 2008, at 10:11, Andrew Birkett wrote:
Hi,
Is a formal proof that the Haskell language is
On Wed, Nov 12, 2008 at 04:14:48PM +, Hugo Pacheco wrote:
When previewing some package via the Hackage web interface, I get the
following
warning:
Exposed modules use unallocated top-level names: A
I assume that if you define some module A.B, it expects the top-level name A
to
be a
On 12 Nov 2008, at 11:11, Andrew Birkett wrote:
Hi,
Is a formal proof that the Haskell language is referentially
transparent? Many people state haskell is RT without backing up
that claim. I know that, in practice, I can't write any counter-
examples but that's a bit handy-wavy. Is
[EMAIL PROTECTED] wrote:
I'd like to point out a reliable, proven and simple way of interacting
with another process, via unidirectional or bidirectional pipes. The
method supports Unix sockets, pipes, and TCP sockets.
I too have noticed insidious bugs in GHC run-time when communicating
with
Thanks Neil,
Great. I hadn't noticed isJust, and I'd forgotten any. Actually I was
browsing Prelude just the other day and picked up zipWith f as bs as a
replacement for map f $ zip as bs.
Cheers, Paul
-Original Message-
From: Mitchell, Neil [mailto:[EMAIL PROTECTED]
Sent: Wed
somebody pointed out a few months back that list comprehensions do this nicely:
containsTypeB ts = not $ null [x | (B x) - ts]
no need for defining isTypeB.
not quite sure how you would write findBs :: [T]-[T] succinctly; maybe
findBs ts = [b | b@(B _) - ts]
or
findBs ts = [B x | (B x) -
On Wed, Nov 12, 2008 at 10:20 AM, Derek Elkins [EMAIL PROTECTED] wrote:
In addition to what others have said, I recommend using functions like
isTypeB :: T - Maybe Double
isTypeB (B d) = Just d
isTypeB _ = Nothing
You can recover the Bool version of isTypeB just by post-composing with
Paul Keir wrote:
Hi All,
If I have an ADT, say
data T
= A String Integer
| B Double
| C
deriving(Eq)
and I want to find if a list (ts) of type T contains an element of subtype B Double, must my
containsTypeX function use a second isTypeX function as follows:
isTypeB :: T - Bool
isTypeB
On a totally non-theory side, Haskell isn't referentially transparent.
In particular, any code that calls unsafePerformIO or
unsafeInterleaveIO is not necessarily RT. Given that getContents and
interact use unsafeInterleaveIO, this includes most toy programs as
well as almost every non-toy
tux_rocker:
2008/11/11 Dave Tapley [EMAIL PROTECTED]:
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
Let's say something controversial: I think that Haskell's type system
gets
On Wed, 2008-11-12 at 10:50 -0800, Don Stewart wrote:
tux_rocker:
2008/11/11 Dave Tapley [EMAIL PROTECTED]:
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
Let's say
http://www.cs.nott.ac.uk/~wss/Publications/DataTypesALaCarte.pdf
This lets you create sets of types to store in a container, with the
static guarantee that only members of the set of types are included.
The types can contain other elements of the set within them
recursively.
To extract value
On Wed, Nov 12, 2008 at 3:21 AM, Jules Bean [EMAIL PROTECTED] wrote:
Andrew Birkett wrote:
Hi,
Is a formal proof that the Haskell language is referentially transparent?
Many people state haskell is RT without backing up that claim. I know
that, in practice, I can't write any
Hi all,
On Wed, Nov 12, 2008 at 2:09 PM, Lennart Augustsson
[EMAIL PROTECTED]wrote:
You can't write a straightforward dynamic semantics (in, say,
denotational style) for Haskell.
The problem is that with type classes you need to know the types
compute the values.
...
It's possible that
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Since you are talking to the outside world any behaviour is acceptable.
All the weird interactions between getContents and writing the same
file from the same program could, in principle, happen if a different
program wrote
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
The most obvious cases where Haskell does not do well, for me:
- When you feed it Java code. Incidentally, the same holds when you
On 12 Nov 2008, at 14:47, Mitchell, Neil wrote:
It's possible that there's some more direct approach that
represents types as some kind of runtime values, but nobody
(to my knowledge) has done that.
It don't think its possible - I tried it and failed.
Consider:
show (f [])
Where f has
On Wed, 2008-11-12 at 10:09 +, Paul Keir wrote:
Hi All,
If I have an ADT, say
data T
= A String Integer
| B Double
| C
deriving(Eq)
and I want to find if a list (ts) of type T contains an element of
subtype B Double, must my containsTypeX function use a second
isTypeX
On Wed, Nov 12, 2008 at 12:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Since you are talking to the outside world any behaviour is acceptable.
All the weird interactions between getContents and writing the same
file
Dave Tapley wrote:
Hi everyone
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
Usually I'll avoid then question and explain that it is a 'complete'
language and we do have more than
On Wed, 12 Nov 2008, Andrew Coppin wrote:
I have a small question...
Given that interactivity is Really Hard to do in Haskell, and that mutable
state is to be strongly avoided, how come Frag exists? (I.e., how did they
successfully solve these problems?)
Because the givens are bull :-)
Here are the links that hold the information you desire:
http://www.haskell.org/haskellwiki/Frag
http://www.cse.unsw.edu.au/~pls/thesis/munc-thesis.pdf
In short: FRP
http://www.haskell.org/frp/
On Wed, Nov 12, 2008 at 1:52 PM, Andrew Coppin
[EMAIL PROTECTED]wrote:
I have a small question...
You can't write a straightforward dynamic semantics (in, say,
denotational style) for Haskell.
The problem is that with type classes you need to know the types
compute the values.
You could use a two step approach: first make a static semantics that
does type inference/checking and translates
On Tue, Nov 11, 2008 at 5:18 AM, Jules Bean [EMAIL PROTECTED] wrote:
Dave Tapley wrote:
Hi everyone
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
GHC's scheduler lacks any hard
Edsko de Vries wrote:
See What is a purely functional language by Sabry. Not quite a formal
proof about *Haskell*, but then we would first need a formal semantics
of Haskell to be able to do that proof ;-)
Thanks for the reference, and also to everyone who replied - all very
useful and
andrewcoppin:
So I should clarify I'm not a troll and do see the Haskell light. But
one thing I can never answer when preaching to others is what does
Haskell not do well?
Usually I'll avoid then question and explain that it is a 'complete'
language and we do have more than enough libraries
Is there any abstract container that permits the addition of new types of
data? I know how to simulate the extension of Algebraic datatypes, but this
does not permit the addition of data with new types in the same container
and recover them in a type-safe way.
Did I reinvent the Weel? I found
Hello,
I can *almost* do it like this:
test = (id `ext1T` justDefault) (defaultValue :: A)
justDefault :: forall f. (Default f, Data f) = Maybe f - Maybe f
justDefault Nothing = defaultValue
justDefault (Just x) = Just x
Except it fails with:
Could not deduce (Default d1) from the
what does Haskell not do well?
- When you feed it Java code. Incidentally, the same holds when you
feed it C code.
I've heard that Haskell's new (developed in this year's GSoC)
Language.C libraries were able to parse millions of lines of C code
from the Linux kernel, including many
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Really? It seems easy to create things with it which when passed to
ostensibly pure functions yield different results depending on their
evaluation
Thanks Philip and Roger,
I think I'll use...
floor $ toRational td
...although I could have sworn that didn't work last night. I don't see that
TimeDiff has an instance of RealFrac, where floor is defined, though it does
have a instances of Real and Fractional.
Yes, the numeric classes are a
I have a small question...
Given that interactivity is Really Hard to do in Haskell, and that
mutable state is to be strongly avoided, how come Frag exists? (I.e.,
how did they successfully solve these problems?)
___
Haskell-Cafe mailing list
Compiled with ghc-6.10.1.20081112 it runs approximately as it did with
ghc-6.8.3 so the
problem seems to be fixed.
Thank you for your help.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Wed, 2008-11-12 at 22:16 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Really? It seems easy to create things with it which when passed to
ostensibly pure
david.maciver:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Really? It seems easy to create things with it which when passed to
ostensibly pure functions yield different results
On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote:
david.maciver:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of view.
Really? It seems easy to create things with it which
On Wed, 2008-11-12 at 23:02 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote:
david.maciver:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of
On Wed, Nov 12, 2008 at 11:05 PM, Jonathan Cast
[EMAIL PROTECTED] wrote:
On Wed, 2008-11-12 at 23:02 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote:
david.maciver:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED]
I am pleased to announce the first release of hpapi, Performance API
(PAPI) bindings for Haskell.
The release is on Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hpapi
The source repository is at:
http://code.haskell.org/hpapi/
Please send bug reports to adamsmd [AT]
On Wed, 2008-11-12 at 23:18 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 11:05 PM, Jonathan Cast
[EMAIL PROTECTED] wrote:
On Wed, 2008-11-12 at 23:02 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote:
david.maciver:
On Wed, Nov 12,
On Wed, 2008-11-12 at 23:02 +, David MacIver wrote:
On Wed, Nov 12, 2008 at 10:46 PM, Don Stewart [EMAIL PROTECTED] wrote:
david.maciver:
On Wed, Nov 12, 2008 at 8:35 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
Actually, unsafeInterleaveIO is perfectly fine from a RT point of
On Wednesday 12 November 2008 6:18:38 pm David MacIver wrote:
To put it a different way, in the absence of unsafeInterleaveIO the IO
monad has the property that if f and g are observably equal up to
termination then x = f and x = g are equivalent in the IO monad
(actually this may not be true
On Wed, 2008-11-12 at 18:47 -0500, Dan Doel wrote:
On Wednesday 12 November 2008 6:18:38 pm David MacIver wrote:
To put it a different way, in the absence of unsafeInterleaveIO the IO
monad has the property that if f and g are observably equal up to
termination then x = f and x = g are
But how can you tell something being causal or not?
Assuming that all IO operations return random result, of course. :)
From a practical point of view unsafeInterleaveIO can give suspect results.
But theoretically you can't fault it until you have given a semantics
for the IO monad operations so
Hi,
last few days I spent making remake of glxgears. Nothing
fancy, I just wanted easily configurable gears. The current
performance is only about 70% of glxgears.
But I have a problem with shading. Whatever I have been trying,
I still don't understand how the shading can be activated. I have
G'day all.
Quoting Tom Hawkins [EMAIL PROTECTED]:
Actually, Haskell is an excellent language for hard real-time
applications. At Eaton we're using it for automotive powertrain
control. Of course, the RTS is not running in the loop. Instead, we
write in a DSL, which generates C code for our
Do you know how I can fix these linker errors?
C:\projects\funcat HelloWorld.hs
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
main = do
(progname, _) - getArgsAndInitialize
createWindow Hello World
displayCallback $= clear [ColorBuffer]
mainLoop
C:\projects\funls lib
Interesting posts. Thanks!
On Wed, Nov 12, 2008 at 2:02 PM, Andrew Birkett [EMAIL PROTECTED] wrote:
Thanks for the reference, and also to everyone who replied - all very
useful and interesting. For what it's worth, the blog posts I was writing
are here:
2008/11/13 Greg Fitzgerald [EMAIL PROTECTED]:
Do you know how I can fix these linker errors?
C:\projects\funcat HelloWorld.hs
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
main = do
(progname, _) - getArgsAndInitialize
createWindow Hello World
displayCallback $= clear
Hi folks,
I'm using System.IO.getLine to read input in my program. I've compiled it on
Windows Vista with ghc-6.10.1. I've noticed that if I press Ctrl+C while the
program is waiting for input, it will get stuck. No keypresses can get me
out of the program - I have to kill the shell. I've tried
77 matches
Mail list logo