Hacker News new | past | comments | ask | show | jobs | submit login

If I've already been learning Haskell, should I keep going or stop, drop everything and learn F#? I'd like someone with F# and Haskell experience to answer.



Depends on your requirements. I use F# day-to-day, but I think Haskell overall is a better language. There's some ugly aspects to F#, like its OO grammar, lack of typeclasses and seeming randomness to the casing (sometimes camelCase and sometimes PascalCase). These are all artefacts of it being a pragmatic tool in a toolset: its requirement to work with other .NET languages and frameworks (and Mono).

So for a bit of ugliness, and some loosening of the type-system shackles, you get a whole ton of stuff.

Haskell as I'm sure you're aware is much stricter and much harder to interoperate with. But much more refined as a language. Whilst you do get the "If it compiles it will probably work" thing with F#, it's nowhere near the level of Haskell. Haskell tends not to play as well with Windows, but again it depends what you're doing. I've had very few problems with Haskell on Windows by writing stand-alone services that talk to the rest of the world through RabbitMQ.

So if you're writing something that must absolutely be provably sound, doesn't need to talk to much else, then I'd go with Haskell. If you need lots of core Windows features it'd probably be best with F#.

I went from Haskell to F#, and I'm glad I learned Haskell first because it gave me a much stronger grounding in functional concepts. It's much easier to 'break the rules' in F#.

I hope that helps.


Yes, thank you for your explanation, it was great.

That is why I've started with Haskell too (6 months in now), because it teaches you the fundamentals about FP, and is strict about it (a good thing in my opinion).

That being said, I will continue to use Haskell. I know C# and I'm sure the jump won't be too difficult if I ever need it.


Yep, the jump from Haskell to F# is quite easy. It's a shame that F# doesn't put Computation Expressions up front like Haskell does with monads. The times when I feel like I'm getting into a mess with F# are nearly always fixed with monads (passing state around for example).

The nice thing with F# is that [if you have C# experience] you can pretty much just fall back to the standard .NET framework library if you get stuck. And the fact that F# supports dot notation means intellisense works. I've found over time I use the core BCL less and less as I retreat to a more pure functional approach however. Again, a good grounding in Haskell will help you there.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: