[Haskell-cafe] getLine and ^C on Windows

2008-11-12 Thread Lyle Kopnicky
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 cmd

Re: [Haskell-cafe] Linker errors to OpenGL with GHC 6.10.1

2008-11-12 Thread Pekka Karjalainen
2008/11/13 Greg Fitzgerald <[EMAIL PROTECTED]>: > Do you know how I can fix these linker errors? > > C:\projects\fun>cat HelloWorld.hs > > import Graphics.Rendering.OpenGL > import Graphics.UI.GLUT > main = do > (progname, _) <- getArgsAndInitialize > createWindow "Hello World" > displayCallb

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Ryan Ingram
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: > > http://www.nobugs.org/blog/ar

[Haskell-cafe] Linker errors to OpenGL with GHC 6.10.1

2008-11-12 Thread Greg Fitzgerald
Do you know how I can fix these linker errors? C:\projects\fun>cat HelloWorld.hs import Graphics.Rendering.OpenGL import Graphics.UI.GLUT main = do (progname, _) <- getArgsAndInitialize createWindow "Hello World" displayCallback $= clear [ColorBuffer] mainLoop C:\projects\fun>ls lib GlU3

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread ajb
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

[Haskell-cafe] HOpenGL shading problem

2008-11-12 Thread Trin
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 lig

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Lennart Augustsson
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
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 >>=

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Dan Doel
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 b

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Derek Elkins
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
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: > >>

[Haskell-cafe] ANNOUNCE: hpapi 0.1 release

2008-11-12 Thread Michael D. Adams
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 What is it ==

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread David MacIver
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 >> >> <[EMAI

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread David MacIver
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 wi

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Don Stewart
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jonathan Cast
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 > ostensibl

Re: [Haskell-cafe] GHC 6.10, strange behaviour when profiling?

2008-11-12 Thread Aleš Bizjak
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

Re: [Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Lyle Kopnicky
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread 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 depending on their evaluati

Re: [Haskell-cafe] Re: What *not* to use Haskell for

2008-11-12 Thread Malcolm Wallace
"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 g

Re: [Haskell-cafe] Turning all the Nothings into Just defaultValue using Data.Generics

2008-11-12 Thread Jeremy Shaw
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 cont

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Don Stewart
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 e

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Andrew Birkett
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 int

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Tom Hawkins
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 sched

Re: [Haskell-cafe] Interactive

2008-11-12 Thread Thomas DuBuisson
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...

Re: [Haskell-cafe] Interactive

2008-11-12 Thread Philippa Cowderoy
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

[Haskell-cafe] Interactive

2008-11-12 Thread Andrew Coppin
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 Haskel

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Andrew Coppin
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Ryan Ingram
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 >

[Haskell-cafe] Re: What *not* to use Haskell for

2008-11-12 Thread Stefan Monnier
> 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 y

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Lennart Augustsson
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 the

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Benja Fallenstein
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 t

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Jonathan Cast
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?" > >

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Don Stewart
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Ryan Ingram
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 progra

Re: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread wren ng thornton
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 is

Re: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Ryan Ingram
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

Re: [Haskell-cafe] abstract extensible types?

2008-11-12 Thread Ryan Ingram
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 from

Re: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Derek Elkins
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

Re: [Haskell-cafe] Hackage web interface

2008-11-12 Thread Ross Paterson
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 > b

[Haskell-cafe] Turning all the Nothings into Just defaultValue using Data.Generics

2008-11-12 Thread David Fox
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. Test.hs:2

Re: [Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Philip Weaver
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 <- g

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Martin Sulzmann
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, Philip

Re: [Haskell-cafe] abstract extensible types?

2008-11-12 Thread Brandon S. Allbery KF8NH
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 them

[Haskell-cafe] Hackage web interface

2008-11-12 Thread Hugo Pacheco
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 -- www.di.uminho.pt/~hpa

[Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Lyle Kopnicky
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 = timeOfDayToTi

Re: [Haskell-cafe] problem with boolean splicing in templates in ghc 6.10.1

2008-11-12 Thread Ian Lynagh
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Lennart Augustsson
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 hav

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Martin Sulzmann
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 inference/c

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jake Mcarthur
-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, usin

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Arnar Birgisson
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Thomas Davie
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 th

RE: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Mitchell, Neil
> 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 __

RE: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Mitchell, Neil
> 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 t

RE: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Mitchell, Neil
> 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 n

RE: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Paul Keir
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

RE: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Paul Keir
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

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Reinier Lamers
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

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Lennart Augustsson
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 Haske

Re: [Haskell-cafe] Proposal for associated type synonyms in Template Haskell

2008-11-12 Thread Thomas van Noort
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 fam

Re: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Tom Nielsen
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) <-

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Luke Palmer
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 a

[Haskell-cafe] Re: reliable (bi)directional pipe to a process

2008-11-12 Thread Simon Marlow
[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 ano

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Malcolm Wallace
"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 boots

[Haskell-cafe] abstract extensible types?

2008-11-12 Thread Alberto G. Corona
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 s

Re: [Haskell-cafe] Calling Haskell from other languages?

2008-11-12 Thread Dave Tapley
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 a

RE: [Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Mitchell, Neil
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 fun

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Jules Bean
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 a

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Janis Voigtlaender
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 a

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Edsko de Vries
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 refer

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Thomas Davie
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 t

[Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Andrew Birkett
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 pr

[Haskell-cafe] Searching for ADT patterns with elem and find

2008-11-12 Thread Paul Keir
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

Re: [Haskell-cafe] ByteString/parsec

2008-11-12 Thread Ketil Malde
"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

[Haskell-cafe] Re: reliable (bi)directional pipe to a process

2008-11-12 Thread Johannes Waldmann
> 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 Haskell-Cafe@h

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-12 Thread Ketil Malde
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