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
giogadi
Oct 27, 2009

Let's keep the functional dream alive people. A lot of the curious people that come in will be wondering what you can actually *do* with functional programming, so have y'all built anything interesting to share?

I farted around with Elm a bit last year and built a clone of Tetris Attack. You can play it at this link:

http://cs.unc.edu/~luis/tetris-attack/

Press spacebar to begin. Move the cursor with the keyboard arrows and swap the blocks under the cursor with the spacebar. Try to line up at least 3 of the same color in a row to make them vanish, and see how long you survive. Here's the source.

Using Elm for this was just so drat pleasant. I actually had an experimental version of this working with real-time online multiplayer, but Elm's API changed a whole bunch so that code's now broken. When I have time I'd love to take a shot at Elm's WebGL API and see how feasible 3D game dev is in Elm's FRP+MVC programming model.

Adbot
ADBOT LOVES YOU

giogadi
Oct 27, 2009

Pollyanna posted:

Clojure is pretty drat cool. I'm learning it for the express purpose of wrapping my head around functional programming in general. I wanted to go through Functional Programming in Scala, but I felt like I didn't have the FP background for it. What are some good language-agnostic resources for the basics and theory behind FP?

I personally haven't seen any language-agnostic tutorials on FP, but I think that might be because each FP language takes such a different approach to FP. I didn't know anything about FP before jumping into Learn You a Haskell, and I found it to be a super enlightening yet accessible introduction to general FP concepts with Haskell as the driving language.

giogadi
Oct 27, 2009

Arcsech posted:

This is true. It's also the best way to get an SICP-compatible scheme (via #lang planet neil/sicp) right now.

On a similar note, the incredible book How to Design Programs is also based on Racket. Some people find HtDP to be a more modern and approachable version of SICP.

Also: slightly off-topic, but I just found out the SICP people wrote a book about classical mechanics (SICM) that uses Scheme to teach physics. It's fun because the various laws and formulas are all taught with the intent of being coded up in Scheme, so they strive for zero ambiguity.

giogadi
Oct 27, 2009

rrrrrrrrrrrt posted:

Does someone want to take a stab at explaining the ((->) a) instances for type classes like Functor and Monad 'cause I don't really get them still.

I would also like to see this.

giogadi
Oct 27, 2009

Great posts, everyone.

Tangential: I found Okasaki's book to be impenetrable. It reads like a Ph.D. thesis (because it is) that is more about flaunting his personal results than genuinely trying to teach the reader. I admit that I'm rusty in amortized complexity; would I have an easier time if I went back and studied that first? I'd love to see a reader-friendly, Haskell-based treatment of data structures that included graphs (although I know that's a whole other can of worms).

Just venting here because that drat book made me feel reeeeeeeal dumb.

  • Locked thread