Cats-effect: CE3 Feature: realTimeInstant to get current java.time.Instant

Created on 31 Oct 2020  路  4Comments  路  Source: typelevel/cats-effect

https://gitter.im/typelevel/cats-effect?at=5f9d303b8d286f20767e64ab

Feels like this belong to cats.effect.syntax.ClockOps?

CE 3

Most helpful comment

Looping around to this鈥β營 do see a lot of migration advantages to using the same name as in CE2, but honestly I think the realTime prefix makes this a lot more discoverable and creates a more scalable convention. Thus, realTimeInstant

All 4 comments

I think it should be in Clock. Or rather, ClockPlatform (which doesn't currently exist). Nothing should be in any of the Ops classes without directly peering to something in the main typeclass.

To be clear, this function would be JVM-specific (just like the one in CE2) so as to avoid the Instant dependency on ScalaJS.

@aeons thanks I'll change it. (Though I think now* has better discoverability. Not sure how I'll name the js Date one either.. jsDateNow? :grimacing: )

Looping around to this鈥β營 do see a lot of migration advantages to using the same name as in CE2, but honestly I think the realTime prefix makes this a lot more discoverable and creates a more scalable convention. Thus, realTimeInstant

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Daenyth picture Daenyth  路  3Comments

Odomontois picture Odomontois  路  8Comments

Daenyth picture Daenyth  路  3Comments

tpolecat picture tpolecat  路  5Comments

kailuowang picture kailuowang  路  5Comments