Skip to content

Instantly share code, notes, and snippets.

@erikerlandson
Created April 16, 2020 22:49
Show Gist options
  • Save erikerlandson/0fa59614559f4a6b110fabc3e0a3d18a to your computer and use it in GitHub Desktop.
Save erikerlandson/0fa59614559f4a6b110fabc3e0a3d18a to your computer and use it in GitHub Desktop.
casting numeric literal types at comile time
// XDouble, ToDouble, OpAuxDouble from singleton-ops
// Greater from refined
implicit def impliesGTGT[L, R, LD <: XDouble, RD <: XDouble](implicit
ld: OpAuxDouble[ToDouble[L], LD],
rd: OpAuxDouble[ToDouble[R], RD],
q: OpAuxBoolean[LD >= RD, true]): Greater[L] ==> Greater[R] =
new Implies[Greater[L], Greater[R]] {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment