Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Jake McArthur
On 07/14/2010 05:01 PM, Victor Gorokhov wrote: You can implement pure pointers on top of Data.Map with O(log n) time Or on top of Data.IntMap with O(1) time. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/list

Re: [Haskell-cafe] Docs on the current and future constraint solver?

2010-07-14 Thread Thomas Schilling
The latest work is OutsideIn(X): http://www.haskell.org/haskellwiki/Simonpj/Talk:OutsideIn This is quite long paper. It describes a framework for constraint-based type inference and then instantiates it with a constraint solver that supports type families, GADTs and type classes. Constraint-ba

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: Haskell 2010 Report (final)

2010-07-14 Thread John Meacham
On Wed, Jul 14, 2010 at 10:35:50AM +0100, Simon Marlow wrote: >> Yeah, I didn't realize how important the allocator was until I started >> benchmarking, spending time cutting the cost of marking garbage in >> half didn't help nearly as much as shaving a few cycles off the >> allocator. The fast pas

[Haskell-cafe] Plotting Vectors with GnuPlot Wrapper

2010-07-14 Thread Maryam Moghadas
Hi When I use Vectors as a PlotStyle in Graphics.Gnuplot.Simple, the output curve.gp and curve0.csv is not generated correctly. For example when I write in ghci: plotPathStyle [] (PlotStyle Vectors (DefaultStyle 1)) [(1,1),(2,7)] the output files are: curve.gp: plot "curve0.csv" using 1:2 with v

Re: [Haskell-cafe] Expression dye

2010-07-14 Thread Derek Elkins
http://hackage.haskell.org/package/simple-reflect This is what is used in lambdabot. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Expression dye

2010-07-14 Thread Vo Minh Thu
2010/7/14 Vo Minh Thu : > 2010/7/14 Andrew Coppin : >> I'm trying to write a function that builds a series of results in a very >> complicated way. Eventually I ended up writing things like >> >>> newtype Dye = Dye String deriving (Eq, Show) >>> >>> instance Num Dye where >>>   (Dye x) + (Dye y) =

Re: [Haskell-cafe] Expression dye

2010-07-14 Thread Vo Minh Thu
2010/7/14 Andrew Coppin : > I'm trying to write a function that builds a series of results in a very > complicated way. Eventually I ended up writing things like > >> newtype Dye = Dye String deriving (Eq, Show) >> >> instance Num Dye where >>   (Dye x) + (Dye y) = Dye (x ++ " + " ++ y) >>   (Dye x

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Victor Gorokhov
You can implement pure pointers on top of Data.Map with O(log n) time: {-# LANGUAGE ExistentialQuantification #-} import Data.Map ( Map ) import qualified Data.Map as Map import Data.Typeable import Control.Monad.State import Data.Maybe type PointerSpace = Map Int PackedValue newtype Pointer a =

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Gregory Crosswhite
Or you can get the best of all worlds by combining all three! data User = User {userNext :: IORef (MVar (TVar User))) ,userPrev :: IORef (MVar (TVar User))) } On 07/14/10 14:39, Andrew Coppin wrote: > Serguey Zefirov wrote: >> Use IORef. ;) >> >> PS >> MVar is

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Andrew Coppin
Serguey Zefirov wrote: Use IORef. ;) PS MVar is better, actually TVar is better still. ;-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Expression dye

2010-07-14 Thread Andrew Coppin
I'm trying to write a function that builds a series of results in a very complicated way. Eventually I ended up writing things like > newtype Dye = Dye String deriving (Eq, Show) > > instance Num Dye where > (Dye x) + (Dye y) = Dye (x ++ " + " ++ y) > (Dye x) - (Dye y) = Dye (x ++ " - " ++ y

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Serguey Zefirov
2010/7/14 Sergey Mironov : > Hi cafe! I have a question of C-to-Haskell type:) > > Imagine web application wich allows users to browse some shared > filesystem located at the server. > Application stores every users's position within that filesystem > (current directory or file). > > In C this can

[Haskell-cafe] trees and pointers

2010-07-14 Thread Sergey Mironov
Hi cafe! I have a question of C-to-Haskell type:) Imagine web application wich allows users to browse some shared filesystem located at the server. Application stores every users's position within that filesystem (current directory or file). In C this can be implemented with the help of following

[Haskell-cafe] Re: cryptohash and an incremental API

2010-07-14 Thread Thomas DuBuisson
Vincent said: > couple of comments around the hashes interface: > > * updateCtx works on blockLength, instead of working on arbitrary size... So for performance reasons you seem to prefer Semantics 1.2? """ 1.2 Multiple of blockSize bytes Implementations are encouraged to consume data (continue u

[Haskell-cafe] Docs on the current and future constraint solver?

2010-07-14 Thread Corey O'Connor
I believe I have run headlong into issue #3064 in ghc (http://hackage.haskell.org/trac/ghc/ticket/3064). All I think I know is this: * this is a performance issue with the system used to solve type constraints. * the solver is undergoing an overhaul to resolve performance issues in addition to othe

[Haskell-cafe] IFL 2010: 3rd CFP and 1st Call for Participation

2010-07-14 Thread Don Stewart
3RD CALL FOR PAPERS and 1ST CALL FOR PARTICIPATION 22nd Symposium on Implementation and Application of Functional Languages (IFL 2010) September 1-3, 2010 Utrecht University Alphen aan den Rijn, The Netherlands http://www.cs.uu.nl/ifl2010

[Haskell-cafe] Call for Copy: Monad.Reader Issue 17

2010-07-14 Thread Brent Yorgey
Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline for Issue 17 will be: **Friday, October 1, 2010** The Monad.Reader Th

Re: [Haskell-cafe] Re: Please report any bug of gtk2hs-0.11.0!

2010-07-14 Thread briand
On Wed, 14 Jul 2010 21:05:35 +0800 Andy Stewart wrote: > > Where's the demo directory ?! > Sorry, we forgot add demo in .cabal file when we released > gtk2hs-0.11.0, We will include all demos in gtk2hs-0.11.1 I think that would be very helpful. It's a big package with lots of dependencies, so

[Haskell-cafe] Re: Comments on Haskell 2010 Report

2010-07-14 Thread Alex Stangl
On Wed, Jul 14, 2010 at 12:10:48PM +0100, Simon Marlow wrote: > it is returning undefined:undefined:undefined, which is different from > [undefined,undefined,undefined]. My mistake. I should have read more carefully. > >25. In section 41.4.4, bullet before isPermissionError isn't rendered > >co

[Haskell-cafe] Re: Please report any bug of gtk2hs-0.11.0!

2010-07-14 Thread Andy Stewart
writes: > Short version of this post: > > Looks like the intsall depends on alex and that dependencies doesn't > appear to be handled, i.e. I had to install alex before proceeding. > > why do is it called gtk2hs if you are actually installing package > gtk ;-) Because before gtk2hs cabalized pack

Re: [Haskell-cafe] Applying a value to a function generically

2010-07-14 Thread Vo Minh Thu
2010/7/14 Felipe Lessa : > On Wed, Jul 14, 2010 at 8:25 AM, Arnaud Bailly wrote: >> Hello, >> I would like to construct a collection of function-like objects on >> which I could apply some value, in a typesafe and clean way. > > You could use Data.Typeable.cast [1] > > [1] > http://haskell.org/gh

Re: [Haskell-cafe] Applying a value to a function generically

2010-07-14 Thread Felipe Lessa
On Wed, Jul 14, 2010 at 8:25 AM, Arnaud Bailly wrote: > Hello, > I would like to construct a collection of function-like objects on > which I could apply some value, in a typesafe and clean way. You could use Data.Typeable.cast [1] [1] http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.

[Haskell-cafe] Applying a value to a function generically

2010-07-14 Thread Arnaud Bailly
Hello, I would like to construct a collection of function-like objects on which I could apply some value, in a typesafe and clean way. Let's say I have something like this: > data Fun = forall a b . F (a -> b) > type Callables = Map String Fun I would like to be able to write: > invoke :: Call

[Haskell-cafe] Re: Comments on Haskell 2010 Report

2010-07-14 Thread Simon Marlow
Alex, many thanks for all these comments, I've fixed all the problems you pointed out, except for: On 09/07/2010 03:25, Alex Stangl wrote: 6. In section 3.17.2, the example that is supposed to return [undefined,undefined,undefined] seems like it really ought to return undefined, although I can

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haskell 2010 Report (final)

2010-07-14 Thread Simon Marlow
On 12/07/2010 22:12, John Meacham wrote: Yeah, I didn't realize how important the allocator was until I started benchmarking, spending time cutting the cost of marking garbage in half didn't help nearly as much as shaving a few cycles off the allocator. The fast pass of the allocator is actually

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haskell 2010 Report (final)

2010-07-14 Thread Simon Marlow
On 14/07/2010 03:36, John Meacham wrote: On Tue, Jul 13, 2010 at 10:24:00AM +0100, Simon Marlow wrote: Well, a main useful case is that I can do -phaskell98 and -phaskell2010 at the same time. So I can make the default jhc behavior be the union of the two languages easily. That works in GHC to

Re: [Haskell-cafe] lists of arbitrary depth

2010-07-14 Thread Chaddaï Fouché
On Tue, Jul 13, 2010 at 11:28 AM, Shlomi Vaknin wrote: > Thank you Bob, > your example clarified how actually using such data type would appear in > haskell. I naively thought it would be as simple as defining a regular list, > but i see it is slightly more strict than that. I appreciate your help

[Haskell-cafe] Collecting MonadError errors generically

2010-07-14 Thread oleg
Leon Grynszpan wrote: > What I want, instead, is to run a whole bunch of > computations that may throw errors. If there are any errors, I want to > collect them all into one big master error. If not, I want a list of > results. Here's an example of usage: > > couldThrowError :: (Error e, MonadErro

[Haskell-cafe] Re: cryptohash and an incremental API

2010-07-14 Thread Vincent Hanquez
On Mon, Jul 12, 2010 at 02:52:10PM -0700, Thomas M. DuBuisson wrote: > I've been working on a new crypto library specifically to provide a > unified API for packages implementing cryptographic algorithms. You can > see the discussions on librar...@haskell.org [1] [2]. Please feel free > to take a

Re: [Haskell-cafe] lambda calculus and equational logic

2010-07-14 Thread Ben Lippmeier
On 14/07/2010, at 6:26 , Patrick Browne wrote: > Thanks for your clear and helpful responses. > I am aware that this question can lead to into very deep water. > I am comparing Haskell with languages based on equational logic (EL) > (e.g. Maude/CafeOBJ, lets call them ELLs). I need to identify t