Skip to content

Instantly share code, notes, and snippets.

@longliveenduro
Last active December 28, 2015 05:39
Show Gist options
  • Select an option

  • Save longliveenduro/7451382 to your computer and use it in GitHub Desktop.

Select an option

Save longliveenduro/7451382 to your computer and use it in GitHub Desktop.
/**
* Implicit conversions from C[JodaDateTime] -> C[ThriftDateTime]
* Use import scalaz._ and Scalaz._ to get implicit functors for Option, List etc.
*/
implicit def liftConversionJodaToThrift[C[_]](wrappedJoda: C[JodaDateTime])
(implicit func: Functor[C]): C[ThriftDateTime] =
func.map(wrappedJoda)(datetimeToThrift)
/**
* Implicit conversions from C[ThriftDateTime] -> C[JodaDateTime]
* Use import scalaz._ and Scalaz._ to get implicit functors for Option, List etc.
*/
implicit def liftConversionThriftToJoda[C[_]](wrappedThriftDateTime: C[ThriftDateTime])
(implicit func: Functor[C]): C[JodaDateTime] =
func.map(wrappedThriftDateTime)(thriftToDatetime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment