When I use the open keyword in F#
module AnotherModule
open myFSharpModule
Can this be thought of as a mixin in Ruby or a trait in Scala? I was thinking the other day how i wish that F# had these features, but then it occurred to me that the open keyword may be the same thing. In a way, it just copies the referenced module into the module you are defining.
In F#,
openis just importing declarations to be accessible from the scope you’re importing them.It does not make those declarations part of your module, it’s just so that you can reference them without qualification from within your module.
The equivalent in Scala is
import, in Ruby it’srequire.