Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Flat Daddy posted:

Glad to see this thread was created. Not glad to see impure, functional-ish languages included.

As someone just starting to look into functional programing, which ones are the "impure" ones? Why are they only "functional-ish"? Why should I avoid them?

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Arcsech posted:

"Pure" functional languages are those which force side effects (mostly you can think of this as any sort of input or output, although it's broader than that) to be reflected by the type system. Haskell is the only language that's even kinda-sorta mainstream that's purely functional, with some experimental languages like Elm, Agda, and Idris also falling in that category. A language being purely functional brings a lot of tradeoffs that can get pretty complex to explain.

Essentially, anything that's commonly described as functional will be good for learning functional programming, don't worry about it*. The only people who discount "impure" or "functional-ish" languages are basically fundamentalists.


*: However, learning a pure functional language as an intro to functional programming can be good for you as it doesn't allow you to intentionally or accidentally fall back into an imperative mode, instead forcing you to think functionally. However, as an introductory language, I'd recommend Elm - it is purely functional, but it's easy to do neat stuff with it since it runs in a browser and the author of the language puts a heavy emphasis on making it easier to learn. Elm's model of I/O is much easier to wrap your head around than Haskell's, in my opinion, which can be a major stumbling block in Haskell.

Thank you for this.

"You are wrong" posts are quite annoying when the person posting provides no reasoning, and CoC seems to love them.

  • Locked thread