refined icon indicating copy to clipboard operation
refined copied to clipboard

Support for FiniteDuration

Open etspaceman opened this issue 6 years ago • 5 comments

#397 had some discussion about whether or not this library supports FiniteDuration. It seems to be a pretty standard use-case - I'd like to see some official support for it in this library.

etspaceman avatar Mar 13 '19 19:03 etspaceman

I've just spent some time looking into how to write my own predicates for this, but looks hard! But +1 - i'd like this

henricook avatar Apr 30 '19 14:04 henricook

I wrote a bit about supporting FiniteDuration here. @etspaceman It would help if you could provide one or two examples how you would refine FiniteDuration.

fthomas avatar May 01 '19 07:05 fthomas

Sorry for the late response here! I would largely treat it like a numeric instance myself. Things like Positive, NonNegative, etc would be my most highly used thing.

etspaceman avatar May 31 '19 17:05 etspaceman

Ok, this would be possible with the LengthInSeconds predicate mentioned in #633, i.e. FiniteDuration Refined LengthInSeconds[NonNegative], etc.

fthomas avatar May 31 '19 18:05 fthomas

Yes I've done similar things, but have dropped the usage as the auto package does not support FiniteDuration. That's mainly why I opened this ticket. Without auto support, using this for FiniteDuration literals becomes a big pain.

etspaceman avatar May 31 '19 19:05 etspaceman