Re: [Haskell-cafe] Proposal: new function for lifting

2013-09-29 Thread Bas van Dijk
On 27 September 2013 21:51, Thiago Negri wrote: > Stop lifting, start using shinny operators like this one: > > (^$) :: Monad m => m a -> (a -> b -> c) -> m b -> m c > (^$) = flip liftM2 Note that something like this is already provided by the InfixApplicative library: http://hackage.has

Re: [Haskell-cafe] reifying typeclasses (resend)

2013-09-15 Thread Bas van Dijk
You can indeed use GADTs to solve this: {-# LANGUAGE GADTs #-} data Universe a where UInt :: Int -> Universe Int UChar :: Char -> Universe Char class Universal a where universe :: a -> Universe a instance Universal Int where universe = UInt instance Universal Char where u

[Haskell-cafe] ANN: Google co-sponsoring ZuriHac 2013

2013-08-21 Thread Bas van Dijk
Dear Haskellers, I would like to remind you that the Zurich FP Afternoon (with a keynote by Simon Marlow) is taking place next week (13:00, Thursday, 29 August) and is directly followed by the ZuriHac 2013 Haskell Hackathon [1]. There are still some places available at both events -- you're welco

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-07-10 Thread Bas van Dijk
On 10 July 2013 08:57, Alfredo Di Napoli wrote: > >> To make the transition easier I have an experimental library which >> defines a ByteString as a type synonym of a Storable.Vector of Word8 >> and provides the same interface as the bytestring package: >> >> https://github.com/basvandijk/vector-b

Re: [Haskell-cafe] Examples of MVars usage

2013-06-12 Thread Bas van Dijk
On 12 June 2013 21:29, Francisco M. Soares Nt. wrote: > I am looking for packages on hackage which use MVars extensively. Those > which create plenty of MVars Hi Francisco, Also take a look at Control.Concurrent.Chan in the base library: http://hackage.haskell.org/packages/archive/base/latest/d

Re: [Haskell-cafe] [Hackathon] ANN: ZuriHac 2013 & FP Afternoon with keynote by Simon Marlow

2013-06-10 Thread Bas van Dijk
On 10 June 2013 19:38, Roman Cheplyaka wrote: > Hi Bas, > >> When: Thursday 30 August - Friday 1 September >> Where: Erudify offices, Zurich, Switzerland > > Is this a mistake? 30 August is Friday, 1 September is Sunday. Oops! You're right, that's embarrassing :-) Thanks, Bas

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-05 Thread Bas van Dijk
On 5 June 2013 11:50, Peter Simons wrote: > I meant to say that there is redundancy in *both*. The libraries > mentioned in this thread re-implement the same type internally and > expose APIs to the user that are largely identical. I agree. I hope that ByteStrings will be replaced by a Storable.V

Re: [Haskell-cafe] ANNOUNCE: new bridge! (prelude-prime)

2013-05-23 Thread Bas van Dijk
On 23 May 2013 11:54, Joachim Breitner wrote: > Hi, > > Am Donnerstag, den 23.05.2013, 11:52 +0200 schrieb Bas van Dijk: >> On 23 May 2013 11:26, Joachim Breitner wrote: >> > So you can get what you want by not >> > depending on base, but rather have prelude-prim

Re: [Haskell-cafe] ANNOUNCE: new bridge! (prelude-prime)

2013-05-23 Thread Bas van Dijk
On 23 May 2013 11:26, Joachim Breitner wrote: > So you can get what you want by not > depending on base, but rather have prelude-prime re-export all modules > from base plus its own Preldue. How would you re-export all base's modules from the prelude-prime package? I didn't know this was already

Re: [Haskell-cafe] Streaming bytes and performance

2013-03-20 Thread Bas van Dijk
On 20 March 2013 11:41, Konstantin Litvinenko wrote: > On 03/20/2013 11:17 AM, Branimir Maksimovic wrote: >> >> Are you sure? I use ghc 7.6.2 > > > Huh, I use 7.4.2, and if 7.6.2 can handle this I will try to switch. Not > sure how to do that on ubuntu 12.10... I always install ghcs under my home

Re: [Haskell-cafe] Optimizing performance problems with Aeson rendering large Text arrays

2013-02-01 Thread Bas van Dijk
On Feb 1, 2013 1:15 PM, "Oliver Charles" wrote: > > Urgh, the formatting got totally destroyed in sending, I think. If so, here's a paste of my email as I intended it to be sent: > > http://hpaste.org/81648 > > Sorry about that! > - Ocharles > > > ___ >

Re: [Haskell-cafe] aeson-0.6.1.0 deriveJSON error

2013-01-26 Thread Bas van Dijk
On 26 January 2013 15:20, Bas van Dijk wrote: > But in aeson-HEAD it has the following type: > > deriveJSON :: Options -> Name -> Q [Dec] Note that I'm currently working on extending the encoding Options record: * I added a constructorNameModifier :: String -> Str

Re: [Haskell-cafe] aeson-0.6.1.0 deriveJSON error

2013-01-26 Thread Bas van Dijk
On 26 January 2013 14:47, wrote: > ghc doesn't seem to be unifying deriveJSON (String->String) > parameter with id :: a -> a. It seems you're using aeson HEAD. Note that the deriveJSON from the released aeson-0.6.1.0 as the type: deriveJSON :: (String -> String) -> Name -> Q [Dec] But in aes

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-12-09 Thread Bas van Dijk
On 9 December 2012 10:29, Leon Smith wrote: > On Thu, Dec 6, 2012 at 5:23 PM, Brandon Allbery wro\ >> >> Both should be cdevs, not files, so they do not go through the normal >> filesystem I/O pathway in the kernel and should support select()/poll(). >> ("ls -l", the first character should be "c"

Re: [Haskell-cafe] Portability of Safe Haskell packages

2012-11-23 Thread Bas van Dijk
On 23 November 2012 15:47, Roman Cheplyaka wrote: > Should it be advised to surround safe annotations with CPP #ifs? > Or does anyone see a better way out of this contradiction? I think that would be good advice. Note that even if you're only using GHC then you still want to use CPP in order to s

Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-14 Thread Bas van Dijk
On Nov 14, 2012 10:44 PM, "Janek S." wrote: > calculateSeq :: [Double] -> [Double] > calculateSeq [] = [] > calculateSeq (x:xs) = (sin . sqrt $ x) : xs Do you really mean to calculate the 'sin . sqrt' of just the head of the list, or do you mean: calculateSeq = map (sin . sqrt) ? Bas

Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread Bas van Dijk
On 13 November 2012 17:27, Andreas Abel wrote: > This calls for a means of blacklisting broken or malicious packages. > > cabal update > > should also pull a blacklist of packages that will never be selected by > cabal install (except maybe by explicit user safety overriding). Maybe we can use

Re: [Haskell-cafe] Strange behavior with listArray

2012-11-12 Thread Bas van Dijk
On 12 November 2012 14:52, Daniel Fischer wrote: > I see no loop in that, and ghci doesn't either: Oops you're right of course. Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Motion to unify all the string data types

2012-11-11 Thread Bas van Dijk
On 10 November 2012 17:57, Johan Tibell wrote: > It better communicates intent. A e.g. lazy byte string can be used for two > separate things: > > * to model a stream of bytes, or > * to avoid costs due to concatenating strings. > > By using a strict byte string you make it clear that you're not

Re: [Haskell-cafe] Strange behavior with listArray

2012-11-11 Thread Bas van Dijk
On 12 November 2012 04:50, Alex Stangl wrote: > I'm stymied trying to figure out why the program below blows up with > <<>> when I use "f 0" If you replace the a!0 in f by its value 0, f is equivalent to: f k = if k > 0 then f 0 else 0 : f 1 D

Re: [Haskell-cafe] Taking over ghc-core

2012-11-11 Thread Bas van Dijk
Great! On 10 November 2012 16:17, Shachaf Ben-Kiki wrote: > With Don Stewart's blessing > (), I'll be > taking over maintainership of ghc-core, which hasn't been updated > since 2010. I'll release a version with support for GHC 7.6 later > to

Re: [Haskell-cafe] lazy boxed array and builder?

2012-07-12 Thread Bas van Dijk
On 12 July 2012 15:35, Yves Parès wrote: > I remember this discussion, lazy vectors would also enable an implementation > of bytestring and (maybe) text only with unboxed vectors, unifying it all: > type ByteString = Vector Word8 Yes, I would like to add a lazy storable vector to vector-bytestrin

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 18:46, Gábor Lehel wrote: > I must be missing something, but this seems a bit useless to me. You > have a phantom type parameter on Proxy, and then you're hiding it. So > when you pattern match on ProxyWrapper you recover the fact that there > was a type which satisfies the constrai

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 17:57, Bas van Dijk wrote: > It works. It turns out it doesn't work exactly as I want. Say I have this ProxyWrapper of Nums: p :: ProxyWrapper Num p = ProxyWrapper (Proxy :: Proxy Int) then the following would give a type error: oops :: TypeRep oops = typeOfInne

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 17:52, Andres Löh wrote: > Hi Bas. > > I haven't thought about this for long, but ... > >> data ProxyWrapper constraint = >>    forall a. constraint a => ProxyWrapper (Proxy a) > > I'm assuming adding Typable a in ProxyWrapper is not an option for you? No, I would rather keep that

[Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
Hello, I have the following program: -- {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} import Data.Proxy (Proxy) import Data.Typeable (Typeable, TypeRep, type

[Haskell-cafe] Parameterize constraints of existentially quantified types

2012-04-21 Thread Bas van Dijk
Hi, I just found out that with the new ConstraintKinds extension we can parameterize the constraint of an existentially quantified type: {-# LANGUAGE KindSignatures, ConstraintKinds, ExistentialQuantification #-} import GHC.Exts data Some (c :: * -> Constraint) = forall a. c a => Some a This cou

Re: [Haskell-cafe] Arguments against an hypothetical Data.ByteString.Generic?

2012-03-27 Thread Bas van Dijk
On 27 March 2012 21:46, Yves Parès wrote: > Yes, thank you to remind me of that, I remember now having seen the project. > Strict ByteStrings being an alias to Vector Word8 is a good idea (are > bytestrings are already implemented exactly like > Data.Vector.Storable.Vector). But in that case we co

Re: [Haskell-cafe] Arguments against an hypothetical Data.ByteString.Generic?

2012-03-27 Thread Bas van Dijk
On 27 March 2012 11:00, Yves Parès wrote: > Hello, > > As vector provides a class generalizing all flavours > (Data.Vector.Generic.Vector), it occurs to me that the same could be done > for ByteString. Then, packages based on it would have the choice between > hardcoded and generic, they wouldn't

Re: [Haskell-cafe] ANN: generic-deepseq 1.0.0.0

2012-02-23 Thread Bas van Dijk
On 23 February 2012 22:09, Maxime Henrion wrote: > On Sun, 2012-02-19 at 21:06 +0100, Bas van Dijk wrote: >> On 19 February 2012 18:11, Maxime Henrion wrote: >> > I'm guilty of not having preserved the "rnf :: a -> ()" >> > function as the class fu

Re: [Haskell-cafe] ANN: generic-deepseq 1.0.0.0

2012-02-19 Thread Bas van Dijk
On 19 February 2012 18:11, Maxime Henrion wrote: > If you're not dealing with an abstract datatype, you _shouldn't_ have an > explicit instance, because it would be possible to write an incorrect one, > while that is impossible if you just derive a generic implementation > (as long as the generic

Re: [Haskell-cafe] ANN: generic-deepseq 1.0.0.0

2012-02-19 Thread Bas van Dijk
On 19 February 2012 13:12, Maxime Henrion wrote: > Any suggestions are welcome. Nice work but it would be nice to have this functionality directly in the deepseq package as in: #ifdef GENERICS {-# LANGUAGE DefaultSignatures, TypeOperators, FlexibleContexts #-} #endif class NFData a where rn

Re: [Haskell-cafe] Serializing UTCTimes

2012-01-21 Thread Bas van Dijk
Thanks Ertugrul and Yitzchak. I failed to notice the Real and Fractional instances for DiffTime. Thanks very much for pointing me to it. I dropped the dependency on datetime and implemented your suggestions. Bas On 21 January 2012 22:29, Yitzchak Gale wrote: > Bas van Dijk wrote: >> W

Re: [Haskell-cafe] Serializing UTCTimes

2012-01-20 Thread Bas van Dijk
On 20 January 2012 15:03, Bas van Dijk wrote: > What's the recommended way for serializing (with the cereal package) an > UTCTime? I'm now using the datetime package so I can do: import Data.DateTime (fromSeconds, toSeconds) instance Serialize UTCTime where get = fro

[Haskell-cafe] Serializing UTCTimes

2012-01-20 Thread Bas van Dijk
Hello, What's the recommended way for serializing (with the cereal package) an UTCTime? It's easy to give Serialize instances for UTCTime and Day: instance Serialize UTCTime where get = liftM2 UTCTime get get put (UTCTime day time) = put day >> put time instance Serialize Day where

Re: [Haskell-cafe] hackage trac broken

2012-01-15 Thread Bas van Dijk
On 15 January 2012 12:01, Joachim Breitner wrote: > Is this known and will it be fixed? It was shut down because of massive spamming: http://www.haskell.org/pipermail/cabal-devel/2012-January/008427.html I have no idea who's working on it and when it will be up again. Cheers, Bas ___

Re: [Haskell-cafe] Haskell Platform and Windows - where's 2011.4?

2011-12-27 Thread Bas van Dijk
On 27 December 2011 19:13, Steve Horne wrote: > On haskell.org, the 2011.4.0.0 version is shown as the current stable > release - but the most recent download link is for the 2011.2.0.0 version. What download link are you referring to? I see that: http://hackage.haskell.org/platform/windows.html

Re: [Haskell-cafe] GHC 7.4: Expected behavior or bug?

2011-12-27 Thread Bas van Dijk
On 27 December 2011 17:47, Bas van Dijk wrote: > I fixed a similar breakage in the hmatrix library: > > https://github.com/AlbertoRuiz/hmatrix/commit/a4f38eb196209436f72b938f6355f6e28474bef3 GHC-7.4.1-rc1 also reported another type error in code that was accepted by GHC <= 7.2.2. Th

Re: [Haskell-cafe] GHC 7.4: Expected behavior or bug?

2011-12-27 Thread Bas van Dijk
On 27 December 2011 17:38, Michael Snoyman wrote: > Thanks to Mark Wright for pointing this out[1]. > > We have the equivalent of the following code in persistent: > > {-# LANGUAGE MultiParamTypeClasses #-} > data Key backend entity = Key > > class Monad (b m) => Foo b m where >    func :: b m (Ke

Re: [Haskell-cafe] Interruptible threads with IO loops

2011-12-21 Thread Bas van Dijk
On 21 December 2011 09:52, Fedor Gogolev wrote: > I'm trying to get some threads that I can stop and get last > values that was computed (and that values are IO values, in fact). I'm not sure it's what you need but you might want to look at: http://hackage.haskell.org/package/Workflow Bas

Re: [Haskell-cafe] Alternative versus Monoid

2011-12-21 Thread Bas van Dijk
On 16 December 2011 16:26, Yves Parès wrote: > "1) What about the First type? Do we {-# DEPRECATE #-} it?" > > Personnaly, I'm in favor of following the same logic than Int: > Int itself is not a monoid. You have to be specific: it's either Sum or > Mult. > > It should be the same for Maybe: we re

Re: [Haskell-cafe] Adding state to a library

2011-12-18 Thread Bas van Dijk
On 18 December 2011 22:26, Kevin Jardine wrote: > I have a library of functions that all take a config parameter (and usually > others) and return results in the IO monad. > > It is sometimes useful to drop the config parameter by using a state-like > monad.. If you're not modifying the configura

Re: [Haskell-cafe] Alternative versus Monoid

2011-12-16 Thread Bas van Dijk
Attached is a git patch for base which makes the proposed changes. From 824bdca994b3fcceff21fcb68e1b18f1d4f03bd5 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Fri, 16 Dec 2011 15:16:14 +0100 Subject: [PATCH] Give the Maybe Monoid the expected failure-and-prioritized-choice semantics instead

Re: [Haskell-cafe] Alternative versus Monoid

2011-12-16 Thread Bas van Dijk
On 16 December 2011 05:26, Brent Yorgey wrote: > I, for one, would be > quite in favor of changing the current Monoid (Maybe a) instance to > correspond to the failure-and-prioritized-choice semantics So lets do this. Some questions: 1) What about the First type? Do we {-# DEPRECATE #-} it? 2)

Re: [Haskell-cafe] DB vs read/show for persisting large data

2011-12-14 Thread Bas van Dijk
On 14 December 2011 15:22, Claude Heiland-Allen wrote: > I ran into this very nightmare in one project, and was recommend safecopy > [0] by someone on the #haskell IRC channel.  I've not (yet) used it but it > looks very nice! > > [0] http://hackage.haskell.org/package/safecopy Or better yet, use

Re: [Haskell-cafe] Haskell functions caller-callee details

2011-12-09 Thread Bas van Dijk
On 9 December 2011 16:41, Shakthi Kannan wrote: > Given a Haskell package is there a way I can get each functions' > caller-callee details? Are there any existing tools/libraries that can > help me get this data from the source? Check out SourceGraph: http://hackage.haskell.org/package/SourceGra

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-06 Thread Bas van Dijk
On 6 December 2011 12:59, Michael Snoyman wrote: > On Tue, Dec 6, 2011 at 11:49 AM, Bas van Dijk wrote: >> On 6 December 2011 05:06, Michael Snoyman wrote: >>> Maybe this will help[1]. It's using RWST instead of StateT, but it's >>> the same idea. >>

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-06 Thread Bas van Dijk
On 6 December 2011 05:06, Michael Snoyman wrote: > Maybe this will help[1]. It's using RWST instead of StateT, but it's > the same idea. > > [1] > https://github.com/yesodweb/yesod/commit/7619e4e9dd88c152d1e00b6fea073c3d52dc797f#L0R105 Hi Michael, Note that you can just reuse the MonadTransCont

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-06 Thread Bas van Dijk
On 6 December 2011 09:12, Bas van Dijk wrote: > instance MonadBaseControl IO Annex where >    newtype StM Annex a = StAnnex (StM (StateT AnnexState IO) a) >    liftBaseWith f = Annex $ liftBaseWith $ \runInIO -> >                       f $ liftM StAnnex . runInIO . runAnnex

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-06 Thread Bas van Dijk
On 6 December 2011 04:03, Joey Hess wrote: > I'm trying to convert from 0.2 to 0.3, but in way over my head. > > {-# LANGUAGE GeneralizedNewtypeDeriving #-} > newtype Annex a = Annex { runAnnex :: StateT AnnexState IO a } >        deriving ( >                Monad, >                MonadIO, >    

Re: [Haskell-cafe] Weird interaction between literate haskell, ghci and OverloadedStrings

2011-12-03 Thread Bas van Dijk
On 3 December 2011 11:19, Erik de Castro Lopo wrote: > Joachim Breitner wrote: > >> it does not seem to be related to literate haskell, if I copy the code >> from your file into a .hs without the "> ", ghci still does not activate >> the OverloadedStrings extension when loading the file. > > I had

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Bas van Dijk
On 3 December 2011 00:45, Bas van Dijk wrote: > Note that Peter Simons just discovered that these packages don't build > with GHC-7.0.4 (https://github.com/basvandijk/monad-control/issues/3). > I just committed some fixes which enable them to be build on GHC >= > 6.12.3. Hop

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Bas van Dijk
On 3 December 2011 10:18, Herbert Valerio Riedel wrote: > btw, how did you manage to get measurements from 2 different versions of > the same library (monad-control 0.3 and 0.2.0.3) into a single report? By renaming the old package to monad-control2 and using the PackageImports extension. I do w

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-02 Thread Bas van Dijk
On 3 December 2011 00:45, Bas van Dijk wrote: > * 60 times faster than the previous release! Here are some benchmark results that compare the original monad-peel, the previous monad-control-0.2.0.3 and the new monad-control-0.3: http://basvandijk.github.com/monad-control.html Note that

[Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-02 Thread Bas van Dijk
Hello, I just released monad-control-0.3. The package for lifting control operations (like catch, bracket, mask, alloca, timeout, forkIO, modifyMVar, etc.) through monad transformers: http://hackage.haskell.org/package/monad-control-0.3 It has a new and improved API which is: * easier to unders

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Bas van Dijk
On 18 November 2011 06:44, Johan Tibell wrote: > Here are some examples: > >    insertWith (+) k undefined m  ==  undefined >    delete undefined m  ==  undefined >    map (\ v -> undefined)  ==  undefined >    mapKeys (\ k -> undefined)  ==  undefined > > Any ideas for further improvements? I wo

Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Bas van Dijk
On 16 November 2011 11:05, MigMit wrote: > Maybe it's just me, but I've thought that being non-strict just means that > it's possible for a function to produce some value even if it's argument > doesn't; in other words, that it's possible to have "f (_|_) ≠ (_|_)". If > there was no such thing

Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Bas van Dijk
On 16 November 2011 05:18, John Meacham wrote: > Not nearly enough > attention is paid to the other striking feature, the laziness. The > 'bottom' symbol _|_ should feature prominently. The two most defining > features of haskell are that it is purely functional and _|_ inhabits > every type. The

Re: [Haskell-cafe] deepseq-1.2.0.1 missing Data.Map instance

2011-11-15 Thread Bas van Dijk
On 15 November 2011 23:50, Daniel Fischer wrote: > The change is already in the latest released > deepseq version, but will only be in the containers version to be released > with ghc-7.4. The change is already in the released containers-0.4.2.0. So the only thing Henry needs to do is install tha

Re: [Haskell-cafe] Monad-control rant

2011-11-13 Thread Bas van Dijk
the bug in detail: http://hackage.haskell.org/packages/archive/MonadCatchIO-transformers/0.2.2.3/doc/html/Control-Monad-CatchIO.html Regards, Bas On 12 November 2011 13:55, Mikhail Vorozhtsov wrote: > On 11/12/2011 07:34 AM, Bas van Dijk wrote: >>> >>> Are you going to release a new

Re: [Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd

2011-11-10 Thread Bas van Dijk
Felipe Almeida Lessa > wrote: >> >> On Thu, Nov 10, 2011 at 2:54 PM, Bas van Dijk >> wrote: >> > * Use descriptive variable names: 'm' for monad, 'b' for base monad >> >> It's funny how we, haskellers, find 'm' an

Re: [Haskell-cafe] [ANN] transformers-base, transformers-abort, monad-abort-fd

2011-11-10 Thread Bas van Dijk
On 10 November 2011 12:58, Mikhail Vorozhtsov wrote: > transformers-base[1] introduces a generalized version of MonadIO, MonadBase > (BaseM in monadLib terms). Hi Mikhail, nice packages! I'm currently giving monad-control a new design and I'm planning to generalize MonadControlIO to MonadBaseCon

Re: [Haskell-cafe] Data.Vector.Unboxed

2011-11-09 Thread Bas van Dijk
On 9 November 2011 22:33, kaffeepause73 wrote: > Repa is indeed very Interesting, but I have changing vector length in the > second dimension and later on only want to generate Data on demand. If I use > Matrices, I will use loads of space for no reason. Even if it is possible to create an unboxe

Re: [Haskell-cafe] Easiest to use NoSQL storage with Haskell?

2011-11-09 Thread Bas van Dijk
On 9 November 2011 19:50, dokondr wrote: > On Wed, Nov 9, 2011 at 8:41 PM, Bas van Dijk wrote: >> >> On 9 November 2011 11:59, dokondr wrote: >> > What  Haskell package to work with NoSQL storage is both mature and >> > easiest >> > to use? >>

Re: [Haskell-cafe] Easiest to use NoSQL storage with Haskell?

2011-11-09 Thread Bas van Dijk
On 9 November 2011 11:59, dokondr wrote: > What  Haskell package to work with NoSQL storage is both mature and easiest > to use? > I need persistent storage for simple key/value lists (not complex JSON > docs). If your data fits in RAM then acid-state is also an option: http://hackage.haskell.or

Re: [Haskell-cafe] Data.Vector.Unboxed

2011-11-09 Thread Bas van Dijk
On 9 November 2011 10:56, kaffeepause73 wrote: > Is it possible to create an unboxed vector of unboxed vector ? : Why do you want to do this? If you want multi-dimensional unboxed arrays you could try out repa: http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial (I believe it u

Re: [Haskell-cafe] [ANNOUNCE] cereal-0.3.4.0

2011-11-04 Thread Bas van Dijk
On 3 November 2011 16:27, Trevor Elliott wrote: > I'm happy to announce version 0.3.4.0 of the cereal serialization library. Thanks! Is your repository public? If so, where can I find it and could it be listed in the cabal file using something like: source-repository head type: git loca

Re: [Haskell-cafe] Is generic information dumpable?

2011-11-04 Thread Bas van Dijk
0_0X (GHC.Generics.Par0 > a_adY))) > Still not perfect, in that the representation type should really appear as a > type instance inside the Generic instance, but at least all the important > information is printed. > > Cheers, > Pedro > > 2011/11/3 Bas van Dijk >>

Re: [Haskell-cafe] Is generic information dumpable?

2011-11-03 Thread Bas van Dijk
2011/11/4 José Pedro Magalhães : > Hi, > > 2011/11/3 Bas van Dijk >> >> 2011/11/3 José Pedro Magalhães : >> > "-ddump-deriv" will print (most of) it. >> >> But it doesn't print the most useful piece of information: the >> definition o

Re: [Haskell-cafe] Is generic information dumpable?

2011-11-03 Thread Bas van Dijk
2011/11/3 José Pedro Magalhães : > "-ddump-deriv" will print (most of) it. But it doesn't print the most useful piece of information: the definition of Rep. It would be great if this could be added. Currently when I have a type that I want to know the Rep of, say: data Foo = Bar Int |

Re: [Haskell-cafe] Mailing lists at haskell.org

2011-11-03 Thread Bas van Dijk
On 3 November 2011 23:11, Giovanni Tirloni wrote: > Does anyone know what's the procedure to create a new mailing list at > haskell.org for a forming user group? community.haskell.org provides MailMan mailing lists: Cheers, Bas ___ Haskell-Cafe maili

Re: [Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Bas van Dijk
On 3 November 2011 17:38, Twan van Laarhoven wrote: > Perhaps relying on Attoparsec backtracking for picking out the right > alternative from the sum is the problem. You could try it with Maybe: Good idea. I implemented and committed it and the BigSum/fromJSON/generic benchmark goes from 13.6 us

Re: [Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Bas van Dijk
2011/11/3 Claus Reinke : > Not that it matters much if you're going with other tools, but your SYB code > has a long linear chain of type rep comparisons, at every > level of the recursive traversals. That is partially inherent in the SYB > design (reducing everything to cast), but could probably b

Re: [Haskell-cafe] The type class wilderness + Separating instances and implementations into separate packages

2011-11-03 Thread Bas van Dijk
On 3 November 2011 14:56, Ryan Newton wrote: >> Aside: The problem with collections is that we don't have the programming >> language means to do this well yet (although soon!). The issue is that we >> want to declare a type class where the context of the methods depends on the >> instance e.g. >>

Re: [Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Bas van Dijk
For those who find this interesting. Here's the code of the BigSum benchmark with a manual Generic instance with inlined 'from' and 'to': https://gist.github.com/1336426 José, I was thinking about the following idea. Say GHC generates the following instance for BigSum: instance Generic BigSum whe

Re: [Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Bas van Dijk
2011/11/3 José Pedro Magalhães : > - Compile with -O2 and -fno-spec-constr-count (this last one is particularly > important) I already compiled with -O2. Adding -fno-spec-constr-count does not change the results. > - Add {-# INLINE [1] #-} pragmas to the to/from methods of your Generic > instance

[Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Bas van Dijk
Hello, I recently added default generic implementations of toJSON and parseJSON to the aeson package. Now I'm optimizing them. Here are some benchmark results that compare: * th: toJSON and fromJSON generated by template-haskell. Can be compared to hand-written code. Should be the fastest of all.

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
On 28 October 2011 16:59, Ertugrul Soeylemez wrote: > I'm not sure whether this will work well.  You will get overlapping > instances, and I don't see a way to hide instances when importing. > Perhaps the OverlappingInstances extension could help here. You're right. I didn't get an overlapping i

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
On 28 October 2011 16:23, Antoine Latter wrote: > I would then need OverlappingInstances to declare a MonadIO instance > for any similar looking instance head (that is `t m`) where 't' was > not a proper MonadTrans instance, which sounds like a common enough > things to do. I actually have never

[Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
Hello, Is it unsafe to add the following catch-all MonadIO instance to transformers' Control.Monad.IO.Class module? {-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-} instance (MonadTrans t, Monad (t m), MonadIO m) => MonadIO (t m) where liftIO = lift . liftIO It cou

Re: [Haskell-cafe] ANN: Monad.Reader Issue 19

2011-10-26 Thread Bas van Dijk
On 26 October 2011 21:17, Brent Yorgey wrote: > I am pleased to announce that Issue 19 of The Monad.Reader, a special > issue on parallelism and concurrency, is now available: Thanks, I always really enjoy The Monad.Reader. > Issue 19 consists of the following three articles: > >  * Mighttpd – a

Re: [Haskell-cafe] New rss maintainer

2011-10-22 Thread Bas van Dijk
I released a new rss: http://hackage.haskell.org//package/rss-3000.2.0 It no longer requires old-time and is tested with the latest versions of its dependencies. On 21 October 2011 17:34, Vincent Hanquez wrote: > Perhaps, unless someone step up, it would be nice to move packages that have > no

Re: [Haskell-cafe] runStateT execution times measurement baffling

2011-10-22 Thread Bas van Dijk
On 20 October 2011 22:16, thomas burt wrote: > Perhaps I will try and force `stuffToDo` not to leave any partially > evaluated thunks behind and compare the cost then. What happens when you switch to a strict StateT? Bas ___ Haskell-Cafe mailing l

Re: [Haskell-cafe] New rss maintainer

2011-10-21 Thread Bas van Dijk
On 20 October 2011 21:27, Bas van Dijk wrote: > Otherwise I could take it over. I probably won't make lots of changes > since I'm a bit swamped at the moment. Just updating it to the latest > versions. I've moved the repository over to github: https://github.com/basvand

Re: [Haskell-cafe] lost in generics

2011-10-20 Thread Bas van Dijk
On 20 October 2011 19:12, Rustom Mody wrote: > And of course which are easier and which more difficult to dig into. If you're looking for an example for the new GHC generic mechanism: I recently added a generic default implementation to the ToJSON and FromJSON type classes of the aeson package (n

[Haskell-cafe] New rss maintainer

2011-10-20 Thread Bas van Dijk
Hello, I've a small patch[1] that updates the rss package to the latest versions of its dependencies. (I'm trying to get the new hackage-server to build on ghc-7.2.1) However Bjorn Bringert told me he's no longer maintaining the package. He asked me to ask you if there's already a new maintainer.

Re: [Haskell-cafe] proper way to generate a random data in criterion

2011-10-19 Thread Bas van Dijk
On 19 October 2011 17:03, Johan Tibell wrote: > Have a look at: > > https://github.com/tibbe/unordered-containers/blob/master/benchmarks/Benchmarks.hs I see you use the (evaluate . rnf) composition. I also used it in: https://github.com/basvandijk/vector-bytestring/blob/master/bench.hs#L118 an

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Bas van Dijk
On 17 October 2011 18:28, Christian Maeder wrote: > Am 17.10.2011 17:26, schrieb Bas van Dijk: >> >> On 17 October 2011 13:12, Christian Maeder >>  wrote: >>> >>> So your package basically supports an unfortunate mix of bytestring and >>> vector fu

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Bas van Dijk
On 17 October 2011 20:15, Yves Parès wrote: > It's a good question, I don't think there is something in the vector library > that can handle chunks of vectors... Yes I forgot about lazy bytestrings when writing that. Of course vector-bytestring does provide lazy ByteStrings. > If both lazy and s

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Bas van Dijk
On 17 October 2011 13:12, Christian Maeder wrote: > Am 17.10.2011 12:14, schrieb Bas van Dijk: >> >> On 17 October 2011 10:18, Christian Maeder >>  wrote: >>> >>> I think the cleanest solution (just from a theoretical point of view) is >>> to >&

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Bas van Dijk
On 17 October 2011 16:44, Michael Snoyman wrote: > On Mon, Oct 17, 2011 at 4:42 PM, Roman Leshchinskiy > wrote: >> Michael Snoyman wrote: >>> On Mon, Oct 17, 2011 at 12:14 PM, Bas van Dijk >>> wrote: >>>> >>>> My idea is that when vector-by

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Bas van Dijk
On 17 October 2011 10:18, Christian Maeder wrote: > I think the cleanest solution (just from a theoretical point of view) is to > use a newtype for your byte strings. > > - it should have the same performance > - allows to make ByteString really abstract when hiding the newtype > constructor But

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-16 Thread Bas van Dijk
On 16 October 2011 08:51, Stephen Tetley wrote: > On 15 October 2011 23:56, Bas van Dijk wrote: >> On 15 October 2011 23:17, Ertugrul Soeylemez wrote: >>> Both instances are valid here, and there is no mechanism to choose one of >>> them. >> >> There

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-15 Thread Bas van Dijk
On 15 October 2011 23:17, Ertugrul Soeylemez wrote: > Both instances are valid here, and there is no mechanism to choose one of > them. There is: OverlappingInstances[1] chooses the most specific instance. So in case someVector :: Vector Word8 the instance Show (Vector Word8) is chosen because i

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-15 Thread Bas van Dijk
On 15 October 2011 20:50, Ertugrul Soeylemez wrote: > Roman Leshchinskiy wrote: > >> > Personally, I think that ByteString and especially Vector Word8 >> > aren't strings and shouldn't be treated as such. But I wouldn't be >> > strongly against showing them as strings. However, I *am* strongly >>

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-15 Thread Bas van Dijk
On 15 October 2011 13:34, Roman Leshchinskiy wrote: > > On 15/10/2011, at 12:26, Roman Leshchinskiy wrote: > >> On 14/10/2011, at 12:37, Bas van Dijk wrote: >> >>> If there's need for a specific Show instance for Vectors of Word8s we >>> can always

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Bas van Dijk
2011/10/14 Yves Parès : > (*) Anyway, is there a place where foldl is preferable over foldl' ? To quote http://www.haskell.org/haskellwiki/Foldr_Foldl_Foldl' : "Usually the choice is between foldr and foldl', since foldl and foldl' are the same except for their strictness properties, so if both r

Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1

2011-10-14 Thread Bas van Dijk
On 14 October 2011 16:47, JP Moresmau wrote: > I must be doing something stupid, but what? Nothing stupid, you're just misinterpreting the value of __GLASGOW_HASKELL__. See: http://www.haskell.org/ghc/docs/latest/html/users_guide/version-numbering.html for the correct interpretation. Bas __

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Bas van Dijk
On 13 October 2011 20:53, Albert Y. C. Lai wrote: > The number of new cons cells created in due course is Θ(length xs). I was actually surprised by this because I expected: length(xs++ys) to fuse into one efficient loop which doesn't create cons cells at all. Unfortunately, I was mistaken since

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Bas van Dijk
On 14 October 2011 13:37, Bas van Dijk wrote: > If there's need for a specific Show instance for Vectors of Word8s we > can always add one directly to vector. (Roman, what are your thoughts > on this?) Ok I have proposed and implemented this for vector: http://trac.haskell.org/ve

  1   2   3   4   5   >