4 ms·
Can you share some experiences with F# in bigger projects? I'm a little bit worried about the accessibility of larger code bases with global type inference. I w
by thomasz 15y ago
Can you share some experiences with F# in bigger projects? I'm a little bit worried about the accessibility of larger code bases with global type inference. I would say that I have a pretty good grasp of the language in general, but I usually feel lost without IDE support or comments because heavy usage of things like currying and type inference assures that the signature of a function is pretty meaningless.
- Dn_Ab 15y agoCurrying and type inference do not make function signatures meaningless, unfortunately however, reading their types is a skill that you need to practice for it to become natural. As for global type inference the one in F# is only partially global (between Scala and ML , Haskell). Anytime you are dealing with ad-hoc polymorphism, even when F# has inferred the types, you will often have to put the type in. Full point free programming also does not always resolve if you are into that. I have gotten into the habit of putting types and names for complicated functions in comments (///). I also write short descriptions for particularly dense pieces of code and have gotten in the habit of writing clearer, less dense code with full names because otherwise it does take longer to mentally unpack. That is, functional languages make it easy to write stuff like: let wu wp wn nu y x = wp * (exp (nu * y * x)) , wn * (exp (-nu * y * x))