Re:The Early History of F# [pdf]
by UK-Al05 on Saturday June 13, 2020 @05:30AM
(#23508147)
F# does have type alias.
It takes the form
type newname = oldname
You can do things like
type LoadReceipt = RecordId -> Record
let sqlLoad: LoadReceipt = implementation
let noSqlLoad: LoadReceipt = implementation
You can use it like an interface, and accept loadReceipt functions for anyone who needs to load receipts... Then partially apply a SQL version, noSQL version etc.
It takes the form
type newname = oldname
You can do things like
type LoadReceipt = RecordId -> Record
let sqlLoad: LoadReceipt = implementation
let noSqlLoad: LoadReceipt = implementation
You can use it like an interface, and accept loadReceipt functions for anyone who needs to load receipts... Then partially apply a SQL version, noSQL version etc.
I use this in my code.