Settings

Theme

Ask HN: What do you dislike about statically typed functional programming?

5 points by maxhallinan 7 years ago · 8 comments · 1 min read


I'm thinking of languages like Elm, Haskell, PureScript, and Standard ML.

kasey_junk 7 years ago

Haskell - laziness can be exceedingly hard to reason about. Also it takes a lot of experience before you start designing your purity boundaries well.

Ocaml - figuring out the things surrounding the language (dependency management, concurrency, formatting, linting, etc)

karmakaze 7 years ago

I haven't learned/used them enough to appreciate higher-kinded types and the whole category theory monad thing. Individual usages make sense but each could be done differently without the generality.

One language that looks interesting is Clean[0]. It uses uniqueness types for mutations or other impure operations which kind of reminds me of software-transactional-memory or borrow checking.

[0] https://clean.cs.ru.nl/Clean

https://en.wikipedia.org/wiki/Clean_(programming_language)

bjourne 7 years ago

Of those, I have only used Haskell (and F# which you didn't mention). While Haskell is a pure language, it's standard library is "unclean". Functions in Prelude have idiosyncratic names (words, unwords?) and it doesn't feel like they fit together.

But the real show-stopper for me is the five different string types Haskell has. I want to focus on algorithms and program design - not string conversions.

karmakaze 7 years ago

I also looked at Elm and liked it a lot but wondered why there was so much controversy around Sum/Union types and why they aren't 'just' added. If it was open-sourced and there was a fork that at least tried it, I'd be happier to use whichever one worked out for my use case.

mbrock 7 years ago

I actually don’t like the way they manage data only through algebraic types passed around as parameters. That is one nice way to do things but I often find myself poorly reinventing relational stores or wishing for Datalog.

gigatexal 7 years ago

What do you dislike?

I’m thinking it could be the static typing but as I’ve done more and more work in static typed languages I like them a lot more than dynamically typed ones.

  • maxhallinanOP 7 years ago

    I like statically typed functional languages but I'm interested in understanding why people dislike them.

    • sridca 7 years ago

      I write Haskell currently, but have used Clojure in the past. I find Haskell to be superior (static typing being one reason) however it takes more persistence and effort in the beginning to get used to Haskell.

      I'd recommend that people start with something "easy" like Elm, and then transition to Haskell via frameworks like Miso or Reflex. That's exactly what I did.

      This project of mine used to be in Elm & Go, but now uses Haskell throughout: https://github.com/srid/slownews

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection