Comments (7)
I've pushed this to master.
from github.
Re-opening because, well, that broke everything.
from github.
I've pushed this to master: derive Read
for each data type except Error
.
from github.
The Read
instances take horribly long to compile with -O
(the default with cabal install
). Removing them cuts down compilation time of "Github/Data/Definitions.hs" from 1m18s to 17s (with ghc-7.4, with ghc-7.0.4 it was over 3 minutes); -O0
also helps a lot.
@mike-burns @joeyh can you verify this?
As far as I know, Read
is not very popular, because derived instances have the reputation to be very slow. There is even something on that in the Report ("The parsing techniques used by the reader are very inefficient; reading a large structure may be quite slow.").
Maybe adding ToJSON
instances would be a more useful alternative (would also close #9). We may need some of them anyway, when adding support for POST/PATCH requests.
@joeyh would JSON serialization/deserialization be suitable for your use case, or do you rely on Read
for some reason?
from github.
Simon Hengel wrote:
@joeyh would JSON serialization/deserialization be suitable for your use case, or do you rely on
Read
for some reason?
I'd be happy with JSON serialization.
see shy jo
from github.
It should be possible to automatically derive FromJSON/ToJSON with template Haskell.
module Util where
import qualified Data.Char as Char
convertCamelCase :: String -> String
convertCamelCase = foldr f []
where
f x xs
| Char.isUpper x = '_' : Char.toLower x : xs
| otherwise = x : xs
An then the following should work:
$(deriveJSON (drop 5 . convertCamelCase) ''Repo)
from github.
Closing this issue as a duplicate of #9. I've removed the Read
instances from master.
from github.
Related Issues (20)
- Unknown MergeableState: draft HOT 1
- Build error with GHC 8.10.1 HOT 4
- `isValidPayload` should use constant time comparison for secrets
- the very first example does not work HOT 4
- Where is version 0.25? HOT 2
- DNS errors cause IO exceptions HOT 2
- Add repo statistics
- Add support for `requested_teams` to `PullRequest` HOT 1
- Add support for GitHub Actions HOT 1
- Release a version for GHC 9.0 to hackage HOT 4
- github-0.7.4 needs a revision HOT 2
- Update samples to reflect with current APIs HOT 1
- On GHC 9.2: Blocked on dependencies HOT 4
- `cabal test` succeeds silently if no `GITHUB_TOKEN` is set HOT 1
- searchIssuesR leads to an error from GitHub when searching by multiple conditions HOT 2
- Allow vector-0.13
- Allow passing a JWT as an authentication method HOT 1
- Support GHC 9.6
- Teams API is being deprecated
- For issues, get field `state_reason` to distinguish issues closed as `not_planned`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github.