Re: [Haskell-cafe] install-dirs on Mac OS X

2009-12-22 Thread Duncan Coutts
On Mon, 2009-12-21 at 22:55 -0800, Mark Lentczner wrote: I have been thinking about the location of installed Haskell package files on Mac OS X. The choice of location affects: [..] Thoughts? I'd be happy to help by supplying patches for various tools to normalize all this on some agreed

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Kim-Ee Yeoh
Here's another way of writing it: data Matrix a = Matr {unMatr :: [[a]]} | Scalar a deriving (Show, Eq) -- RealFrac constraint removed reMatr :: RealFrac a = ([[a]] - [[a]]) - (Matrix a - Matrix a) reMatr f = Matr . f . unMatr -- this idiom occurs a lot, esp. with newtypes Affixing

[Haskell-cafe] Re: install-dirs on Mac OS X

2009-12-22 Thread Heinrich Apfelmus
Mark Lentczner wrote: I have been thinking about the location of installed Haskell package files on Mac OS X. The choice of location affects: GHC other Haskell implementations Haskell Platform Cabal cabal-install Haddock If all those agreed on directory locations and layouts, I think the

Re: [Haskell-cafe] How can i set the seed random number generator ?

2009-12-22 Thread Scott Turner
On Monday 21 December 2009 20:37:30 zaxis wrote: In erlang, first i use the following function to set the seed: new_seed() - {_,_,X} = erlang:now(), {H,M,S} = time(), H1 = H * X rem 32767, M1 = M * X rem 32767, S1 = S * X rem 32767, put(random_seed, {H1,M1,S1}).

[Haskell-cafe] pointfree-trouble

2009-12-22 Thread slemi
hello everybody, i'm a newbie this is my first post here.. i have trouble making a function pointfree: data RealFrac a = Matrix a = Matr [[a]] | Scalar a deriving (Show, Eq) unMatr :: RealFrac a = Matrix a - [[a]] unMatr = (\(Matr a) - a) reMatr :: RealFrac a = ([[a]] - [[a]]) - (Matrix a -

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread slemi
thanks, that's a really neat syntactic sugar :) however, my original question was how to make the reMatr function pointfree, as reMatr = Matr . (flip (.) unMatr) is not working. any ideas/explanation why it doesnt work? Kim-Ee Yeoh wrote: Here's another way of writing it: data Matrix a =

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Keith Sheppard
Hello, I didn't try to understand what the function is doing, but just quickly noticed that reMatr a = Matr . (flip (.) unMatr) a can be written as reMatr a = Matr . ((flip (.) unMatr) a) but that reMatr = Matr . (flip (.) unMatr) can be written as reMatr a = (Matr . (flip (.) unMatr)) a

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Felipe Lessa
On Tue, Dec 22, 2009 at 12:50:26AM -0800, Kim-Ee Yeoh wrote: reMatr :: RealFrac a = ([[a]] - [[a]]) - (Matrix a - Matrix a) reMatr f = Matr . f . unMatr -- this idiom occurs a lot, esp. with newtypes And usually we would call this 'liftMatr' or something along these lines. The function

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Felipe Lessa
On Tue, Dec 22, 2009 at 09:27:47AM -0500, Keith Sheppard wrote: Hello, I didn't try to understand what the function is doing, but just quickly noticed that reMatr a = Matr . (flip (.) unMatr) a can be written as reMatr a = Matr . ((flip (.) unMatr) a) ...and then reMatr a = (Matr .)

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Chaddaï Fouché
On Tue, Dec 22, 2009 at 3:09 PM, slemi 0sle...@gmail.com wrote: this works fine, but if i leave the 'a' in the last function's definition like this: reMatr = Matr . (flip (.) unMatr) The correct point free version would be : reMatr = (Matr .) . (. unMatr) -- Jedaï

Re: [Haskell-cafe] How can i set the seed random number generator ?

2009-12-22 Thread Chaddaï Fouché
On Tue, Dec 22, 2009 at 1:16 PM, Scott Turner 1hask...@pkturner.org wrote: In haskell, i just use the following function to get the random number. It seems i donot need to set the seed of random number generator manually? rollDice ::  Int - IO Int rollDice n = randomRIO(1,n) That's correct.

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Daniel Fischer
Am Dienstag 22 Dezember 2009 15:09:34 schrieb slemi: hello everybody, i'm a newbie this is my first post here.. i have trouble making a function pointfree: data RealFrac a = Matrix a = Matr [[a]] | Scalar a deriving (Show, Eq) unMatr :: RealFrac a = Matrix a - [[a]] unMatr = (\(Matr a)

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Eduard Sergeev
Günther Schmidt wrote: I'm wondering if there is any chance that functional dependencies will not be around in the future. As was previously noted they are supposed to be replaced by type families, but for me the crucial difference between these two now is that currently type families do not

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-22 Thread Aaron Tomb
On Dec 21, 2009, at 5:03 PM, Thomas Schilling wrote: It's probably just the search path ordering, no? I.e., if you add something on the command line or in .cabal/config it gets added to the beginning of the search path. Then again, there are cases where you'd want the macports version

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Stephen Tetley
2009/12/22 Eduard Sergeev eduard.serg...@gmail.com: As was previously noted they are supposed to be replaced by type families, Hi Eduard Currently this seems a more like a rumour than a fact - from [1] Type Families and Fun Deps are equivalently expressive which seems a worthwhile point to

[Haskell-cafe] powering of new types

2009-12-22 Thread slemi
hey there and thanks for the replies to my earlier question, here is the next one: i have defined both the (*) and (/) operators for my new type data Matrix a = Matr {unMatr :: [[a]]} | Scalar a deriving (Show, Eq) (*) being matrix multiplication and (/) being multiplication with inverse i

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Alberto G. Corona
Semi Off Topic: If the ultimate nature of reality is mathematical, as many physicist say, then everything is mathematical. Then the question must be rephrased to ¿is this or that isomorphic with a mathematical structure powerful enough (general enough, simple enough, but not more) or is out there

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Eduard Sergeev
Hi Stephen, Stephen Tetley-2 wrote: Currently this seems a more like a rumour than a fact - from [1] Type Families and Fun Deps are equivalently expressive which seems a worthwhile point to restate. I've got the same impresion initially and was keen to use TF in favor to FD. And I'm

[Haskell-cafe] ANNOUNCE: Haddock 2.6.0

2009-12-22 Thread David Waern
-- Haddock 2.6.0 A new version of Haddock, the Haskell documentation tool, is out! This is the version that comes with GHC 6.12.1. It contains the main results of Isaac Dupree's Summer of Code project,

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-22 Thread Brandon S. Allbery KF8NH
On Dec 22, 2009, at 10:39 , Aaron Tomb wrote: On Dec 21, 2009, at 5:03 PM, Thomas Schilling wrote: It's probably just the search path ordering, no? I.e., if you add something on the command line or in .cabal/config it gets added to the beginning of the search path. Then again, there are

Re: [Haskell-cafe] powering of new types

2009-12-22 Thread Felipe Lessa
On Tue, Dec 22, 2009 at 09:03:44AM -0800, slemi wrote: this allows me to use the (^^) powering operator, which works fine with non-zero exponents. however to my surprise when i try (^^ 0) the answer is (Scalar 1), and not the identity matrix as expected. does this mean that (a ^^ 0) is not

Re: [Haskell-cafe] powering of new types

2009-12-22 Thread slemi
oh well thats pretty straight-forward:) the next thing i don't understand is how ghci turns 1 into (Scalar 1). 1 == (Scalar 1) returns True, which is logical in a way (NOT), but if i change the type definition to data Matrix a = Matr {unMatr :: [[a]]} | Lol a | Scalar a then 1 == (Scalar 1)

Re: [Haskell-cafe] powering of new types

2009-12-22 Thread Jochem Berndsen
slemi wrote: oh well thats pretty straight-forward:) the next thing i don't understand is how ghci turns 1 into (Scalar 1). 1 == (Scalar 1) returns True, which is logical in a way (NOT), but if i change the type definition to data Matrix a = Matr {unMatr :: [[a]]} | Lol a | Scalar a then

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Iavor Diatchki
Hi, Not everyone in the community is keen on replacing functional dependencies with type families. My advice would be to use whichever language construct seems more suitable to your problem and disregard the occasional posts by people claiming that functional dependencies are obsolete or

Re: [Haskell-cafe] An old package and the new Cabal.

2009-12-22 Thread Jason Dusek
Thanks; this should be enough for me to get it working again. -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-22 Thread Henning Thielemann
Patai Gergely schrieb: I would do resampling (with some of the Interpolation routines) and mixing in two steps, that is I would prepare (lazy) storable vectors with the resampled sounds and mix them. And is that straightforward considering the peculiarities of tracked music? After all,

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-22 Thread Aaron Tomb
On Dec 22, 2009, at 9:33 AM, Brandon S. Allbery KF8NH wrote: On Dec 22, 2009, at 10:39 , Aaron Tomb wrote: On Dec 21, 2009, at 5:03 PM, Thomas Schilling wrote: It's probably just the search path ordering, no? I.e., if you add something on the command line or in .cabal/config it gets added

Re: [Haskell-cafe] Re: install-dirs on Mac OS X

2009-12-22 Thread Tom Tobin
On Tue, Dec 22, 2009 at 4:49 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Likewise,  ~/Library/Haskell  seems to be the best place for user installs. While I don't mind the /Library/Haskell path for global installs, I'm not sure how I feel about this for local installs. It usually

Re: [Haskell-cafe] Problem with cabal install zlib

2009-12-22 Thread Tom Tobin
On Mon, Dec 21, 2009 at 5:08 PM, Ozgur Akgun ozgurak...@gmail.com wrote: Oh sorry for that character. I wanted to make that part underlined in gmail which uses (i guess) *'s to denote it. Just to emphasise the problematic part. Yikes — I just checked what Gmail sends as the plain-text

Re: [Haskell-cafe] Problem with cabal install zlib

2009-12-22 Thread Ozgur Akgun
That's verrry correct. Sorry for the confusion again. Any more suggestions by the way? 2009/12/22 Tom Tobin korp...@korpios.com On Mon, Dec 21, 2009 at 5:08 PM, Ozgur Akgun ozgurak...@gmail.com wrote: Oh sorry for that character. I wanted to make that part underlined in gmail which uses

Re: [Haskell-cafe] install-dirs on Mac OS X

2009-12-22 Thread Duncan Coutts
On Mon, 2009-12-21 at 22:55 -0800, Mark Lentczner wrote: I suggest that the default place for global installs on Mac OS X be: /Library/Haskell/ As I've mentioned I'm mostly an OSX ignoramus. One thing I think I've seen said before however is that things in /Library and ~/Library are

Re: [Haskell-cafe] Problem with cabal install zlib

2009-12-22 Thread Duncan Coutts
On Mon, 2009-12-21 at 23:08 +, Ozgur Akgun wrote: So what's the recommended thing to do now? Please file a ticket in the ghc trac with as much detail as is necessary for someone else to reproduce this. Given what we have at the moment I cannot see the cause of the problem. From what you've

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-22 Thread Duncan Coutts
On Tue, 2009-12-22 at 07:39 -0800, Aaron Tomb wrote: Do we need some more flexible options to GHC, giving users more control on the ordering of libraries on the linker command line? I don't think there is any single ordering that will work. Different packages need libs from different

Re: [Haskell-cafe] sizeOf on a type

2009-12-22 Thread Henning Thielemann
On Fri, 18 Dec 2009, Gregory Crosswhite wrote: Yay, advancePtr is exactly what I needed! I totally missed that one in the docs. Also thanks to those of you who pointed me to the scoped type variables feature, since I had figured that a feature liked that had to exist but I just didn't

[Haskell-cafe] Happstack with XML-RPC

2009-12-22 Thread Michael Hartl
Hello, has anybody ever used Happstack as XML-RPC-Server? Perhaps in conjunction with HaXR? I like the architecture of Happstack and would like to use it in a project where I have to use HTML as well as XML-RPC, now to me it would make sense to integrate XML-RPC abilities into Happstack, since

Re: [Haskell-cafe] Problem with cabal install zlib

2009-12-22 Thread Ozgur Akgun
What about this part: -o dist/build/Codec/Compression/ Zlib/Stream.hs Codec/Compression/Zlib/Stream.hsc Isn't it passing multiple (two in this case) output parameters? Or am I missing sth? 2009/12/22 Duncan Coutts duncan.cou...@googlemail.com On Mon, 2009-12-21 at 23:08 +, Ozgur Akgun

[Haskell-cafe] Visible space with lhs2tex

2009-12-22 Thread Felipe Lessa
Hello! Does anyone know if it is possible to turn spaces inside strings to visible spaces. That is, format test as \textvisiblespace{}test With the 'listings' package there's the option 'showspaces'. However, unfortunately this and obvious variations don't work: %format =

[Haskell-cafe] what happend with the docs of base-libs in 6.10.4

2009-12-22 Thread Günther Schmidt
Hi, I was just trying to consult my html-documentation of ghc-6.10.4 libraries on Windows. Almost all of the Standard Monads are missing, State, Writer etc. What happened, how do I get them back? Günther ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] what happend with the docs of base-libs in 6.10.4

2009-12-22 Thread Henning Thielemann
On Tue, 22 Dec 2009, Günther Schmidt wrote: Hi, I was just trying to consult my html-documentation of ghc-6.10.4 libraries on Windows. Almost all of the Standard Monads are missing, State, Writer etc. They are (and already were) part of the mtl package. You may install 'mtl' manually

Re: [Haskell-cafe] Problem with cabal install zlib

2009-12-22 Thread Duncan Coutts
On Tue, 2009-12-22 at 21:48 +, Ozgur Akgun wrote: What about this part: -o dist/build/Codec/Compression/ Zlib/Stream.hs Codec/Compression/Zlib/Stream.hsc Isn't it passing multiple (two in this case) output parameters? Or am I missing sth? No, that's one -o flag and a single

[Haskell-cafe] Is it just me... or is cabal/hackage a little broken?

2009-12-22 Thread Bardur Arantsson
Hi all, Sorry about the inflammatory title, but I just got this message from an uploaded package (hums): Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. The thing is, I got the same message while trying

[Haskell-cafe] Children elements with HXT

2009-12-22 Thread Tony Morris
I am trying to parse XML using HXT following http://www.haskell.org/haskellwiki/HXT/Conversion_of_Haskell_data_from/to_XML Here is my XML file (way.xml): way id=27776903 visible=true timestamp=2009-05-31T13:39:15Z version=3 changeset=1368552 user=Matt uid=70 tag k=access v=private/ tag

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Andrey Sisoyev
The referenced writings are a bit old. I wonder, what are the current plans and decisions (or at least dominating opinions) on FD and TF. And when the equality constraint will be ready. Andrey Stephen Tetley-2 wrote: 2009/12/22 Eduard Sergeev eduard.serg...@gmail.com: As was previously

Re: [Haskell-cafe] Children elements with HXT

2009-12-22 Thread Tony Morris
Adding (a_remove_whitespace,v_1) as a parser option when running solves it. Silly me. Tony Morris wrote: I am trying to parse XML using HXT following http://www.haskell.org/haskellwiki/HXT/Conversion_of_Haskell_data_from/to_XML Here is my XML file (way.xml): way id=27776903 visible=true

Re: [Haskell-cafe] Is it just me... or is cabal/hackage a little broken?

2009-12-22 Thread Brandon S. Allbery KF8NH
On Dec 22, 2009, at 18:14 , Bardur Arantsson wrote: Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. The thing is, I got the same message while trying to compile locally and it turned out that all I had to

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-22 Thread wren ng thornton
Aaron Tomb wrote: I've come across the issue with iconv, as well. The problem seems to be that some versions of iconv define iconv_open and some related functions as macros (that then call libiconv_open, etc.), and some versions of iconv have exported functions for everything. In particular,

Re: [Haskell-cafe] install-dirs on Mac OS X

2009-12-22 Thread Mark Lentczner
On Dec 22, 2009, at 12:35 PM, Duncan Coutts wrote: One thing I think I've seen said before however is that things in /Library and ~/Library are supposed to be app bundles or frameworks or some other special OSX packaging thing, rather than traditional Unix-style installations. Nope - not

Re: [Haskell-cafe] install-dirs on Mac OS X

2009-12-22 Thread wren ng thornton
Mark Lentczner wrote: Taking a cue from the various preinstalled language systems on Mac OS X, up over in /Library might be a better place: Python puts installed packages in: /Library/Python/version/site-packages Ruby puts installed packages in:

Re: [Haskell-cafe] Re: install-dirs on Mac OS X

2009-12-22 Thread wren ng thornton
Tom Tobin wrote: On Tue, Dec 22, 2009 at 4:49 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Likewise, ~/Library/Haskell seems to be the best place for user installs. While I don't mind the /Library/Haskell path for global installs, I'm not sure how I feel about this for local

Re: [Haskell-cafe] install-dirs on Mac OS X

2009-12-22 Thread wren ng thornton
Mark Lentczner wrote: On Dec 22, 2009, at 12:35 PM, Duncan Coutts wrote: One thing I think I've seen said before however is that things in /Library and ~/Library are supposed to be app bundles or frameworks or some other special OSX packaging thing, rather than traditional Unix-style

Re: [Haskell-cafe] pointfree-trouble

2009-12-22 Thread Kim-Ee Yeoh
There you have it: fully- and semi-pointfree versions of reMatr. A heads up: aggressively pursuing pointfreeness without type signatures guarantees a courtesy call from the monomorphism restriction, pace ()-garlic aficionados. As for your question on why the original code doesn't typecheck: if