
Thanks for the quick answer. Indeed, I confused Read and ReadP! --Andreas On 2021-08-14 19:06, chessai wrote:
Looking at the source code [1], Read is derived, and not using parseVersion (which has the behaviour I think you expect).
You may want to use parseVersion directly.
[1]: https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Data-Version.html https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Data-Version.html
On Sat, Aug 14, 2021, 11:55 Andreas Abel
mailto:andreas.abel@ifi.lmu.de> wrote: How is the parser for Data.Version supposed to work?
```haskell import Data.Version
readVersion :: String -> Version readVersion = read
main :: IO () main = print $ readVersion "8.10.5"
-- *** Exception: Prelude.read: no parse ```
P.S.: Maintainer libraries@haskell.org mailto:libraries@haskell.org _______________________________________________ Libraries mailing list Libraries@haskell.org mailto:Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries