[Haskell-cafe] Big endian vs little endian in Haskell land?

2009-01-21 Thread Galchin, Vasili
Hello, Are there applications that have to deal with both(!!!) big endian and little endian on persistent store?? I.e. when marshalling out and unmarshalling in "endian-ness" has to be considered?? Regards, Vasili ___ Haskell-Cafe mailing list H

Re: [Haskell-cafe] Why monoids will abide...

2009-01-21 Thread Eugene Kirpichov
To my mind, in the map-reduce case you generally need a commutative monoid. Or, you need an extra infrastructure that mappend's only results from adjacent machines, or something like that. 2009/1/21 Dan Piponi : > Another important application of monoids is in parallelisation. In > map-reduce you

[Haskell-cafe] Re: tensor product of dynamic-sized bits

2009-01-21 Thread Ahn, Ki Yung
Ahn, Ki Yung 쓴 글: > >> reduce (Bs (x:xs)) | all (x==) xs = x >> reduce (Rep x@(Rep _)) = x >> reduce x = x I already found a bug. The second equation of reduce "reduce (Rep x@(Rep _)) = x" is wrong because it flattens two dimensions into one. The reduce function should be: > re

Re: [Haskell-cafe] how to implement daemon start and stop directives?

2009-01-21 Thread Luke Palmer
On Wed, Jan 21, 2009 at 11:36 PM, Belka wrote: > > Hi! > > Could somebody please share some experience on how to implement daemon > start > and stop directives. In theory I need something like this: > 1. "my_daemon start" - starts my app with an infinite loop of serving > inside. > 2. "my_daemon s

[Haskell-cafe] how to implement daemon start and stop directives?

2009-01-21 Thread Belka
Hi! Could somebody please share some experience on how to implement daemon start and stop directives. In theory I need something like this: 1. "my_daemon start" - starts my app with an infinite loop of serving inside. 2. "my_daemon stop" - puts in some TVar a value signalizing, that stop is given

[Haskell-cafe] tensor product of dynamic-sized bits

2009-01-21 Thread Ahn, Ki Yung
For some reasons, I am trying to write a small Haskell code for tensor products (See http://en.wikipedia.org/wiki/Tensor_product) of bits, which can expand or shrink their size and dimension as needed. Has anyone already done similar or more general work before? If so, I'd be happy use/consult tha

Re: [Haskell-cafe] 1000 libraries

2009-01-21 Thread wirtwolff
Don Stewart wrote: We've done it! http://hackage.haskell.org/cgi-bin/hackage-scripts/stats 274 users have uploaded 3161 versions of 1000 packages. Now, onto 10k libraries! -- Don What about the 1024th package? That should be properly honored as well. ;-) -- ww __

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-21 Thread Richard O'Keefe
On 20 Jan 2009, at 8:33 am, Andrew Coppin wrote: rocon...@theorem.ca wrote: I noticed the Bool datatype isn't well documented. Since Bool is not a common English word, I figured it could use some haddock to help clarify it for newcomers. My only problem with it is that it's called Bool,

Re: [Haskell-cafe] GLUT (glutGet undefined reference)

2009-01-21 Thread Kazuya Sakakihara
Check this thread: http://groups.google.com/group/fa.haskell/browse_thread/thread/1716fa5e5643541e/38373ec65e2537fd?lnk=gst Kazuya 2009/1/20 Paul Keir : > Hi all, > > I was hoping to introduce my old pal OpenGL > with my new chum, Haskell. I used cabal to > install GLUT on my 64-bit Ubuntu machin

Re: [Haskell-cafe] Re: Does readFile "/proc/mounts" hang for you?

2009-01-21 Thread Thomas DuBuisson
Strace tells me that its doing some crazy IO control: """ ... open("/proc/mounts", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x77470b70) = -1 ENOTTY (Inappropriate ioctl for device) select(4, [3], [], NULL, {0

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread Lennart Augustsson
You're too late, they already have guru status. :) On Wed, Jan 21, 2009 at 11:09 PM, Andrzej Jaworski wrote: > Let me also suggest to bestow the official guru status on Dan Piponi and > Heinrich Apfelmus:-) ___ Haskell-Cafe mailing list Haskell-Cafe@ha

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread Andrzej Jaworski
Category Theory should speak for itself and I am so glad you guys have seen the beauty of this approach. Yes, Mauro you are right: locally small Freyd categories correspond to monoidal structure of Arrows, but the strength in this correspondence is as yet unknown to me. I disagree however with

Re: [Haskell-cafe] Re: Does readFile "/proc/mounts" hang for you?

2009-01-21 Thread Krzysztof Skrzętnicki
Same for me: Linux tenserwer 2.6.28-ARCH #1 SMP PREEMPT Tue Jan 6 10:26:22 UTC 2009 i686 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux The Glorious Glasgow Haskell Compilation System, version 6.10.1 All best Christopher Skrzętnicki On Wed, Jan 21, 2009 at 23:27, Ertugrul Soeylemez wr

Re: [Haskell-cafe] Applicative/Monad for Either

2009-01-21 Thread Ryan Ingram
I think it's possible, but not in a very clean way. First lets look at ap: > ap mf mx = do > f <- mf > x <- mx > return (f x) equivalently, desugared: > ap mf mx = mf >>= \f -> mx >>= \x -> return (f x) So, it's possible to make a definition of >>= where "ap" works as you like: >Z (

[Haskell-cafe] Re: Does readFile "/proc/mounts" hang for you?

2009-01-21 Thread Ertugrul Soeylemez
David Fox wrote: > I posted a bug about this > (http://hackage.haskell.org/trac/ghc/ticket/2971) but its so odd I had > to ask here. Using ghc 6.10.1, both readFile "/proc/mounts" and > Data.ByteString.Lazy.Char8.readFile "/proc/mounts" hang on an amd64 > machine running Linux. Also, Data.ByteS

Re: [Haskell-cafe] Applicative/Monad for Either

2009-01-21 Thread Daniel Fischer
Am Mittwoch, 21. Januar 2009 23:03 schrieb Tony Morris: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > In the code below, the Applicative instance accumulates on the Left > constructor using Monoid/mappend. > Is it possible to write an equivalent Monad such that ap = (<*>) ? I'm > finding di

[Haskell-cafe] Applicative/Monad for Either

2009-01-21 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In the code below, the Applicative instance accumulates on the Left constructor using Monoid/mappend. Is it possible to write an equivalent Monad such that ap = (<*>) ? I'm finding difficulty in proving to myself either way. import Control.Monad.In

Re: [Haskell-cafe] Haddock bug for strict unpacked fields?

2009-01-21 Thread Johan Tibell
On Wed, Jan 21, 2009 at 8:54 PM, David Waern wrote: > Perhaps we should not display unbox annotations at all since they are > an implementation detail, right? We could display one "!" instead, > indicating that the argument is strict. Yes. I think that's enough. Cheers, Johan __

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-21 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonathan Cast wrote: | I think you meant to quote the definition | | data SomeNum = forall a. SN a Quite so. Thanks for clearing that up. - - Jake -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - ht

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-21 Thread Jonathan Cast
On Wed, 2009-01-21 at 13:38 -0600, Jake McArthur wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Gleb Alexeyev wrote: > | Mauricio wrote: > | > |> data SomeNum = SN (forall a. a) > | > | [...] > | > | you cannot do anything to the value you extract > > Maybe. Say you construct (SN x)

Re: [Haskell-cafe] Haddock bug for strict unpacked fields?

2009-01-21 Thread David Waern
2009/1/21 Stephan Friedrichs : > Hi, > > using haddock-2.4.1 and this file: > >> module Test where >> >> data Test >> = NonStrict Int >> | Strict !Int >> | UnpackedStrict {-# UNPACK #-} !Int > > The generated documentation looks like this: > > data Test > Constructors > NonStrict Int >

[Haskell-cafe] Re: 1000 libraries

2009-01-21 Thread Ahn, Ki Yung
Don Stewart wrote: We've done it! Thanks for the good news. Maybe it's already getting more important organizing existing uesful set of libraries as mata-packages. Are there updates on haskell-platform? ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-21 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gleb Alexeyev wrote: | Mauricio wrote: | |> data SomeNum = SN (forall a. a) | | [...] | | you cannot do anything to the value you extract Maybe. Say you construct (SN x). If you later extract x, you can observe that it terminates (using seq, perhaps)

Re: [Haskell-cafe] haskell-src-meta Package

2009-01-21 Thread Matt Morrow
Hi, I managed to miss not one, but two separate emails containing patches to haskell-src meta. My sincere apologies to those who've sent me patches. I'll be applying them among other improvement to src-meta and will update the package on hackage in short time (today :). Matt _

[Haskell-cafe] (no subject)

2009-01-21 Thread Matt Morrow
Hi, I managed to miss not one, but two separate emails containing patches to haskell-src meta. My sincere apologies to those who've sent me patches. I'll be applying them among other improvement to src-meta and will update the package on hackage in short time (today :). Matt _

[Haskell-cafe] 1000 libraries

2009-01-21 Thread Don Stewart
We've done it! http://hackage.haskell.org/cgi-bin/hackage-scripts/stats 274 users have uploaded 3161 versions of 1000 packages. Thanks everyone who has written a library or tool or app and released it, for making hackage and cabal a success! This has gone further, perhaps more than anything els

[Haskell-cafe] Haddock bug for strict unpacked fields?

2009-01-21 Thread Stephan Friedrichs
Hi, using haddock-2.4.1 and this file: > module Test where > > data Test > = NonStrict Int > | Strict !Int > | UnpackedStrict {-# UNPACK #-} !Int The generated documentation looks like this: data Test Constructors NonStrict Int Strict !Int UnpackedStrict !!Int Note the double

[Haskell-cafe] haskell-src-meta Package

2009-01-21 Thread George Giorgidze
Hi, In my project I needed a function that would parse a string into a template-haskell AST representing the Haskell expression. To be more precise I needed a function with the following type signature. :: String -> Either String Language.Haskell.TH.Syntax.Exp This kind of function should exist

Re: [Haskell-cafe] Why monoids will abide...

2009-01-21 Thread Dan Piponi
Another important application of monoids is in parallelisation. In map-reduce you want to split the reduce part over multiple processors and combine the results back together again. Associativity ensures that when you combine the pieces together you get the same result as if you did the whole opera

[Haskell-cafe] Does readFile "/proc/mounts" hang for you?

2009-01-21 Thread David Fox
I posted a bug about this (http://hackage.haskell.org/trac/ghc/ticket/2971) but its so odd I had to ask here. Using ghc 6.10.1, both readFile "/proc/mounts" and Data.ByteString.Lazy.Char8.readFile "/proc/mounts" hang on an amd64 machine running Linux. Also, Data.ByteString.readFile "/proc/mounts"

Re: [Haskell-cafe] Quite confused by simple transformations on this code not working

2009-01-21 Thread Svein Ove Aas
Or if the specificity of (/\) is important to you, you could define f at the global scope using that type, not export it, then declare (/\) as equal to f but with a more restrictive type. On Wed, Jan 21, 2009 at 5:45 AM, Alexander Dunlap wrote: > Instead of declaring (/\) :: Eq a => Sentence a ->

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread Mauro J. Jaskelioff
Andrzej Jaworski wrote: > Monads are monoids in categories of functors C -> C Arrows are monoids > in subcategories of bifunctors (C^op) x C -> C Trees are a playing > ground for functors in general:-) > This is the nice thing about category theory! plenty of reuse of concepts :) The situation f

Re: [Haskell-cafe] Re: Type family problem

2009-01-21 Thread Manuel M T Chakravarty
Gleb Alexeyev: Sjoerd Visscher wrote: When I try this bit of code: > class C1 a where > type F a :: * > x :: F a > y :: F a > x = y I get this error: Couldn't match expected type `F a1' against inferred type `F a' In the expression: y In the definition of `x': x = y I can't figu

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread David Leimbach
Oh indeed! On Wed, Jan 21, 2009 at 8:00 AM, Eugene Kirpichov wrote: > No, I mean monads :) I've never thought of them as of monoids in the > endofunctor category. > > 2009/1/21 David Leimbach : > > You mean monoids right? :-) > > > > On Wed, Jan 21, 2009 at 1:30 AM, Eugene Kirpichov > > wrote:

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread Eugene Kirpichov
No, I mean monads :) I've never thought of them as of monoids in the endofunctor category. 2009/1/21 David Leimbach : > You mean monoids right? :-) > > On Wed, Jan 21, 2009 at 1:30 AM, Eugene Kirpichov > wrote: >> >> Wow. This is a cool point of view on monads, thank you for >> enlightening (the

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread David Leimbach
You mean monoids right? :-) On Wed, Jan 21, 2009 at 1:30 AM, Eugene Kirpichov wrote: > Wow. This is a cool point of view on monads, thank you for > enlightening (the arrow stuff is yet too difficult for me to > understand)! > > 2009/1/21 Andrzej Jaworski : > > Monads are monoids in categories of

Re: [Haskell-cafe] Re: ANN: HTTPbis / HTTP-4000.x package available

2009-01-21 Thread Lennart Augustsson
Yeah, the .pac files are a major pain. :( On Wed, Jan 21, 2009 at 3:32 PM, ChrisK wrote: > Duncan Coutts wrote: >> >> Proxy auto-configuration files are JavaScript. It uses more or less the >> full JavaScript language (ECMA these days), though with a small subset >> of the standard library. > > W

[Haskell-cafe] Re: ANN: HTTPbis / HTTP-4000.x package available

2009-01-21 Thread ChrisK
Duncan Coutts wrote: Proxy auto-configuration files are JavaScript. It uses more or less the full JavaScript language (ECMA these days), though with a small subset of the standard library. W T F So we want a tiny naive javascript interpreter, hopefully in pure Haskell. The dumbest interprete

[Haskell-cafe] Re: Type family problem

2009-01-21 Thread Gleb Alexeyev
Sjoerd Visscher wrote: When I try this bit of code: > class C1 a where > type F a :: * > x :: F a > y :: F a > x = y I get this error: Couldn't match expected type `F a1' against inferred type `F a' In the expression: y In the definition of `x': x = y I can't figure o

[Haskell-cafe] Re: Pure Haskell implementation of Float type?

2009-01-21 Thread Ertugrul Soeylemez
"Tim Chevalier" wrote: > Is there a pure Haskell implementation of Floats, i.e., one that > (unlike GHC.Float) doesn't use foreign calls for things like > isFloatNegativeZero? I don't care about performance; I'm just looking > for something that doesn't use foreign calls. You can easily do it yo

Re: [Haskell-cafe] Re: Why monoids will abide...

2009-01-21 Thread Eugene Kirpichov
Wow. This is a cool point of view on monads, thank you for enlightening (the arrow stuff is yet too difficult for me to understand)! 2009/1/21 Andrzej Jaworski : > Monads are monoids in categories of functors C -> C Arrows are monoids in > subcategories of bifunctors (C^op) x C -> C Trees are a p

Re: [Haskell-cafe] Re: How to make code least strict?

2009-01-21 Thread Thomas Davie
Further to all the playing with unamb to get some very cool behaviors, you might want to look at Olaf Chitil's paper here: http://www.cs.kent.ac.uk/pubs/2006/2477/index.html It outlines a tool for checking if your programs are as non-strict as they can be. Bob On 21 Jan 2009, at 02:08, Co

Re: [Haskell-cafe] Employment

2009-01-21 Thread Lionel Barret De Nazaris
That fits with our experience (gamr7). We got 20 applicants, all of them very good. L. Paul Johnson wrote: Tom Hawkins wrote: Such a database would help me counter by boss's argument that "it's impossible to find and hire Haskell programmers." There was a thread last week where someone ask

Re: [Haskell-cafe] Type families are awesome

2009-01-21 Thread Luke Palmer
2009/1/21 John Ky > > *Main> let x = lookup > *Main> let y = Fx.Data.Map.lookup > > :1:8: > Ambiguous type variable `ma' in the constraint: > `Fx.Data.Map.MapType ma' > arising from a use of `Fx.Data.Map.lookup' at :1:8-25 > Probable fix: add a type signature that fixes these

[Haskell-cafe] Type families are awesome

2009-01-21 Thread John Ky
Hi Haskell Cafe, I'm finding that I really like type families. For instance, the GHC.List.lookup and Data.Map.lookup functions annoy me because their names clash, yet their type are so similar. With type families, I could define a more generic lookup function like this: import Data.Map as MAP i