veepee-oss / Vp.FSharp.Sql.Sqlite

F# Wrapper for SQLite using System.Data.SQLite and Vp.FSharp.Sql
https://github.com/veepee-oss/Vp.FSharp.Sql.Sqlite
ISC License
26 stars 3 forks source link

Why [<AbstractClass; Sealed>] for constants ? #6

Closed evilz closed 3 years ago

evilz commented 3 years ago

https://github.com/veepee-oss/Vp.FSharp.Sql.Sqlite/blob/a35d89f3c588ee1f87b4d758a9bdf693f4ea5992/Vp.FSharp.Sql.Sqlite/Types.fs#L45-L46

Why not a module ?

natalie-o-perret commented 3 years ago

Cause under some specific circumstances (lib as dep + release conf), the initialization of a let binding (variable) in a module can be omitted by the compiler: see https://stackoverflow.com/questions/61937274/do-aggressive-f-compiler-optimizations-only-occur-on-referenced-dependencies

This doesn't occur with static classes.