criterion-0.9.0.0 does not build against cassava-0.3.0.0 #34

Closed
Gabriel439 opened this Issue Jan 19, 2014 · 1 comment

Projects

None yet

2 participants

@Gabriel439
Contributor

The issue is that cassava's encode function now expects a list instead of a vector. The encode function from cassava-0.2.2.0 had type:

encode :: ToRecord a => Vector a -> ByteString

In cassava-0.3.0.0 it now has type:

encode :: ToRecord a => [a] -> ByteString

This causes problems when building Criterion.IO.Printf (and possibly other modules, but this is as far as I got):

Criterion/IO/Printf.hs:102:56:
    Could not deduce (G.Vector [] a)
      arising from a use of `G.singleton'
    from the context (Csv.ToRecord a)
      bound by the type signature for
                 writeCsv :: Csv.ToRecord a => a -> Criterion ()
      at Criterion/IO/Printf.hs:(99,1)-(103,24)
    Possible fix:
      add (G.Vector [] a) to the context of
        the type signature for
          writeCsv :: Csv.ToRecord a => a -> Criterion ()
      or add an instance declaration for (G.Vector [] a)
    In the second argument of `(.)', namely `G.singleton'
    In the second argument of `(.)', namely `Csv.encode . G.singleton'
    In the second argument of `(.)', namely
      `B.appendFile fn . Csv.encode . G.singleton'

I'd issue a pull request, but I wasn't sure if you wanted to immediately switch to cassava-0.3.0.0 or still support cassava-0.2.2.0 or do some CPP magic to support both.

@bos
Owner
bos commented Jan 21, 2014

Thanks for spotting this. I'm fine with just upgrading to the new cassava unconditionally.

@bos bos pushed a commit that closed this issue Jan 22, 2014
@Gabriel439 Gabriel439 Fixed to build against `cassava-0.3.0.0`. Fixes #34
`cassava-0.3.0.0` changed `encode` to accept a list instead of a vector.  This
patch changes `Criterion.IO.Printf` to use the new `encode`, and also sets
a lower bound of `cassava-0.3.0.0`.
4f3b44c
@bos bos closed this in 4f3b44c Jan 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment