Define Opt instance for BaseRealType to allow setting/getting via Rational.

This commit is contained in:
Kevin Quick 2021-04-28 08:10:31 -07:00
parent bdcc394836
commit 2a6573713b
No known key found for this signature in database
GPG Key ID: E6D7733599CC0A21

View File

@ -983,6 +983,10 @@ instance Opt BaseBoolType Bool where
getMaybeOpt x = fmap fromConcreteBool <$> getOption x
trySetOpt x v = setOption x (ConcreteBool v)
instance Opt BaseRealType Rational where
getMaybeOpt x = fmap fromConcreteReal <$> getOption x
trySetOpt x v = setOption x (ConcreteReal v)
-- | Given a unicode text value, set the named option to that value or
-- generate an OptSetFailure exception if the option is not a unicode
-- text valued option.