Anyone know anything about Haskell?

Beef Welington

Veteran XV
So I'm taking this computer science class and the professor is basically insane, or just doesn't care. I have all the necessary prerequisites for this class, but he just seems to have decided that everybody should have come in already knowing how to program in Haskell, and is probably the least helpful person in the entire world.

On the first day, he gave us a worksheet to help us "learn" how to use Haskell. I have never had any experience with it before, and I have no clue what to do with this question:

"Define +, -, * for natural numbers. Define functions add, minus, and mult (each taking 2 Nat number variables) on the data type Nat = Z | S Nat deriving Show. Build functions nattoInt:Nat -> Int and buildNat:Int -> Nat to assist you."

I'm getting no help whatsoever on what this even means. I feel like it isn't very complicated, just some recursive definitions, but I have absolutely no experience with the syntax and semantics of Haskell.

I started reading Haskell tutorials, and got far enough to understand that I define the new data type by typing "data Nat = Z | S Nat deriving Show" (btw this is using Hugs mode, which I guess reads from a text file), but I have no idea of how to actually specify how this works. "Z" is a base case I think, "S" is supposed to be a successor, I get that, but I don't know how to define these things in the language.

Any help would be greatly appreciated.
 
Your prof is a dick.

he's actually really nice, and he's the head of the department. I think his brain just runs on such a high level that he can't cope with basics anymore. He tried to start explaining things to me, and ended up running on the most retarded tangents ever.
 
he's actually really nice, and he's the head of the department. I think his brain just runs on such a high level that he can't cope with basics anymore. He tried to start explaining things to me, and ended up running on the most retarded tangents ever.

you have an approval seeking complex.

You will soon drink the corporate koolaid and be an obediant cog in the office hamster-wheel.


you know im right.
 
Well who's the dick now? And also thanks for informing me of the pickle I'm in, without providing any insight.

But hey, at least we've concluded that my "prof. is a dick."

thanks.
 
seriously this will come in handy in like 2 years.

THANK GOD I WENT TO TW ASKING FOR HELP ON LEAVE IT TO BEAVER TRIVIA
 
Quotes of the Week

Jim Apple: The Haskell list probably has the widest 'knowledge bandwidth' of any mailing list I've ever seen, from total beginner questions to highly abstruse stuff which probably represents the cutting edge of PhD research. All are answered with detail and good humour.

[Seen on the Haskell mailing list]: Wow! I found your help terrific! Thank you! Can I give you some money?

Paul Johnson: Is functional programming an actual bona-fide silver bullet as defined by Brooks? I believe it is. Functional programming is based on a sound theory of scalable software engineering, and the empirical evidence clearly and consistently supports the theory.

Clemens Fruhwirth: After all the elegance I have to conclude that Haskell definitely deserves to be looked at.

sorear: Haskell is amazing. I'm still working on my infinite-types unifier, and in a day I've added sums, products, and lambda abstractions, refactored the code until there was a net *decrease* in LOC, and helped man #haskell all at the same time. This'd take me a week in C, no doubt.

Claus Reinke: The aim of update programming is to transform a store whose contents describe a problem into a store whose contents describe a solution. The aim of functional programming is to transform a program which describes a problem into a program which describes a solution.

Daveman: What if I don't want to obey the laws? Do they throw me in jail with the other bad monads?

Stinger: Sometimes Haskell seems like an arms race between weird mathematical constructs and my brain

astrolabe: Below a certain level of competence, coding is a destructive act. Like playing the violin.

dons: Gimme some lambda warez!

wy: [wy] lennart: Wow. You won the IOCCC three times! [augustss] I'm bad at C programming ;)

shapr: I think the Haskell approach works fine. That is, stick with research and do the best you can. Then after fifteen years of gestation, take over the world.

edwinb: Where does 'Oleg cornered me in a pub and explained delimited continuations to me' fit in?

emu: Design patterns are what you choose for wallpaper and carpets

kyevan: My skull is already mostly duct tape. And I'm only on page 25 of YAHT!

shapr: There's an important niche market for OSes that don't crash.

Haskell Weekly News: December 12, 2006 | The Haskell Sequence
 
Haskell. He's so hot right now.

Haskell

Hi Derek, I'm Lil' Cletus...

1-1766998-9379-t.jpg
 
ya did some haskell like 5 years ago.. it was not fun. My uni doesn't even offer the course that taught that anymore, which is good, cos i wouldn't want to be the shmuck teaching it.
 
Haskell is a language that only virgins learn.
Typically bald ones with big guts and thick coke bottle glasses that eat nothing but cheetoes and ding dongs.

So BW fits right in.
 
Back
Top