Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Artyom Kazak
Oops. Ben Gamari bgamari.f...@gmail.com писал(а) в своём письме Tue, 04 Jun 2013 04:41:53 +0300: To be perfectly clear, ByteString and Text target much different use-cases and are hardly interchangeable. While ByteString is, as the name suggests, a string of bytes, Text is a string of

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Peter Simons
Hi Clark, How is this a problem? If you're representing text, use 'text'. If you're representing a string of bytes, use 'bytestring'. If you want an array of values, think c++ and use 'vector'. the problem is that all those packages implement the exact same data type from scratch,

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Tom Ellis
On Tue, Jun 04, 2013 at 04:01:37PM +0200, Peter Simons wrote: How is this a problem? If you're representing text, use 'text'. If you're representing a string of bytes, use 'bytestring'. If you want an array of values, think c++ and use 'vector'. the problem is that all those

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread silvio
Just to clarify for those on the sidelines, the issue is duplication of implementation details, rather than duplication of functionality? Well to me, that is not the main issue. The main issue is that you have to study all of them and depending on which libraries you want to use have to

[Haskell-cafe] Frankfurt Haskell User Group meets 19.6.13, topics: Netwire, Hackathon planning

2013-06-04 Thread Peter Althainz
Dear All, all interested Haskellers are inivted to our Meetup on 19.6.13: http://www.meetup.com/Frankfurt-Haskell-User-Group/events/122879122/. Best regards Peter Althainz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Carter Schonwald
I really don't understand this concern. These libraries are tuned for wildly different workloads and use cases, so these sorts of micro benchmarks are an Apples to Frogs comparisons. (even aside from the fact that you'll get very different perf if you used -fllvm and set things up so the array

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Mike Ledger
On 05/06/13 02:49, silvio wrote: Just to clarify for those on the sidelines, the issue is duplication of implementation details, rather than duplication of functionality? Well to me, that is not the main issue. The main issue is that you have to study all of them and depending on which

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread silvio
array does provide folding functions, found in its Foldable and Traversable instances. Where can I find this? I can neither in the array package nor with google nor with hoogle. Silvio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Mike Ledger
On 05/06/13 07:01, silvio wrote: array does provide folding functions, found in its Foldable and Traversable instances. Where can I find this? I can neither in the array package nor with google nor with hoogle. Silvio ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread silvio
These libraries are tuned for wildly different workloads and use cases, so these sorts of micro benchmarks are an Apples to Frogs comparisons. You can argue that for any benchmark, but sometimes the choice is between Apples and Frogs. If you have some more extensive benchmarks I'm happy to

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Peter Simons
Hi Tom, On Tue, Jun 04, 2013 at 04:01:37PM +0200, Peter Simons wrote: How is this a problem? If you're representing text, use 'text'. If you're representing a string of bytes, use 'bytestring'. If you want an array of values, think c++ and use 'vector'. the problem is

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Tom Ellis
On Tue, Jun 04, 2013 at 11:23:16PM +0200, Peter Simons wrote: On Tue, Jun 04, 2013 at 04:01:37PM +0200, Peter Simons wrote: If you're representing text, use 'text'. If you're representing a string of bytes, use 'bytestring'. If you want an array of values, think c++ and use

Re: [Haskell-cafe] Typeable typeclass and type-level naturals

2013-06-04 Thread TP
Roman Cheplyaka wrote: Try adding deriving instance Typeable 'Zero deriving instance Typeable a = Typeable ('Succ a) to your module. (I haven't tested it — you might need to tweak it a bit.) Thanks Roman. Unfortunately, I already tried that (without the constraint Typeable a =,

[Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread silly8888
I was wondering today, why hasn't hsc2hs been merged with ghc so that it would be possible to add a {-# LANGUAGE ForeignFunctionInterface #-} at the top of a source file and then load it with ghci or compile it, without the intermediate step of calling hsc2hs? This would be exactly like the CPP

Re: [Haskell-cafe] How to write a pure String to String function in Haskell FFI to C++

2013-06-04 Thread adam vogt
On Sun, Jun 2, 2013 at 10:19 PM, Ting Lei tin...@gmail.com wrote: Thanks for your answers so far. It seems that the laziness of String or [char] is the problem. My question boils then down to this. There are plenty of Haskell FFI examples where simple things like sin/cos in math.h can be

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread Ivan Lazar Miljenovic
On 5 June 2013 12:02, silly silly8...@gmail.com wrote: I was wondering today, why hasn't hsc2hs been merged with ghc so that it would be possible to add a {-# LANGUAGE ForeignFunctionInterface #-} at the top of a source file and then load it with ghci or compile it, without the

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread silly8888
On Tue, Jun 4, 2013 at 10:15 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Isn't this done automatically when you have files with the .hsc extension? No, it is not. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread John Lato
On Wed, Jun 5, 2013 at 10:15 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 5 June 2013 12:02, silly silly8...@gmail.com wrote: I was wondering today, why hasn't hsc2hs been merged with ghc so that it would be possible to add a {-# LANGUAGE ForeignFunctionInterface

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread Jason Dagit
On Tue, Jun 4, 2013 at 8:45 PM, John Lato jwl...@gmail.com wrote: On Wed, Jun 5, 2013 at 10:15 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 5 June 2013 12:02, silly silly8...@gmail.com wrote: I was wondering today, why hasn't hsc2hs been merged with ghc so that it

Re: [Haskell-cafe] Int is broken [Was: Different answers on different machines]

2013-06-04 Thread Richard A. O'Keefe
On 4/06/2013, at 4:22 PM, Rustom Mody wrote: On Tue, Jun 4, 2013 at 7:35 AM, Richard A. O'Keefe o...@cs.otago.ac.nz wrote: On 3/06/2013, at 6:58 PM, Carter Schonwald wrote: If the Int type had either of these semantics by default, many many performance sensitive libraries would

Re: [Haskell-cafe] Why isn't hsc2hs functionality provided by ghc?

2013-06-04 Thread John Lato
cabal-dev ghci does work with hsc2hs, but only because it doesn't interpret your source. Rather, cabal-dev ghci loads ghci using the sandbox install of your package, which is less useful for a variety of reasons. Aside from that detail, I wouldn't gain any benefit from having this feature built