The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
aMAZE yourself with Haskell

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jamis Buck

Posts: 184
Nickname: minam
Registered: Oct, 2004

Jamis Buck is a C/Java software developer for BYU, and hacks in Ruby for fun.
aMAZE yourself with Haskell Posted: Nov 3, 2005 5:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jamis Buck.
Original Post: aMAZE yourself with Haskell
Feed Title: the buckblogs here
Feed URL: http://weblog.jamisbuck.org/blog.cgi/programming/index.rss
Feed Description: Jamis Buck's corner of the blogging universe. Mostly about ruby, but includes ramblings on a variety of topics.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jamis Buck
Latest Posts From the buckblogs here

Advertisement

So, as you’ve probably figured out by now, I’ve been learning Haskell. My first actual program now behind me, I thought I’d step up and talk a bit about my thoughts on Haskell so far.

  • Monads still really boggle me. They are my biggest stumbling block so far, and as far as I’m concerned, they are the biggest wart on the face of Haskell. Yah, sure, I understand the idea—you can use Monads to represent a sequence of actions without violating “functional programming”, but it still feels very, very awkward. I definitely have more reading (and practice) to do on this topic.
  • I love how you can define multiple versions of a function and use pattern matching so that the runtime system will choose the correct version based on the value of the parameters. Really slick.
  • I’m still trying to get a practical feel for when to use let and when to use where.
  • Using a strongly typed language feels kind of awkward after so long with Ruby, but that’s not a reflection on Haskell. I must admit that Haskell’s type system is pretty neat.
  • The whole thing with classes and instances is pretty slick, too, though I’m still trying to wrap my brain around it.
  • It feels like you have to pay much closer attention to what you are doing, to avoid cluttering your namespace. Modules help, but once you import them, you’re still stuck with everything in the same namespace. I’ve got to be missing something.
  • I really miss objects! Trying to program something that uses random number generation is a real pain in Haskell, because you have to pass the generator around from function to function. Give me stateful objects anyday, over a purely functional language…but I’m sure that’s mostly my inexperience talking.

Anyway, I’m still working my way through it. It is definitely unlike almost any language I’ve ever learned, although I definitely prefer it over Scheme. I still doubt I’ll convert from Ruby to Haskell, but it’s a new way of thinking about problems, and that is always valuable.

For the curious, here is my first Haskell program. it is a naive random maze generator, which is something I can code in my sleep in a procedural language, but which really stretched me when trying to implement it in Haskell. You Haskell experts out there, please feel free to give me advice on how to make this little program better! (But be gentle…)

Read: aMAZE yourself with Haskell

Topic: News.com: Ruby on Rails goes mainstream Previous Topic   Next Topic Topic: Keeping the Code Organic

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use