Re: [Haskell-cafe] Yet another Conduit question

2013-02-04 Thread Kevin Quick
While on the subject of conduits and timing, I'm using the following conduit to add elapsed timing information: timedConduit :: MonadResource m => forall l o u . Pipe l o o u m (u, NominalDiffTime) timedConduit = bracketP getCurrentTime (\_ -> return ()) inner where inner st = do r <- aw

Re: [Haskell-cafe] Ticking time bomb

2013-01-31 Thread Kevin Quick
Git has the ability to solve all of this. ... 2. Uploads to hackage either happen through commits to the git repository, or an old-style upload to hackage automatically creates a new anonymous branch in the git repository. 3. The git repository is authorative. Signing releases, code reviews

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-01 Thread Kevin Quick
On Wed, 01 Feb 2012 19:42:19 -0700, AntC wrote: A piece of background which has perhaps been implicit in the discussions up to now. Currently under H98: f.g-- (both lower case, no space around the dot) Is taken as function composition -- same as (f . g). f. g -- is tak

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-01 Thread quick
fear I've mostly wasted people's time on syntactic trivialities already well discussed and dismissed. Please do carry on, it's all good stuff. -KQ Quoting AntC : > Kevin Quick sparq.org> writes: > > > > > > > On Tue, 31 Jan 2012 23:10:34 -0700, A

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-31 Thread Kevin Quick
On Tue, 31 Jan 2012 23:10:34 -0700, Anthony Clayden wrote: I'm proposing x.f is _exactly_ f x. That is, the x.f gets desugared at an early phase in compilation. Anthony, I think part of the concern people are expressing here is that the above would imply the ability to use point-free st

Re: [Haskell-cafe] Avoiding parametric function binding

2012-01-02 Thread Kevin Quick
On Sun, 01 Jan 2012 05:29:42 -0700, Sebastian Fischer wrote: On Sat, Dec 31, 2011 at 4:09 PM, Kevin Quick wrote: onVarElem :: forall a . (Show a) => (Maybe a -> String) -> Var -> String The problem is the scope of the quantification of the type variable 'a'. You can

Re: [Haskell-cafe] Avoiding parametric function binding

2011-12-31 Thread Kevin Quick
On Sat, 31 Dec 2011 08:50:05 -0700, Stephen Tetley wrote: Maybe you want a deconstructor (sometime called an eliminator)? deconsVar :: (Maybe Int -> a) -> (Maybe String -> a) -> Var -> a deconsVar f g (V1 a) = f a deconsVar f g (V2 b) = g b That works and has the advantage of allowing a si

[Haskell-cafe] Avoiding parametric function binding

2011-12-31 Thread Kevin Quick
I'm having some difficulty avoiding a tight parametric binding of function parameters, which is limiting the (de)composability of my expressions. I'm curious as to whether there is an option or method I haven't tried to achieve this. Here's an example test case: data Var = V1 (Maybe Int)

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Kevin Quick
On Sun, 24 Jul 2011 07:30:56 -0700, Mark Spezzano wrote: Hi all, I would appreciate it if someone can point me in the right direction with the following problem. I'm deliberately implementing a naive Queues packages that uses finite lists as the underlying representation. I've already

Re: [Haskell-cafe] pointer equality

2011-07-20 Thread quick
Quoting Thiago Negri : > Hello all, > I'm a newbie at Haskell and I was not aware of this problem. > So, equality comparison can run into an infinite-loop? Yes, comparing infinite lists is a non-terminating computation. > My current knowledge of the language tells me that everything is > Haskel

Re: [Haskell-cafe] HUnit false-positive stumper

2011-06-06 Thread quick
That sounds very applicable to my issue (and unfortunately my googling missed this, ergo my consult of haskell-cafe uberwissenmensch). When I again have access to the aforementioned Mac this evening I'll try both disabling optimizations and a tweaked HUnit to see if that resolves the problem an

Re: [Haskell-cafe] Oracle Sessions in Takusen

2011-06-02 Thread Kevin Quick
Dmitry, I'm not directly familiar with Takusen or its use with OracleDB, but I would hazard a guess that the withSession is doing FFI resource management and that resources obtained inside the withSession environment are no longer valid outside of the withSession. If this is the case then

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread quick
Quoting Antoine Latter : > On May 25, 2011 11:08 AM, "KQ" wrote: > > > > The HackageDB could the provide this information in the description page > of a package, and it could even automatically cross-reference and supplement > the referred package descriptions, so that if you are looking at the P

Re: [Haskell-cafe] impoosible dependencies

2011-04-20 Thread Kevin Quick
On Wed, 20 Apr 2011 15:18:21 -0700, Rogan Creswick wrote: On Wed, Apr 20, 2011 at 2:51 PM, Kevin Quick wrote: $ cabal update $ cabal install hakyll Resolving dependencies... cabal: dependencies conflict: ghc-6.12.3 requires unix ==2.4.0.2 however unix-2.4.0.2 was excluded because ghc-6.12.3

[Haskell-cafe] impoosible dependencies

2011-04-20 Thread Kevin Quick
Hmmm... $ cabal update $ cabal install hakyll Resolving dependencies... cabal: dependencies conflict: ghc-6.12.3 requires unix ==2.4.0.2 however unix-2.4.0.2 was excluded because ghc-6.12.3 requires unix ==2.4.1.0 $ Any advice (other than upgrading to 7.0.3, which is not an option at the moment

Re: [Haskell-cafe] Fun with the ST monad

2011-02-26 Thread Kevin Quick
tput is reasonable: $ ls -1sh *.example* 4.9M input.example 4.9M output.example1 4.9M output.example2 4.9M output.example3 4.9M output.example4 4.9M output.example5 4.9M output.example6 Hopefully this has been a useful comparison of using Iteratee techniques in relation to more conventional monad

Re: [Haskell-cafe] Fun with the ST monad

2011-02-25 Thread Kevin Quick
On Thu, 24 Feb 2011 13:45:59 -0700, Andrew Coppin wrote: The input list is being read from disk by lazy I/O. With the original implementation, the input file gets read at the same time as the output file is written. But runST returns nothing until the *entire* input has been compressed. So

Re: [Haskell-cafe] Cmdargs and common flags

2011-01-24 Thread Kevin Quick
Magnus, I used the following technique, but it was a couple of iterations of CmdArgs ago: data UIMode = Normal | Batch | Query deriving (Data,Typeable,Show,Eq) uimode_arg :: forall t. t -> UIMode uimode_arg _ = enum Normal [ Batch &= flag "B" & text "batch mode (no interaction)

Re: [Haskell-cafe] possible bug in default module lookup scheme / or invalid haskell?

2010-07-19 Thread Kevin Quick
On Sun, 18 Jul 2010 12:02:39 -0700, Carter Schonwald wrote: nope, I was suggesting rather: ./A.hs has module A which has an import A.B line ./A/ has B.hs with module A.B which imports A.B.C /C which has module A.B.C in file C.hs I think this scenario should work -carter It's an int

Re: [Haskell-cafe] possible bug in default module lookup scheme / or invalid haskell?

2010-07-18 Thread Kevin Quick
On Sat, 17 Jul 2010 22:45:57 -0700, Ivan Lazar Miljenovic wrote: Carter Schonwald writes: Hello All, I'm not sure if this either a bug in how ghc does path/module lookup or it simply is invalid haskell: consider modules A, A.B and A.B.C where A imports A.B, and A.B imports A.B.C with th

Re: [Haskell-cafe] bug in ghci ?

2010-07-09 Thread Kevin Quick
On Fri, 09 Jul 2010 18:57:34 -0700, Edward Kmett wrote: I hope the above demonstrate that there are at least some fairly reasonable (and, given your request, appropriately category theoretic!) examples where one would want the ability to specify that there is more than one member of a minimal mu

Re: [Haskell-cafe] bug in ghci ?

2010-07-09 Thread Kevin Quick
On Fri, 09 Jul 2010 16:26:13 -0700, Ivan Lazar Miljenovic wrote: "Kevin Quick" writes: I would think that only mutually recursive default methods would require respecification and that there could be any number of default methods that were reasonable as is. Since it's

Re: [Haskell-cafe] bug in ghci ?

2010-07-09 Thread Kevin Quick
On Thu, 08 Jul 2010 09:48:34 -0700, Daniel Fischer wrote: On Thursday 08 July 2010 18:24:05, Ben Millwood wrote: On Thu, Jul 8, 2010 at 3:45 PM, Daniel Fischer wrote: > Well, I made the suggestion of emitting a warning on instance > declarations without method definitions. That would be co

Re: [Haskell-cafe] Canonical Graphviz code

2010-07-06 Thread Kevin Quick
On Mon, 05 Jul 2010 19:26:34 -0700, Ivan Miljenovic wrote: Graphviz (http://graphviz.org/) has the option to convert provided Dot code for visualising a graph into a canonical form. For example, take the sample Dot code: [snip] I've recently thought up a way that I can duplicate this functi

[Haskell-cafe] GHC AT inference bug?

2010-07-04 Thread Kevin Quick
I started with the following: {-# LANGUAGE TypeFamilies #-} class DoC a where type A2 a op :: a -> A2 a data Con x = InCon (x (Con x)) type FCon x = x (Con x) foldDoC :: Functor f => (f a -> a) -> Con f -> a foldDoC f (InCon t) = f (fmap (foldDoC f) t) doCon :: (DoC (FCon x)) => Con

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Sat, 03 Jul 2010 13:28:44 -0700, Dan Doel wrote: As a side note, although I agree it abuses the fundeps intent, it was handy for the specific purpose I was implementing to have a "no-op/passthrough" instance of op. In general I like the typedef approach better, but it

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Sat, 03 Jul 2010 12:48:56 -0700, Dan Doel wrote: Then the instance declares infinitely many instances C Bool a a. This is a violation of the fundep. Based on your error message, it looks like it ends up treating the instance as the first concrete 'a' it comes across, but who knows? Hmmm..

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Wed, 23 Jun 2010 00:14:03 -0700, Simon Peyton-Jones wrote: I'm interested in situations where you think fundeps work and type families don't. Reason: no one knows how to make fundeps work cleanly with local type constraints (such as GADTs). Simon, I have run into a case where fundeps+

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Sat, 01 May 2010 15:42:09 -0700, Ivan Lazar Miljenovic wrote: instance Graph GrB where -- instance (Cls a) => Graph GrB where -- error: ambiguous constraint, must mention type a -- instance (Cls a) => forall a. Graph GrB where -- error: malformed instance header -- instance (Cls a) Graph

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Sat, 01 May 2010 01:01:47 -0700, Sebastian Fischer wrote: On May 1, 2010, at 8:08 AM, Ivan Lazar Miljenovic wrote: * I can't redefine the Graph methods to introduce the (Cls a) constraint [reasonable] Not sure if you can. I think Kevin means that he cannot change the signature of the

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Fri, 30 Apr 2010 23:30:21 -0700, Jason Dagit wrote: On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic < ivan.miljeno...@gmail.com> wrote: You're putting the constraint in the wrong places: put the "(Cls a) => " in the actual functions where you need it. I need to use Cls methods in

[Haskell-cafe] FGL instance constraint

2010-04-30 Thread Kevin Quick
I need help understanding how to express the following: data (Cls a) => B a = B [a] data GrB a b = GrB (B a) instance Graph GrB where ... In the methods for the instance specification, I need to perform Cls a operations on a. * As shown, the compiler complains that it cannot dedu