magic-tyfams: Write plugins for magic type families with ease

[ bsd3, compiler-plugin, library ] [ Propose Tags ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.1.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), ghc (>=8.6.3 && <8.8), ghc-tcplugins-extra (>=0.3 && <0.4), syb (>=0.7 && <0.8) [details]
License BSD-3-Clause
Copyright 2019 Sandy Maguire
Author Sandy Maguire
Maintainer sandy@sandymaguire.me
Category Compiler Plugin
Home page https://github.com/https://github.com/isovector/type-sets/tree/master/cmptype#readme
Bug tracker https://github.com/https://github.com/isovector/type-sets/tree/master/cmptype/issues
Source repo head: git clone https://github.com/https://github.com/isovector/type-sets/tree/master/cmptype
Uploaded by isovector at 2019-08-05T21:54:37Z
Distributions
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 1467 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for magic-tyfams-0.1.0.0

[back to package description]

cmptype

Dedication

Comparison is an act of violence against the self.

Iyanla Vanzant

Overview

cmptype provides a magical type family that lets you compare types:

type family CmpType (a :: k) (b :: k) :: Ordering

When you turn on the -fplugin=Type.Compare.Plugin flag, it will let you compare arbitrary types. Why would you want such a thing? Probably because you want to write a type-level container that isn't a fucking list!

Acknowledgments

Big thanks to Boris Rozinov for the initial idea, and for making as much coffee as I could drink while I wrote it. Also thanks to Christiaan Baaij and Matt Pickering for their indispensable help convincing GHC to do the right thing here.