Kleidukos / print-api

Dump the declarations of Haskell modules
11 stars 1 forks source link

Package versions in API dump? Is this the intended behaviour? #14

Open alaendle opened 2 months ago

alaendle commented 2 months ago

Guess this is to avoid some ambiguities of symbols, but for some identifier I get packages with versions in my API dump.

E.g.

Call :: forall (m :: * -> *). bytestring-0.11.5.3:Data.ByteString.Internal.Type.ByteString -> Faas m (Data.Either.Either (GHC.Types.Int, bytestring-0.11.5.3:Data.ByteString.Internal.Type.ByteString) (bytestring-0.11.5.3:Data.ByteString.Internal.Type.ByteString, bytestring-0.11.5.3:Data.ByteString.Internal.Type.ByteString))

Or the same with aeson:

SetModuleTwinHandler :: forall a1 (m :: * -> *). (GHC.Classes.Eq a1, aeson-2.2.3.0:Data.Aeson.Types.FromJSON.FromJSON a1) => (a1 -> m ()) -> IoTHub m ()

But his just creates noise if the aeson/bytestring version changes, and also it feels inconsistent - e.g. Either or Int are not "package-prefixed".

Kleidukos commented 2 months ago

To answer your last sentence, I imagine it's because base and ghc-internal are not re-installable, and as such the version does not matter.

Kleidukos commented 2 months ago

This certainly makes me think about using a different backend for the interface dump. Thanks for reporting this.

andreabedini commented 2 months ago

How about this: hide the unit-id by default and show it only when there are multiple instances of a same package name (or requested by the user with a flag perhaps).

It requires a bit logic but nothing compared to what you have already done.

Kleidukos commented 2 months ago

Yes that could work. :)

Kleidukos commented 1 month ago

@andreabedini you reckon you could come up with a prototype PR for this?