How to get type of the module in F#

You could add a marker type to the module and then discover the module’s type from that:

module Foo =  
    type internal Marker = interface end
    let t = typeof<Marker>.DeclaringType

Leave a Comment