Alex Rivera | Logout

Split F# modules across multiple files

Asked 2009-04-27T13:41:19.143
43

Is it possible to split an F# module across files?

According to the book I have it is, but the book is probably outdated (Foundations of F#)

Edit
Report

1 Answer

4

I sometimes split a type over several places, like this:

module Foo

type Partial = Bar | BarInt of int

module Bar

type Foo.Partial with
    member x.Extend = 5


let b = Foo.Bar.Extend

where modules Foo and Bar are in different files.

answered 2009-04-27T16:17:24.650

Your Answer