We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With type-level ints, we can actually specify what the bounds are for a given type. For example...
class (Bounded a, Enum a) <= BoundedEnumTL min step max a where toEnumTL :: Proxy Int -> a
This would enable one to use toEnum without incurring the Maybe wrapper.
toEnum
Maybe
instance BoundedEnumTL 0 1 23 Hour where toEnumTL p = Hour $ reflectType p -- cardinality could likely be calculated cardinalityTL :: BoundedEnumTL min step max => ... => Proxy Int toEnumTL (Proxy :: Proxy 4) == Hour 4 toEnumTL (Proxy :: Proxy 26) -- compiler error
See also purescript/purescript-datetime#96
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With type-level ints, we can actually specify what the bounds are for a given type. For example...
This would enable one to use
toEnum
without incurring theMaybe
wrapper.See also purescript/purescript-datetime#96
The text was updated successfully, but these errors were encountered: