Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/obsidiansystems/dependent-sum-template
Template Haskell code to generate instances of classes in some package
https://github.com/obsidiansystems/dependent-sum-template
haskell template-haskell
Last synced: about 1 month ago
JSON representation
Template Haskell code to generate instances of classes in some package
- Host: GitHub
- URL: https://github.com/obsidiansystems/dependent-sum-template
- Owner: obsidiansystems
- Created: 2018-09-28T05:17:55.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2024-02-05T22:07:49.000Z (11 months ago)
- Last Synced: 2024-04-26T00:30:58.718Z (8 months ago)
- Topics: haskell, template-haskell
- Language: Haskell
- Homepage:
- Size: 78.1 KB
- Stars: 1
- Watchers: 21
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: ReadMe.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
dependent-sum-template [![Build Status](https://travis-ci.org/obsidiansystems/dependent-sum-template.svg)](https://travis-ci.org/obsidiansystems/dependent-sum-template) [![Hackage](https://img.shields.io/hackage/v/dependent-sum-template.svg)](http://hackage.haskell.org/package/dependent-sum-template)
==============This library defines [Template Haskell](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/template_haskell.html) functions for deriving the `GEq`, `GCompare`, `GShow`, and `GRead` functions from the [`some`](https://hackage.haskell.org/package/some) library.
- `GEq tag` is similar to an `Eq` instance for `tag a` except that with `geq`, values of types `tag a` and `tag b` may be compared, and in the case of equality, evidence that the types `a` and `b` are equal is provided.
- `GCompare tag` is similar to the above for `Ord`, and provides `gcompare`, giving a `GOrdering` that gives similar evidence of type equality when values match.
- `GShow tag` means that `tag a` has (the equivalent of) a `Show` instance.
- `GRead tag` means that `tag a` has (the equivalent of) a `Read` instance.