Re: [Haskell-cafe] ANNOUNCE: control-monad-failure and safe-failure

2009-11-17 Thread Nicolas Pouillard
Excerpts from Kalman Noel's message of Tue Nov 17 07:47:14 +0100 2009: Michael Snoyman schrieb: control-monad-failure provides a basic notion of failure which does not commit to any concrete representation. It is just a version of the MonadError class without the annoying bits. class

[Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Simon Marlow
I've just uploaded deepseq-1.0.0.0 to Hackage http://hackage.haskell.org/package/deepseq This provides a DeepSeq class with a deepseq method, equivalent to the existing NFData/rnf in the parallel package. I'll be using this in a newly revamped parallel package, which I hope to upload

Re: [Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Roel van Dijk
On Tue, Nov 17, 2009 at 12:00 PM, Simon Marlow marlo...@gmail.com wrote: I've just uploaded deepseq-1.0.0.0 to Hackage This is great! I often use rnf to fully evaluate some expression where I didn't need parallelism at all. Time to update some packages. Thank you, Roel

Re: [Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread José Pedro Magalhães
Hello, The release of the regular library for generic programming on Hackage [1] also contains a form of deep seq [2]. This means that you don't even have to write the definition of 'deepseq', you can just use 'gdseq' (assuming you have used Template Haskell to derive the generic representations

Re: [Haskell-cafe] ANNOUNCE: control-monad-failure and safe-failure

2009-11-17 Thread Kalman Noel
Nicolas Pouillard schrieb: class MonadFailure e m where failure :: e - m a Why is it called MonadFailure (specifically, what's the Monad bit doing there)? Because of 'Monad m' being a superclass of 'MonadFailure e m'. Here is the class: class Monad m = MonadFailure e m where failure :: e -

Re: [Haskell-cafe] ANNOUNCE: control-monad-failure and safe-failure

2009-11-17 Thread Nicolas Pouillard
Excerpts from Kalman Noel's message of Tue Nov 17 12:55:54 +0100 2009: Nicolas Pouillard schrieb: class MonadFailure e m where failure :: e - m a Why is it called MonadFailure (specifically, what's the Monad bit doing there)? Because of 'Monad m' being a superclass of

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Simon Peyton-Jones
| What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record | system is one of my biggest pain points in Haskell and TDNR would be a | major

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Matthijs Kooijman
I've added an informal straw poll to the bottom of [1] to allow you to express an opinion. [1]: ? signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Nicolas Pouillard
Excerpts from Simon Marlow's message of Tue Nov 17 12:00:21 +0100 2009: I've just uploaded deepseq-1.0.0.0 to Hackage Great! I'm wondering what is the need/purpose for DeepSeqIntegral and DeepSeqOrd? -- Nicolas Pouillard http://nicolaspouillard.fr

FW: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Simon Peyton-Jones
[Resending, this time with link; sorry] | What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record | system is one of my biggest pain points in

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Neil Brown
Simon Peyton-Jones wrote: | What's the status of the TDNR proposal [1]? It's stalled. As far as I know, there's been very little discussion about it. It's not a trivial thing to implement, and it treads on delicate territory (how . is treated). Having skimmed the page, it seems like the

Re: [Haskell-cafe] ANNOUNCE: gnome-keyring 0.1 (bindings to libgnome-keyring)

2009-11-17 Thread Magnus Therning
Excellent. It seems that my sit-back-and-wait approach is slowly resulting in all the libraries required to rewrite my old (Python) password storage tool are being put into place :-) /M On Tue, Nov 17, 2009 at 2:38 AM, John Millikin jmilli...@gmail.com wrote: The GNOME Keyring is a service for

[Haskell-cafe] Re: ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Duncan Coutts
On Tue, 2009-11-17 at 11:00 +, Simon Marlow wrote: I've just uploaded deepseq-1.0.0.0 to Hackage http://hackage.haskell.org/package/deepseq This provides a DeepSeq class with a deepseq method, equivalent to the existing NFData/rnf in the parallel package. I'll be using this in a

Re: [Haskell-cafe] Little errors in number calculations

2009-11-17 Thread Abby Henríquez Tejera
It's curious that Hugs lies... Thanks for the answers :) . 2009/11/15 Lennart Augustsson lenn...@augustsson.net: Hugs is wrong, as you can easily see by evaluating   let x = 123.35503 * 10.0 in x == read (show x) With ghc it comes out as True and with Hugs as False.  -- Lennart On Sat,

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Levi Greenspan
On Tue, Nov 17, 2009 at 1:18 PM, Simon Peyton-Jones simo...@microsoft.com wrote: | What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record |

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Levi Greenspan
On Tue, Nov 17, 2009 at 1:18 PM, Simon Peyton-Jones simo...@microsoft.com wrote: I've added an informal straw poll to the bottom of [1] to allow you to express an opinion. Forgive my ignorance, but I can not find a way to edit the wiki page. What am I doing wrong? Cheers, Levi

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Daniel Fischer
Am Dienstag 17 November 2009 15:36:52 schrieb Levi Greenspan: As pointed out by others one may choose a different string instead of . like -  if this makes the implementation of TDNR feasible. Or, if both of these strings would make the implementation awkward, one can choose a different but

Re: [Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Bryan O'Sullivan
On Tue, Nov 17, 2009 at 3:00 AM, Simon Marlow marlo...@gmail.com wrote: I've just uploaded deepseq-1.0.0.0 to Hackage http://hackage.haskell.org/package/deepseq This provides a DeepSeq class with a deepseq method, equivalent to the existing NFData/rnf in the parallel package.

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Luke Palmer
On Tue, Nov 17, 2009 at 5:18 AM, Simon Peyton-Jones simo...@microsoft.com wrote: | What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record |

Re: [Haskell-cafe] How to show record syntax?

2009-11-17 Thread Duncan Coutts
On Tue, 2009-11-17 at 17:14 +0100, Sean Leather wrote: module Main where data A = A {x :: Int} deriving Show main = print $ Just A {x = 5} This led to an issue report [3] which developed a few responses. Some don't like the grammar as defined, because, at a glance, it appears too much

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Simon Peyton-Jones
Sigh. Apologies. Turns out that [1] is not publicly editable. So I've created a HaskellWiki page [2] and cross-linked them. [2] http://haskell.org/haskellwiki/TypeDirectedNameResolution You should be able to edit that! Simon | -Original Message- | From:

Re: [Haskell-cafe] ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Brandon S. Allbery KF8NH
On Nov 17, 2009, at 11:36 , Bryan O'Sullivan wrote: On Tue, Nov 17, 2009 at 3:00 AM, Simon Marlow marlo...@gmail.com wrote: I've just uploaded deepseq-1.0.0.0 to Hackage http://hackage.haskell.org/package/deepseq This provides a DeepSeq class with a deepseq method, equivalent to the

[Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
I'm trying to create a hash table. Yeah, I know, don't use hash tables, but I need to create something I'm familiar with, not something I've never worked with before. What's wrong with this code? Michael import Prelude hiding (lookup) import Data.HashTable data

[Haskell-cafe] omitting params in function bindings

2009-11-17 Thread Doug McIlroy
Is there a deep reason (beyond saving a sentence or two in the language definition) for requiring all patterns in a function binding to have the same explicit arity? For example, in dropWhile0 :: Num a = [a] - [a] dropWhile0 (0:xs) = dropWhile0 xs dropWhile0 xs = xs why

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Bulat Ziganshin
Hello michael, Tuesday, November 17, 2009, 10:16:50 PM, you wrote: I'm trying to create a hash table. Yeah, I know, don't use hash tables, but I need to create something I'm familiar with, not something I've never worked with before. What's wrong with this code? ht = MyHashTable.new (==)

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Daniel Fischer
Am Dienstag 17 November 2009 20:16:50 schrieb michael rice: I'm trying to create a hash table. Yeah, I know, don't use hash tables, but I need to create something I'm familiar with, not something I've never worked with before. What's wrong with this code? Michael

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Daniel Fischer
Am Dienstag 17 November 2009 20:36:46 schrieb Daniel Fischer: What you probably wanted was type MyHashTable = HashTable String Int -- not data MyHashTable Just in case it's not clear: ht - new (==) dummy :: IO MyHashTable only works at the prompt or in an IO do-block, not at the top level

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
Thanks all, Got it! type rather than data and - rather than = (should have remembered this from monad stuff). Also, don't need the qualification. Onward and upward. Thanks, Michael --- On Tue, 11/17/09, Daniel Fischer daniel.is.fisc...@web.de wrote: From: Daniel Fischer

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
Hi Daniel, Thanks for the IO monad reminder. What is GHC.Int.Int32? Can't find it on Hoogle. Michael == *Main ht - new (==) dummy :: IO MyHashTable interactive:1:15:     Couldn't match expected type `GHC.Int.Int32'    against inferred type `Int'     In

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Gregory Crosswhite
You don't need to create a new type for a String - Int hashtable, you already get it for free because HashTable is a parameterized type. Also, although you are apparently trying to make life simpler for yourself using a HashTable, you are actually making like more complicated because the

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Daniel Fischer
Am Dienstag 17 November 2009 21:09:26 schrieb michael rice: What is GHC.Int.Int32? Can't find it on Hoogle. Int32 is the guaranteed-to-be-32-bits integer type, it's defined in the module GHC.Int, typically it's imported via Data.Int (because, naturally, using GHC's own modules isn't

Re: [Haskell-cafe] ghci + user prelude

2009-11-17 Thread Edward Z. Yang
Excerpts from Sean McLaughlin's message of Mon Nov 16 19:06:06 -0500 2009: Hi. I'm aware of this option, and use it frequently to override the default prelude, but it doesn't help this problem: I suppose this is the appropriate quote from the GHC manual: GHC normally imports Prelude.hi files

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Gregory Crosswhite
Look in Data.Int for a list of the Int types. Basically you generally only use Int unless you are working at a lower- level which has an explicit requirement for the number of bits. In this case, HashTable has such a requirement, so you have two choices: you can either change the type

Re[2]: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Bulat Ziganshin
Hello Daniel, Tuesday, November 17, 2009, 11:21:18 PM, you wrote: The hash function must have a return type of fixed and specified width, or porting the app between 32-bit and 64-bit platforms could have enormous performance impact, so it can't be plain Int. i think that the problem with

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
Hi Gregory, I was wondering about that, because of the following: [1 of 1] Compiling Main ( hash1.hs, interpreted ) Ok, modules loaded: Main. *Main ht - new (==) dummy :: IO MyHashTable *Main dummy mike 7 *Main dummy michael 7 *Main insert ht mike 1 *Main toList ht

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Brad Larsen
On Tue, Nov 17, 2009 at 4:00 PM, michael rice nowg...@yahoo.com wrote: Hi Gregory, I was wondering about that, because of the following: [1 of 1] Compiling Main ( hash1.hs, interpreted ) Ok, modules loaded: Main. *Main ht - new (==) dummy :: IO MyHashTable *Main dummy mike 7

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
So, what you're telling me is, my dummy hash function IS being used, and because of collisions the other values are placed in different locations? Michael --- On Tue, 11/17/09, Brad Larsen brad.lar...@gmail.com wrote: From: Brad Larsen brad.lar...@gmail.com Subject: Re: [Haskell-cafe] Simple

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Brad Larsen
On Tue, Nov 17, 2009 at 4:22 PM, michael rice nowg...@yahoo.com wrote: So, what you're telling me is, my dummy hash function IS being used, and because of collisions the other values are placed in different locations? Michael [...] If Data.HashTable is implemented using separate chaining,

Re[2]: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Bulat Ziganshin
Hello michael, Wednesday, November 18, 2009, 12:00:58 AM, you wrote: *Main toList ht [(miguel,3),(michael,2),(mike,1)] It seems my dummy function is being ignored. i wonder why you think so? your ht has all 3 pairs you ever inserted inside, they all are inside the same bucket since hash

Re: Re[2]: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread michael rice
Hi Bulat, I was just looking for a simple hashing function. I was going to use the length function but a constant int is even simpler.  I'm supposing that had I used the length function mike and fred would end up in the same bucket. This is the first time I've tried to do anything in Haskell

Re: Re[Haskell-cafe] cursive to foldr

2009-11-17 Thread Ezra Lalonde
Using the same basic structure you did, and foldr, I think below is the simplest method: import Data.Maybe searchList :: (a - Bool) - [a] - Maybe [a] searchList p xs = foldr (\x acc - if p x then Just (x: fromMaybe [] acc) else acc) Nothing xs ghci

[Haskell-cafe] Re: help with musical data structures

2009-11-17 Thread Rohan Drape
On 2009-11-15, Michael Mossey m...@alumni.caltech.edu wrote: I will need a function that computes prime (normal?) form, of course, and it is just begging to be memoized. there are some prime form algorithms at

[Haskell-cafe] GHCi's :t misbehaving

2009-11-17 Thread Philippa Cowderoy
I have some mildly complicated parsing code, that uses parsec to return a computation (in a state monad) that handles operator precedence - so I can handle scoped precedence/fixities, much like in Haskell. I just spent a while bolting on some new features. More time than I'd like, I'd left it

Re: [Haskell-cafe] GHCi's :t misbehaving

2009-11-17 Thread Luke Palmer
It's very hard to tell what is going on without more details. If you *at least* give the ghci session, and possibly the whole code (while it might be too much to read, it is not to much to load and try ourselves). This looks like a monomorphism restriction, which shouldn't happen when you are

Re: Re[Haskell-cafe] cursive to foldr

2009-11-17 Thread David Menendez
On Tue, Nov 17, 2009 at 6:31 PM, Ezra Lalonde ezra.lalo...@gmail.com wrote: Using the same basic structure you did, and foldr, I think below is the simplest method: import Data.Maybe searchList :: (a - Bool) - [a] - Maybe [a] searchList p xs = foldr (\x acc - if p x

Re: Re[Haskell-cafe] cursive to foldr

2009-11-17 Thread Luke Palmer
On Tue, Nov 17, 2009 at 7:39 PM, David Menendez d...@zednenem.com wrote: On Tue, Nov 17, 2009 at 6:31 PM, Ezra Lalonde ezra.lalo...@gmail.com wrote: Using the same basic structure you did, and foldr, I think below is the simplest method: import Data.Maybe searchList

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread wren ng thornton
Neil Brown wrote: Having skimmed the page, it seems like the re-use of . is one of the major difficulties of the proposal. Would it be possible to use -? It has been used for accessing members in C and C++, so it is not too unusual a choice. It's also the one that Perl went with. It is

Re: [Haskell-cafe] omitting params in function bindings

2009-11-17 Thread Malcolm Wallace
Doug McIlroy wrote: Is there a deep reason (beyond saving a sentence or two in the language definition) for requiring all patterns in a function binding to have the same explicit arity? Perhaps it is more likely that a clause omitting an argument is a mistake by the programmer, than that it

[Haskell-cafe] Re: ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Dean Herington
At 11:00 AM + 11/17/09, Simon Marlow wrote: I've just uploaded deepseq-1.0.0.0 to Hackage http://hackage.haskell.org/package/deepseq This provides a DeepSeq class with a deepseq method, equivalent to the existing NFData/rnf in the parallel package. I'll be using this in a newly

Re: [Haskell-cafe] Re: ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Luke Palmer
On Tue, Nov 17, 2009 at 8:48 PM, Dean Herington heringtonla...@mindspring.com wrote: The documentation claim that The default implementation of 'deepseq' is simply 'seq' is not exactly right, as `deepseq` and `seq` have different signatures.  Which raises the more interesting question: Why did

Re: [Haskell-cafe] Re: ANNOUNCE: deepseq-1.0.0.0

2009-11-17 Thread Malcolm Wallace
The documentation claim that The default implementation of 'deepseq' is simply 'seq' is not exactly right, as `deepseq` and `seq` have different signatures. Yes indeed. In order to use deepseq, it looks like I also need some way to force the () return value, e.g. let res = deepseq

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Roman Leshchinskiy
Simon, have you given any thought to how this interacts with type system extensions, in particular with GADTs and type families? The proposal relies on being able to find the type of a term but it's not entirely clear to me what that means. Here is an example: foo :: F Int - Int foo :: Int -

Re: Re[Haskell-cafe] cursive to foldr

2009-11-17 Thread David Menendez
On Tue, Nov 17, 2009 at 10:01 PM, Luke Palmer lrpal...@gmail.com wrote: filter even [0..]    --    [0,2,4,6,8,...] searchList even [0...]   --   Just [0,2,4,6,8,...] searchList gives Nothing in exactly those cases that filter gives []. They give _|_ in exactly the same situations.  searchList

Re: [Haskell-cafe] omitting params in function bindings

2009-11-17 Thread Edward Kmett
There is the property that once you 'move across the = to the right', the pattern matcher isn't allowed to backtrack and try other patterns any more, which might introduce some funny business. Though, I can't -- at the moment -- come up with a way that it would break anything. -Edward Kmett On

[Haskell-cafe] hipmunkplayground on windows

2009-11-17 Thread Anatoly Yakovenko
Anyone else seeing a bunch of linker errors when trying to install HipmunkPlayground? this is what i see: C:\Program Files\Haskell\OpenGL-2.2.3.0\ghc-6.10.4/libHSOpenGL-2.2.3.0.a(RenderMode.o):fake:(.text+0x5be): more undefined references to `glRenderMode' follow C:\Program

Re: [Haskell-cafe] hipmunkplayground on windows

2009-11-17 Thread Felipe Lessa
On Tue, Nov 17, 2009 at 10:21:07PM -0800, Anatoly Yakovenko wrote: Anyone else seeing a bunch of linker errors when trying to install HipmunkPlayground? Hmmm, no, I've never seen those errors before. Are you able to compile any OpenGL programs at all? You may try, for example, installing the