Thomas
Thomas

Reputation: 12137

Is is possible to alias a module with another name in F#

let's say I have this:

module A =
    let a () =
        printfn "%A" DateTime.UtcNow

is there a way to do something like

type B = A
B.a()

or, any other mechanism that would allow to set up an alias?

Upvotes: 7

Views: 400

Answers (1)

Tomas Petricek
Tomas Petricek

Reputation: 243096

You can alias modules in F#, but the syntax is module <NewName> = <OldName>:

module A =
    let a () =
        printfn "%A" DateTime.UtcNow

module B = A
B.a()

Upvotes: 9

Related Questions