Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoOpen externally defined module

Tags:

module

f#

Is there a way to AutoOpen an externally defined module? I'd like it to be available throughout a project without opening it in every file. Something like this would be ideal:

[<AutoOpen>]
module MyModule = YourNamespace.YourModule //ERROR: Ignoring attributes on module abbreviation

I tried this too, which would (hypothetically) make an externally defined module part of the public interface of a new module.

module MyModule = 
  module public YourModule = YourNamespace.YourModule //ERROR: Ignoring accessibility attribute on module abbreviation. Module abbreviations are always private.
like image 627
Daniel Avatar asked Nov 14 '22 22:11

Daniel


1 Answers

That's a good question - it would make sense to allow this. Alternative would be to have some compiler argument to automatically open namespace/module, but I don't think there is one currently.

(There doesn't seem to be a better answer than what I wrote in the comment, so I copied it as an answer)

like image 121
Tomas Petricek Avatar answered Jan 01 '23 19:01

Tomas Petricek