Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-21 Thread Bas van Dijk
On Wed, Sep 22, 2010 at 3:18 AM, Mitar wrote: > What would I also like to see in Haskell is that it would be somehow > possible to see which all exceptions could your function (through used > functions there) throw. In this way it would be really possible to > make async-exception-safe functions (

Re: [Haskell-cafe] Cabal-install prefix

2010-09-21 Thread Ivan Lazar Miljenovic
On 22 September 2010 15:55, N. Raghavendra wrote: > I am new to Haskell, and am trying to install a package (scan) using > cabal-install.  I want it to install all files under the directory > ${HOME}/nonvc, like in ~/nonvc/share and ~/nonvc/bin.  So I specified > > install-dirs user >  -- prefix:

[Haskell-cafe] Cabal-install prefix

2010-09-21 Thread N. Raghavendra
I am new to Haskell, and am trying to install a package (scan) using cabal-install. I want it to install all files under the directory ${HOME}/nonvc, like in ~/nonvc/share and ~/nonvc/bin. So I specified install-dirs user -- prefix: /home/raghu/nonvc in ~/.cabal/config. But when I do `cabal

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread David Terei
I by pure coincidence was fixing a bug in some code in GHC that involved converting a Haskell float into a hex IEEE form, this is how its done in the code, just to add another way :) castDoubleToWord8Array :: STUArray s Int Double -> ST s (STUArray s Int Word8) castDoubleToWord8Array = castSTUArra

[Haskell-cafe] Re: [fp-embedded] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

2010-09-21 Thread Emil Axelsson
2010-09-21 22:32, Lee Pike skrev: Oh, one thing I should mention is that there are a few Haskell DSLs for generating embedded C now: * Atom http://hackage.haskell.org/package/atom * Feldspar http://hackage.haskell.org/package/feldspar-language * cmonad http://hackage.haskell.org/package/c

Re: [Haskell-cafe] Ultra-newbie Question

2010-09-21 Thread Christopher Tauss
Thanks Richard and the others who responded to my query. I truly appreciate you taking the time and effort to respond to me (and the community) with your thoughts. I had been reading about recursion, and was thinking only of that approach to solve this. My main reson for looking into Haskell is

[Haskell-cafe] Haskell-related job opening at Stanford University

2010-09-21 Thread David Mazieres
[Apologies to subscribers of hask...@haskell.org, where this message already appeared, but it was suggested that haskell-cafe might be a better place to reach potential applicants.] The Stanford Secure Computer Systems research group seeks an experienced Haskell programmer to participate in resear

Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-21 Thread Mitar
Hi! On Tue, Sep 21, 2010 at 11:10 PM, Simon Marlow wrote: > So rather than admitting defeat here I'd like to see it become the norm to > write async-exception-safe code. This is also what I think. You have to make your code work with exceptions, because they will come sooner or later. So if you

Re: [Haskell-cafe] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

2010-09-21 Thread Tom Hawkins
> Oh, one thing I should mention is that there are a few Haskell DSLs for > generating embedded C now: > >  * Atom http://hackage.haskell.org/package/atom >  * Feldspar http://hackage.haskell.org/package/feldspar-language >  * cmonad http://hackage.haskell.org/package/cmonad >  * Copilot http://ha

[Haskell-cafe] ANNOUNCE: http-enumerator 0.0.0

2010-09-21 Thread Michael Snoyman
Hi all, I'd like to announce the first release of http-enumerator[1], an HTTP client package with support for HTTPS connections. This release is very experimental; bug reports and API feedback are very welcome. In addition to providing built-in HTTPS support, this package also attempts to improve

[Haskell-cafe] Re: Cleaning up threads

2010-09-21 Thread Simon Marlow
On 14/09/10 19:29, Bryan O'Sullivan wrote: On Tue, Sep 14, 2010 at 11:21 AM, Edward Z. Yang mailto:ezy...@mit.edu>> wrote: Pure code can always be safely asynchronously interrupted (even code using state like the ST monad), and IO code can be made to interact correctly with thread t

[Haskell-cafe] Re: [fp-embedded] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

2010-09-21 Thread Lee Pike
>> The best reference for Copilot's constraints is this paper: >> . > > Non-Haskell programmers should note that paper has a few typos (Lee, > please correct me if I'm mistaken). Section 4.1 is where I'm at so > far and I see missing backt

[Haskell-cafe] Re: [fp-embedded] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

2010-09-21 Thread Thomas DuBuisson
> The best reference for Copilot's constraints is this paper: > . Non-Haskell programmers should note that paper has a few typos (Lee, please correct me if I'm mistaken). Section 4.1 is where I'm at so far and I see missing backticks (shou

[Haskell-cafe] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

2010-09-21 Thread Lee Pike
Oh, one thing I should mention is that there are a few Haskell DSLs for generating embedded C now: * Atom http://hackage.haskell.org/package/atom * Feldspar http://hackage.haskell.org/package/feldspar-language * cmonad http://hackage.haskell.org/package/cmonad * Copilot http://hackage.haskell

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread Daniel Fischer
On Tuesday 21 September 2010 21:35:21, John Millikin wrote: > Oh, I misunderstood the question -- you're asking about architectures > on which floating-point and fixed-point numbers use a different > endianness? Basically, I wanted to know whether there are such beasts (apparently yes) and if, wh

Re: [Haskell-cafe] asymmetric runtimes for symmetric trees

2010-09-21 Thread Daniel Fischer
On Tuesday 21 September 2010 19:45:50, Daniel Seidel wrote: > Hi, > > I've got the answer - its the sumLeafs function that behaves different > for leftPath / rightPath. If one exchanges it in the leftPath case by > > sumLeafs (Fork l r) = sumLeafs r + sumLeafs l > sumLeafs (Leaf i) = i > > th

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread John Millikin
On Tue, Sep 21, 2010 at 12:08, Daniel Fischer wrote: >> Endianness only matters when marshaling bytes into a single value -- >> Data.Binary.Get/Put handles that. Once the data is encoded as a Word, >> endianness is no longer relevant. > > I mean, take e.g. 2^62 :: Word64. If you poke that to memor

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread Daniel Fischer
On Tuesday 21 September 2010 19:46:02, John Millikin wrote: > On Tue, Sep 21, 2010 at 07:10, Daniel Fischer wrote: > > And I'd expect it to be a heck of a lot faster than the previous > > implementation. Have you done any benchmarks? > > Only very rough ones -- a few basic Criterion checks, but n

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread John Millikin
On Mon, Sep 20, 2010 at 22:11, Conrad Parker wrote: > I've been using unsafeCoerce: > > getFloat64be :: Get Double > getFloat64be = >do n <- getWord64be > return (unsafeCoerce n :: Double) > > putFloat64be :: Double -> Put > putFloat64be n = putWord64be (unsafeCoerce n :: Word64) > > but

Re: [Haskell-cafe] asymmetric runtimes for symmetric trees

2010-09-21 Thread Daniel Seidel
Hi, I've got the answer - its the sumLeafs function that behaves different for leftPath / rightPath. If one exchanges it in the leftPath case by sumLeafs (Fork l r) = sumLeafs r + sumLeafs l sumLeafs (Leaf i) = i the difference in runtime is gone. Cheers, Daniel. Am Dienstag, den 21.09.

[Haskell-cafe] asymmetric runtimes for symmetric trees

2010-09-21 Thread Daniel Seidel
Hi, I'm having a tree data type data Tree a = Leaf a | Fork (Tree a) (Tree a) , a generator for the left-most path of the tree, taking the depth leftPath :: Int -> Tree Int leftPath d | d > 1 = Fork (leftPath (d-1)) (Leaf 1) | d == 1 = (Leaf 1) | otherwise = error "Can't mak

[Haskell-cafe] ANN: Copilot 0.22 -- A stream DSL for writing embedded C.

2010-09-21 Thread Lee Pike
Announcing Copilot 0.22: Can you write a list in Haskell? Then you can write embedded C code using Copilot. Here's a Copilot program that computes the Fibonacci sequence (over Word 64s) and tests for even numbers: fib :: Streams fib = do "fib" .= [0,1] ++ var "fib" + (drop 1 $ varW64 "fib")

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread Daniel Fischer
On Tuesday 21 September 2010 07:11:24, Conrad Parker wrote: > On 21 September 2010 12:18, John Millikin wrote: > > On Mon, Sep 20, 2010 at 03:22, Daniel Fischer wrote: > >> unsafeCoerce is not supposed to work for casts between Integral and > >> Floating types. If you try to unsafeCoerce# betwee

[Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

2010-09-21 Thread oleg
Let us look at GoTo from several angles: (un)delimited continuations, exceptions and trampolines. Gregory Crosswhite wrote regarding the definition goto (ContT m) = ContT $ \_ -> m return > *HOWEVER*, if we replace main with > > main = runContT myComp (const $ putStrLn "I can't wait