[Haskell-cafe] ANN: tskiplist-0.0.0

2010-11-24 Thread Peter Robinson
This package [1] provides an implementation of a skip list using STM. A skip list is a probabilistic data structure with Data.Map-like operations. In contrast to a balanced tree, a skip list does not need any (expensive) rebalancing, which makes it particularly suitable for concurrent programming.

Re: [Haskell-cafe] Equality constraint "synonyms"

2010-11-24 Thread Hugo Pacheco
Thank you for the info., I didn't know that it had already been proposed. The constraint families seem definitely useful. hugo On Thu, Nov 25, 2010 at 12:53 PM, Sebastian Fischer wrote: > On Thu, 2010-11-25 at 10:41 +0900, Hugo Pacheco wrote: > > Would this be a desired feature for other people?

[Haskell-cafe] How to instance class with functional dependency?

2010-11-24 Thread Magicloud Magiclouds
Hi, In System.Posix.IOCtl, there is such a class: class Storable d => IOControl req d | req -> d where ioctlReqSource :: req -> CInt How to instance it? I do it as: data TIOCGWINSZ = TIOCGWINSZ #starttype struct winsize #field ws_row , CUShort #field ws_col , CUShort #field ws_xpixel , CUShort

Re: [Haskell-cafe] Equality constraint "synonyms"

2010-11-24 Thread Sebastian Fischer
On Thu, 2010-11-25 at 10:41 +0900, Hugo Pacheco wrote: > Would this be a desired feature for other people? I'd like to have Haskell Type Constraints Unleashed http://users.ugent.be/~tschrijv/Research/papers/constraint_families.pdf which includes equality constraint synonyms. Sebastian ___

[Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-24 Thread John D. Ramsdell
A quick review of GHC 7.0.1 revealed two challenges for developers. I downloaded the GHC 7.0.1 sources, configured for a home directory install, and built and installed the compiler. Very close to the end, my machine froze, perhaps due to memory exhaustion. In any event, a reboot allowed me to c

[Haskell-cafe] Equality constraint "synonyms"

2010-11-24 Thread Hugo Pacheco
Dear Haskellers, When programming with type functions, I often find myself with a set of invariants that are frequent in my programs and can be expressed as equality constraints on the context of the functions. I wonder if there is any way in current GHC to express some kind of synonyms for equal

[Haskell-cafe] Eq instance for Chan

2010-11-24 Thread Mitar
Hi! Why is there no Eq instance for Chan? There is Eq for MVar so it is quite possible to define also Eq for Chan? What I would like to do is keep track how many consumers I have for each Chan so duplicating them with dupChan as necessary. So I was thinking of storing a list of Chans which alread

Re: [Haskell-cafe] Monadic function purity

2010-11-24 Thread Daniel Fischer
On Wednesday 24 November 2010 21:46:22, Gregory Propf wrote: > I have a pretty basic question.  I've been wondering about whether > monadic functions that do NOT us IO can be pure or not.  There seems to > be some confusion on this topic on the web.  I'm especially interested > in whether they can

Re: [Haskell-cafe] Monadic function purity

2010-11-24 Thread Miguel Mitrofanov
Generally speaking, all Haskell functions are pure unless they use unsafe- functions or FFI inside. Отправлено с iPhone Nov 24, 2010, в 23:46, Gregory Propf написал(а): > I have a pretty basic question. I've been wondering about whether monadic > functions that do NOT us IO can be pure or no

[Haskell-cafe] Monadic function purity

2010-11-24 Thread Gregory Propf
I have a pretty basic question.  I've been wondering about whether monadic functions that do NOT us IO can be pure or not.  There seems to be some confusion on this topic on the web.  I'm especially interested in whether they can be memoized.  It seems to me that something like a function in the

Re: [Haskell-cafe] Confused about missing data constructor

2010-11-24 Thread Bas van Dijk
On Wed, Nov 24, 2010 at 7:08 PM, Antoine Latter wrote: > I meant that 'pop' and 'push' should have been written with 'modify', 'get', > and 'set' instead of the raw constructor, not as a drop-in replacement. Indeed, you can also use the 'state' function instead of the 'State' constructor in your

Re: [Haskell-cafe] Confused about missing data constructor

2010-11-24 Thread Antoine Latter
I meant that 'pop' and 'push' should have been written with 'modify', 'get', and 'set' instead of the raw constructor, not as a drop-in replacement. I can show you examples later if this isn't clear, unless I'm not understanding your code above. Antoine On Nov 24, 2010 10:46 AM, "Adam Miezianko"

[Haskell-cafe] Re: Another Quasi-Quotation question

2010-11-24 Thread Geoffrey Mainland
On 11/24/2010 03:14, jean-christophe mincke wrote: > Hello, > > I am still playing with template-haskell... > > I wonder, is there any reason why a quasiquoter cannot create haskell > statements and declarations in addition to expressions and patterns? Or > more generally create any legal Haskell

[Haskell-cafe] Confused about missing data constructor

2010-11-24 Thread Antoine Latter
On Tue, Nov 23, 2010 at 6:58 PM, Adam Miezianko wrote: > I'm working through Learn You a Haskell for Great Good [1] and getting > a compiler error while playing around with some of the code.  I have > this: > > -- BEGIN state.hs > import Control.Monad.State > > type Stack = [Int] > > pop :: State

Re: [Haskell-cafe] Confused about missing data constructor

2010-11-24 Thread Anthony Cowley
On Tue, Nov 23, 2010 at 7:58 PM, Adam Miezianko wrote: > I'm working through Learn You a Haskell for Great Good [1] and getting > a compiler error while playing around with some of the code.  I have > this: > Now, I'm not exactly sure how to read the documentation for > Control.Monad.State [2] but

[Haskell-cafe] Another Quasi Quotation question

2010-11-24 Thread jean-christophe mincke
Hello, I am still playing with template-haskell... I wonder, is there any reason why a quasiquoter cannot create haskell statements and declarations in addition to expressions and patterns? Or more generally create any legal Haskell syntax tree. I.e Suppose I would like to create a quasiquoter f

[Haskell-cafe] save the dates: SF Bay Area Haskell Hackathon: Feb 11~13, 2011

2010-11-24 Thread Mark Lentczner
Bryan O'Sullivan and I are hosting a SF Bay Area Haskell Hackathon at the Hacker Dojo in Mountain View, California. Details are all sketchy at this point, but we plan on two components: 1) Haskell Project Hackathon 2) Learn Haskell Workshop See: http://wiki.hackerdojo.com/w/page/Haskell-

[Haskell-cafe] ANNOUNCE: graphviz-2999.11.0.0

2010-11-24 Thread Ivan Lazar Miljenovic
I am pleased to announce version 2999.11.0.0 of graphviz [1], my Haskell bindings to the Graphviz suite of graph visualisation tools [2]. [1]: http://hackage.haskell.org/package/graphviz [2]: http://graphviz.org/ This release is mostly backwards-compatible (unless you dealt directly with Point an

[Haskell-cafe] Confused about missing data constructor

2010-11-24 Thread Adam Miezianko
I'm working through Learn You a Haskell for Great Good [1] and getting a compiler error while playing around with some of the code. I have this: -- BEGIN state.hs import Control.Monad.State type Stack = [Int] pop :: State Stack Int pop = State $ \(x:xs) -> (x,xs) push :: Int -> State Stack ()

[Haskell-cafe] Re: [Haskell-beginners] Problem "grouping" a list

2010-11-24 Thread Aai
I don't know what this tuple is representing, but if you want to group you'll have to specify on 'what': - the tuple, - the fst or - the snd Here's a possibility with grouping on the fst import Data.List import Data.Ord import Data.Function groupAtoms :: (Float -> Bool) -> [(Float,Integer)

[Haskell-cafe] Another Quasi-Quotation question

2010-11-24 Thread jean-christophe mincke
Hello, I am still playing with template-haskell... I wonder, is there any reason why a quasiquoter cannot create haskell statements and declarations in addition to expressions and patterns? Or more generally create any legal Haskell syntax tree. I.e Suppose I would like to create a quasiquoter f

Re: [Haskell-cafe] Derived type definition

2010-11-24 Thread Miguel Mitrofanov
Well, you can resort to functional dependencies, I guess... {-# LANGUAGE FlexibleInstances, FunctionalDependencies, MultiParamTypeClasses, UndecidableInstances #-} module FunDeps where data Rec a r = Rec a r data RecNil = RecNil data Wrapper a = Wrapper a class Wrapped r w | r -> w where i :: r

[Haskell-cafe] ANNOUNCE: Graphalyze-0.11.0.0 and SourceGraph-0.7.0.0

2010-11-24 Thread Ivan Lazar Miljenovic
I am pleased to announce the 0.7.0.0 release of my graph-theoretic source code analysis tool SourceGraph [1], and the library it uses Graphalyze 0.11.0.0 [2]. [1]: http://hackage.haskell.org/package/SourceGraph [2]: http://hackage.haskell.org/package/Graphalyze Changes in SourceGraph (apart from

[Haskell-cafe] ANN: dnscache - caching DNS resolver

2010-11-24 Thread Ertugrul Soeylemez
Hello everybody, (second try, since the first mail somehow didn't arrive) I've just uploaded a caching DNS resolver library, which also includes a command line utility for quick mass DNS resolution: http://hackage.haskell.org/package/dnscache Although I've tested it throroughly it's still in

[Haskell-cafe] ANN: dnscache - caching DNS resolver

2010-11-24 Thread Ertugrul Soeylemez
Hello everybody, I've just uploaded a caching DNS resolver library, which also includes a command line utility for quick mass DNS resolution: http://hackage.haskell.org/package/dnscache Although I've tested it throroughly it's still in beta phase. Feel free to play around with it. Feedback i