Re: [Haskell-cafe] Defining a Strict language pragma

2012-11-05 Thread Johan Tibell
On Mon, Nov 5, 2012 at 3:28 PM, Iustin Pop wrote: > Did you mean here "it's still possible to define _lazy_ arguments"? The > duality of !/~ makes sense, indeed. Yes, it would be nice to still make arguments explicitly lazy, using "~". ___ Haskell-Caf

Re: [Haskell-cafe] Defining a Strict language pragma

2012-11-05 Thread Iustin Pop
On Mon, Nov 05, 2012 at 02:52:56PM -0800, Johan Tibell wrote: > Hi all, > > I would like to experiment with writing some modules (e.g. low-level > modules that do a lot of bit twiddling) in a strict subset of Haskell. The > idea is to remove boilerplate bangs (!) and instead declare the whole > mo

Re: [Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Patrick Premont
I had not thought of this record syntax. But it does not perform the currying effect shown in the example; it just drops the omitted fields. Brandon Allbery wrote: >On Mon, Nov 5, 2012 at 4:15 PM, Stephen Tetley wrote: > >> There is a long extant GHC extension to elide constructor arguments >

Re: [Haskell-cafe] [ANNOUNCE] network-bitcoin

2012-11-05 Thread Alberto G. Corona
Thanks. I like the idea of BitCoin very much I'll l try to integrate it in MFlow 2012/11/5 Clark Gaebel > Hello Cafe, > > You've heard of the neat crypto-currency bitcoin[1], haven't you? > > Well, I've just released network-bitcoin[2] which provides Haskell > bindings to the bitcoin daemon. H

[Haskell-cafe] Defining a Strict language pragma

2012-11-05 Thread Johan Tibell
Hi all, I would like to experiment with writing some modules (e.g. low-level modules that do a lot of bit twiddling) in a strict subset of Haskell. The idea is to remove boilerplate bangs (!) and instead declare the whole module strict. I believe this would both make code that needs to be strict m

[Haskell-cafe] more sharing in generated code

2012-11-05 Thread Peter Divianszky
Hi Joachim, > > ... > > I think one problem with this approach is that now, until "x r'" is > evaluated, you keep both r and r' alive. If r was _not_ retained by > anything else, then you are now preventing the GC from freeing it and > hence increasing the memory footprint. Good remark, this can

Re: [Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Brandon Allbery
On Mon, Nov 5, 2012 at 4:15 PM, Stephen Tetley wrote: > There is a long extant GHC extension to elide constructor arguments > f (Leaf {}) = ... > f (Node {}) = ... > I don't think that's an extension, it falls out directly from how Haskell builds records on top of ADTs and is specified in the sta

Re: [Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Stephen Tetley
Whoops - replied in haste... There is a long extant GHC extension to elide constructor arguments f (Leaf {}) = ... f (Node {}) = ... There is a recent extension for "lambda case" which you were also using and I didn't look closely at. On 5 November 2012 21:11, Stephen Tetley wrote: > There's a

Re: [Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Stephen Tetley
There's a Glasgow extension that gets you to this: treeFold :: (a -> a -> a) -> Tree a -> a treeFold f = \case Leaf {} -> id Node {} -> f `on` treeFold f Or maybe this if parens are needed: treeFold :: (a -> a -> a) -> Tree a -> a treeFold f = \case (Leaf {}) -> id (Node {}) -> f `on`

Re: [Haskell-cafe] How to handle exceptions in conduit?

2012-11-05 Thread Michael Snoyman
On Mon, Nov 5, 2012 at 9:51 PM, Michael Snoyman wrote: > > On Nov 5, 2012 2:42 PM, "Hiromi ISHII" wrote: > > > > Hi, there > > > > On 2012/11/01, at 21:23, Michael Snoyman wrote: > > > > > Due to various technical reasons regarding the nature of conduit, you > can't currently catch exceptions wi

Re: [Haskell-cafe] How to handle exceptions in conduit?

2012-11-05 Thread Michael Snoyman
On Nov 5, 2012 2:42 PM, "Hiromi ISHII" wrote: > > Hi, there > > On 2012/11/01, at 21:23, Michael Snoyman wrote: > > > Due to various technical reasons regarding the nature of conduit, you can't currently catch exceptions within the Pipe monad. You have two options: > > > > * Catch exceptions befor

[Haskell-cafe] Partial application in case expression rules

2012-11-05 Thread Patrick Premont
Occasionally I find it would be nice to be able to omit some or all constructor parameters from a pattern matching rule. Perhaps the compiler could put them in for you and apply them to the right hand side of the rule ? data Tree a = Leaf a| Node (Tree a) (Tree a) treeFold :: (a -> a -> a

[Haskell-cafe] Does this have a name?

2012-11-05 Thread Jacques Carette
The function > app1 f x = f >>= ($ x) or equivalently > app2 f x = join (f <*> pure x) with type Monad m => m (a -> m b) -> a -> m b ? Hoogle did not help. Jacques PS: a nice point-free version would be appreciated as well. I can easily change app1 and app2 myself to point-free with enough

Re: [Haskell-cafe] Is XMonad still developed or with a current maintainer?

2012-11-05 Thread timothyhobbs
I am subscribed to the xmonad mailing list. But the question still stands.  The list is pretty quiet and it seems xmonad is maintainerless :( -- Původní zpráva -- Od: Roman Cheplyaka Datum: 5. 11. 2012 Předmět: Re: [Haskell-cafe] Is XMonad still developed or with a current main

Re: [Haskell-cafe] Is XMonad still developed or with a current maintainer?

2012-11-05 Thread Alfredo Di Napoli
Hey Roman, thanks for the tip. I will also try on the irc channel, hoping to find someone :) Cheers, A. On 5 November 2012 15:45, Roman Cheplyaka wrote: > The "generic email" (xmo...@haskell.org) is the xmonad mailing list [1]. > However, if you are not subscribed, your emails might get dropped

Re: [Haskell-cafe] Is XMonad still developed or with a current maintainer?

2012-11-05 Thread Roman Cheplyaka
The "generic email" (xmo...@haskell.org) is the xmonad mailing list [1]. However, if you are not subscribed, your emails might get dropped or be kept in the moderation queue. So I suggest subscribing and trying again. [1]: http://www.haskell.org/mailman/listinfo/xmonad Roman * Alfredo Di Napoli

Re: [Haskell-cafe] Is XMonad still developed or with a current maintainer?

2012-11-05 Thread Alfredo Di Napoli
Anyone knows something? On 5 November 2012 08:38, Alfredo Di Napoli wrote: > Hi guys, > > looking at the Darcs repo it seems that something is happening, but XMonad > wasn't updated in a year on Hackage and everything seems to be still. > Is XMonad still actively developed? If yes, who is the cur

[Haskell-cafe] [ANNOUNCE] network-bitcoin

2012-11-05 Thread Clark Gaebel
Hello Cafe, You've heard of the neat crypto-currency bitcoin[1], haven't you? Well, I've just released network-bitcoin[2] which provides Haskell bindings to the bitcoin daemon. Hopefully, this will make your bitcoin-related goals easier to achieve. Who knows, it might even make bitcoin integratio

Re: [Haskell-cafe] How to handle exceptions in conduit?

2012-11-05 Thread Hiromi ISHII
Hi, there On 2012/11/01, at 21:23, Michael Snoyman wrote: > Due to various technical reasons regarding the nature of conduit, you can't > currently catch exceptions within the Pipe monad. You have two options: > > * Catch exceptions before `lift`ing. > * Catch exceptions thrown from the entire