Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created April 18, 2014 21:27
Show Gist options
  • Select an option

  • Save pedrofurla/11065158 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/11065158 to your computer and use it in GitHub Desktop.
case class ElapsedTime[CC[_]](time: CC[Chronon]) { type HK[a] = CC[a] }
object ElapsedTime {
class ETFunctor[CC[_]](implicit evf: Functor[CC])
extends Functor[({type λ[α]=ElapsedTime[CC]})#λ]
// Functor[ElapsedTime[CC]#HK]
{
def map[A, B](fa: ElapsedTime[CC])(f: Chronon => Chronon): ElapsedTime[CC] = ElapsedTime(evf.map(fa.time)(f))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment