TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

CIS 194: Introduction to Haskell (Spring 2013)

74 pointsby hamidralmost 12 years ago

10 comments

dschiptsovalmost 12 years ago
I really like the amount of nonsense.)<p>It begins with <i>head is a mistake! It should not be in the Prelude. Other partial Prelude functions you should almost never use include tail, init, last, and (!!). From this point on, using one of these functions on a homework assignment will lose style points!</i><p>And here is a proposal:<p><pre><code> data NonEmptyList a = NEL a [a] nelToList :: NonEmptyList a -&gt; [a] nelToList (NEL x xs) = x:xs listToNel :: [a] -&gt; Maybe (NonEmptyList a) listToNel [] = Nothing listToNel (x:xs) = Just $ NEL x xs headNEL :: NonEmptyList a -&gt; a headNEL (NEL a _) = a tailNEL :: NonEmptyList a -&gt; [a] tailNEL (NEL _ as) = as </code></pre> Dear sirs, a List is a recursive data structure <i>by definition</i>. Non-recursive List is an unimaginable nonsense. What was made here with a name of safe(!) NonEmptyList is some ugly Pair with lots of syntactic noise.<p>How could you get the last element from your NonEmptyList? How could you tell how many elements in it?)<p>But, of course, never ever use these ugly unsafe lists - they might be empty! Use safe NonEmptyList because in Haskell everything is safe. And never try to think what the fuck you are reading.
评论 #6120213 未加载
评论 #6121356 未加载
评论 #6120934 未加载
评论 #6121475 未加载
评论 #6121349 未加载
评论 #6123107 未加载
MaxScheiberalmost 12 years ago
The author and teacher of this course, Brent Yorgey, is one of those rare guys who is both a fantastic lecturer and a fantastic researcher.<p>For Penn&#x27;s fuller version of this course, check out CIS 552[1]. Dr. Stephanie Weirich is also a fantastic lecturer, and a GHC contributor to boot (IIRC).<p>[1] <a href="http://www.seas.upenn.edu/~cis552/12fa/" rel="nofollow">http:&#x2F;&#x2F;www.seas.upenn.edu&#x2F;~cis552&#x2F;12fa&#x2F;</a>
Wataboualmost 12 years ago
Wow, thanks for this, it&#x27;s exactly what I needed.<p>I started from LYAH and the only thing missing from it were some exercises so I could retain the information that was presented in each chapter. Otherwise, it&#x27;s a fantastic book.
mcintyre1994almost 12 years ago
I really wanted to learn functional programming when my university offered it, but unfortunately it&#x27;s crunched in a horribly busy term and I&#x27;m not willing to risk core modules for it if I end up struggling.<p>That said, I really do want to learn it and find MOOCs a really useful tool, if anybody has any suggestions for any they&#x27;ve used (or the one linked, I&#x27;m unclear if that&#x27;s for students at that university only) that&#x27;d be awesome!
评论 #6121238 未加载
ilolualmost 12 years ago
Are there any good set of videos to learn Haskell ? Or which book should I start with. I don&#x27;t have much experience in Functional Programming.
评论 #6119964 未加载
评论 #6120191 未加载
评论 #6120002 未加载
评论 #6119980 未加载
评论 #6119947 未加载
croydalmost 12 years ago
I&#x27;m currently trying to learn functional programming through Haskell. Glad to have found another resource, plus this cheat sheet linked from the page looks handy: <a href="http://cheatsheet.codeslower.com/" rel="nofollow">http:&#x2F;&#x2F;cheatsheet.codeslower.com&#x2F;</a>
JacobHenneralmost 12 years ago
Interesting to see a Penn site here...
WasimBhaialmost 12 years ago
Why should I learn Haskell? Will it help me professionally, or help me being a better programmer?
评论 #6120635 未加载
评论 #6120216 未加载
评论 #6120405 未加载
评论 #6120122 未加载
评论 #6120156 未加载
xzelalmost 12 years ago
I took this class last semester. Learned a lot. Brent was a great professor and is a great guy.
Ashuualmost 12 years ago
Is it only for UPENN students?