typelevel / general

Repository for general Typelevel information, activity and issues
19 stars 8 forks source link

Submitting singleton-ops for Typelevel incubator membership #54

Closed soronpo closed 7 years ago

soronpo commented 7 years ago

@fthomas and I would like to submit the singleton-ops library for Typelevel incubator membership. Link to the library

Example of what singleton-ops can do today:

import singleton.ops._

class MyVec[L] {
  def doubleSize = new MyVec[2 * L]
  def nSize[N] = new MyVec[N * L]
}
object MyVec {
  implicit def apply[L](implicit check : Require[L > 0]) : MyVec[L] = new MyVec[L]()
}
val myVec : MyVec[10] = MyVec[4 + 1].doubleSize
val myBadVec = MyVec[-1] //fails compilation, as required
larsrh commented 7 years ago

Cool stuff! Please have a look at e.g. #48 and clarify the following points:

  1. There must be a consensus amongst the project's stakeholders that they want to join Typelevel.
  2. The project must be willing to support the Typelevel code of conduct or something equivalent.
  3. The project should be aiming to promote pure, typeful, idiomatic functional programming in Scala.
  4. If the primary output of the project is software artefacts then it should aim to complement them with accessible, idiomatic documentation.

See also the membership criteria.

soronpo commented 7 years ago
  1. Yes. The project's stakeholders (@fthomas & I) have a consensus and we wish to join Typlevel.
  2. We support Typelevel CoC. Once added to Typelevel, I'll modify the README to reflect that.
  3. That is the goal. In fact for the next PR I'm aiming to get rid of While (which was only added as proof of concept) and instead add For.
  4. We have a document in the README. Yes, it needs to be expanded. My personal goal of singleton-ops is that you won't need any documents to make it work for the common use case. Using typelevel singleton operations should be intuitive, and with singleton-ops, it mostly is.
larsrh commented 7 years ago

@soronpo Welcome! Please add yourself to the incubator by sending a PR. (And sorry for the long wait!)