F# Book Suggestions?
-
Been learning F# through the MS F# reference source but it seems very contradictory in some areas and devoid of meaningful explanation in others. I found the [F# foundation site](https://fsharp.org/learn/) which has some good reference material but I was curious if anyone here has a good book recommendation from their list or elsewhere? I'm the type that wants to know exactly what something does and why it's useful, not just told to use x in situation y, and unfortunately in my experience a lot of tutorial-type books tend to avoid those more difficult questions. For example, I'd love to figure out why
type Class6<'T when 'T : (member Property1: int)>=class end
is used as a [legal example of a generic](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/constraints) in the MS F# reference source when that same documentation says member constraints can only be used with [statically resolved type parameters](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters), not normal generics. Or why structs are even a thing in F# considering struct records accomplish all of the same things, PLUS they play nice with type inference in situations like pattern matching where normal structs require awhen
clause. :doh: -
Been learning F# through the MS F# reference source but it seems very contradictory in some areas and devoid of meaningful explanation in others. I found the [F# foundation site](https://fsharp.org/learn/) which has some good reference material but I was curious if anyone here has a good book recommendation from their list or elsewhere? I'm the type that wants to know exactly what something does and why it's useful, not just told to use x in situation y, and unfortunately in my experience a lot of tutorial-type books tend to avoid those more difficult questions. For example, I'd love to figure out why
type Class6<'T when 'T : (member Property1: int)>=class end
is used as a [legal example of a generic](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/constraints) in the MS F# reference source when that same documentation says member constraints can only be used with [statically resolved type parameters](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters), not normal generics. Or why structs are even a thing in F# considering struct records accomplish all of the same things, PLUS they play nice with type inference in situations like pattern matching where normal structs require awhen
clause. :doh:Jon McKee wrote:
Or why structs are even a thing in F#
The same reason you have `byref`s and other "strange" things... interoperability with .NET ecosystem and to obey CLS/CTS.
-
Jon McKee wrote:
Or why structs are even a thing in F#
The same reason you have `byref`s and other "strange" things... interoperability with .NET ecosystem and to obey CLS/CTS.
Yea, I'll have to dig deeper into this because it seems like struct records are just a strictly better version of a basic struct. You can still use the
IsByRefLikeAttribute
too. It probably will end up being some edge-case interoperability like you mentioned :thumbsup: -
Yea, I'll have to dig deeper into this because it seems like struct records are just a strictly better version of a basic struct. You can still use the
IsByRefLikeAttribute
too. It probably will end up being some edge-case interoperability like you mentioned :thumbsup:As for a book, I doubt you'll find one that go into more bizarre language details. I read Expert F# [Apress] and Programming F# [O’Reilly]. I enjoyed the second one better, but seems like there are no newer editions which would cover more recent versions of the language.
-
As for a book, I doubt you'll find one that go into more bizarre language details. I read Expert F# [Apress] and Programming F# [O’Reilly]. I enjoyed the second one better, but seems like there are no newer editions which would cover more recent versions of the language.
-
Been learning F# through the MS F# reference source but it seems very contradictory in some areas and devoid of meaningful explanation in others. I found the [F# foundation site](https://fsharp.org/learn/) which has some good reference material but I was curious if anyone here has a good book recommendation from their list or elsewhere? I'm the type that wants to know exactly what something does and why it's useful, not just told to use x in situation y, and unfortunately in my experience a lot of tutorial-type books tend to avoid those more difficult questions. For example, I'd love to figure out why
type Class6<'T when 'T : (member Property1: int)>=class end
is used as a [legal example of a generic](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/constraints) in the MS F# reference source when that same documentation says member constraints can only be used with [statically resolved type parameters](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters), not normal generics. Or why structs are even a thing in F# considering struct records accomplish all of the same things, PLUS they play nice with type inference in situations like pattern matching where normal structs require awhen
clause. :doh:I suppose you already found this excellent site: [https://fsharpforfunandprofit.com/\](https://fsharpforfunandprofit.com/) It not only covers the language, but also many concepts. I read big parts of it when I was commuting by train (in Belgium that gives you sometimes more time than you planned ;-))
Check out my blog at http://msdev.pro/
-
I suppose you already found this excellent site: [https://fsharpforfunandprofit.com/\](https://fsharpforfunandprofit.com/) It not only covers the language, but also many concepts. I read big parts of it when I was commuting by train (in Belgium that gives you sometimes more time than you planned ;-))
Check out my blog at http://msdev.pro/
Gaston Verelst wrote:
I read big parts of it when I was commuting by train (in Belgium that gives you sometimes more time than you planned ;-) )
I hope you read the ['railway oriented programming' parts](https://fsharpforfunandprofit.com/rop/) on the train...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Been learning F# through the MS F# reference source but it seems very contradictory in some areas and devoid of meaningful explanation in others. I found the [F# foundation site](https://fsharp.org/learn/) which has some good reference material but I was curious if anyone here has a good book recommendation from their list or elsewhere? I'm the type that wants to know exactly what something does and why it's useful, not just told to use x in situation y, and unfortunately in my experience a lot of tutorial-type books tend to avoid those more difficult questions. For example, I'd love to figure out why
type Class6<'T when 'T : (member Property1: int)>=class end
is used as a [legal example of a generic](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/constraints) in the MS F# reference source when that same documentation says member constraints can only be used with [statically resolved type parameters](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters), not normal generics. Or why structs are even a thing in F# considering struct records accomplish all of the same things, PLUS they play nice with type inference in situations like pattern matching where normal structs require awhen
clause. :doh:The two F# books I have (which seem pretty good) are [Essential F#](https://leanpub.com/essential-fsharp) and [Domain Modeling Made Functional](https://pragprog.com/titles/swdddf/domain-modeling-made-functional/), which is by the same gut (Scott Wlaschin) who's produced the [F# for Fun and Profit](https://fsharpforfunandprofit.com/) website mentioned elsewhere. As for the bits of jankiness where F# and .NET collide...well, when you [friction weld](https://youtu.be/MIYJnd2X9eU) a functional first language like [OCaml](https://ocaml.org/) with an OOP first VM as in .NET, you get some mess at the boundary...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Gaston Verelst wrote:
I read big parts of it when I was commuting by train (in Belgium that gives you sometimes more time than you planned ;-) )
I hope you read the ['railway oriented programming' parts](https://fsharpforfunandprofit.com/rop/) on the train...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
I did, it gave me a bitter-sweet taste ;-)
Check out my blog at http://msdev.pro/
-
The two F# books I have (which seem pretty good) are [Essential F#](https://leanpub.com/essential-fsharp) and [Domain Modeling Made Functional](https://pragprog.com/titles/swdddf/domain-modeling-made-functional/), which is by the same gut (Scott Wlaschin) who's produced the [F# for Fun and Profit](https://fsharpforfunandprofit.com/) website mentioned elsewhere. As for the bits of jankiness where F# and .NET collide...well, when you [friction weld](https://youtu.be/MIYJnd2X9eU) a functional first language like [OCaml](https://ocaml.org/) with an OOP first VM as in .NET, you get some mess at the boundary...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p