Re: [Haskell-cafe] Instrumentation without requiring code-level changes?

Yes, I think so, with the PackageImports extension.
https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_ guide/syntax-extns.html#package-imports
Thank you for this. If this works, it makes using instrumentedscotty & instrumentedopaleye easier to use.. Btw, there's a note in the docs: [...] Note: you probably don't need to use this feature, it was added mainly so that we can build backwards-compatible versions of packages when APIs change. It can lead to fragile dependencies in the common case: modules occasionally move from one package to another, rendering any package-qualified imports broken. [...] I hope GHC doesn't plan to remove this extension any time soon. -- Saurabh.

I doubt it'll be removed, it's occasionally useful and I don't think it
costs much to maintain.
The note does indicate that your proposed usage isn't exactly recommended,
and I agree: I would instrument everything all the time, to avoid all the
problems associated with monkey-patching and having two different sets of
performance characteristics to worry about, but it is at least possible to
do what you're trying to do with this method.
Cheers,
On 27 Jan 2017 08:30, "Saurabh Nanda"
https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_gui de/syntax-extns.html#package-imports
Thank you for this. If this works, it makes using instrumentedscotty & instrumentedopaleye easier to use.. Btw, there's a note in the docs: [...] Note: you probably don't need to use this feature, it was added mainly so that we can build backwards-compatible versions of packages when APIs change. It can lead to fragile dependencies in the common case: modules occasionally move from one package to another, rendering any package-qualified imports broken. [...] I hope GHC doesn't plan to remove this extension any time soon. -- Saurabh.

The PackageImports hack doesn't seem to be working. Is this a peculiarity
of the extension, or of GHCi, or have I gotten the imports/exports wrong --
https://gist.github.com/saurabhnanda/cab87791d38cca3bfe2cce66cead9080
Note: The package-qualified import and my package name are the **same**
On Fri, Jan 27, 2017 at 2:08 PM, David Turner wrote: I doubt it'll be removed, it's occasionally useful and I don't think it
costs much to maintain. The note does indicate that your proposed usage isn't exactly recommended,
and I agree: I would instrument everything all the time, to avoid all the
problems associated with monkey-patching and having two different sets of
performance characteristics to worry about, but it is at least possible to
do what you're trying to do with this method. Cheers, On 27 Jan 2017 08:30, "Saurabh Nanda" Yes, I think so, with the PackageImports extension. https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_gui
de/syntax-extns.html#package-imports Thank you for this. If this works, it makes using instrumentedscotty &
instrumentedopaleye easier to use.. Btw, there's a note in the docs: [...] Note: you probably don't need to use this feature, it was added
mainly so that we can build backwards-compatible versions of packages when
APIs change. It can lead to fragile dependencies in the common case:
modules occasionally move from one package to another, rendering any
package-qualified imports broken. [...] I hope GHC doesn't plan to remove this extension any time soon. -- Saurabh.

The PackageImports hack doesn't seem to be working. Is this a peculiarity of the extension, or of GHCi, or have I gotten the imports/exports wrong -- https://gist.github.com/saurabhnanda/cab87791d38cca3bfe2cce66cead9080
Note: The package-qualified import and my package name are the **same**
Have put this question upon on StackOverflow for greater visibility -- http://stackoverflow.com/questions/41896211/how-to-use-packageimports-extens... -- Saurabh.

The PackageImports hack doesn't seem to be working. Is this a peculiarity
of the extension, or of GHCi, or have I gotten the imports/exports wrong -- https://gist.github.com/saurabhnanda/cab87791d38cca3bfe2cce66cead9080
Note: The package-qualified import and my package name are the **same**
Have put this question upon on StackOverflow for greater visibility -- http://stackoverflow.com/questions/41896211/how-to-use- packageimports-extension-to-shadow-a-module
And I managed to find a solution after scratching my head around yet another Haskell limitation related to modules! http://stackoverflow.com/a/41906492/534481 -- http://www.saurabhnanda.com
participants (2)
-
David Turner
-
Saurabh Nanda