TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to choose functional programming side projects?

6 点作者 CRUDmeariver将近 9 年前
I&#x27;ve been using functional programming languages in the workplace for about a year and a half now, first Scala and now Clojure. I am comfortable with basic FP operations (reduce, fold, map, etc) and the principles behind it, but I have yet to come across a reason to learn the more academic side of things (monads, applicative functors, currying, etc).<p>I&#x27;m trying to figure out a fun side project that will give me an opportunity to get deeper into the weeds of FP. I&#x27;m not sure whether to take a simple idea you could do in OO (i.e. a CRUD app) and do it in an FP language, or look for a problem that is more suited to the domain of FP.<p>What are the characteristics of a problem that is especially suited to FP? Or is it a pointless distinction? And how much of the theory is actually worth learning if I don&#x27;t plan on using Haskell?

5 条评论

bbcbasic将近 9 年前
I would recommend having a look at <a href="http:&#x2F;&#x2F;haskellbook.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;haskellbook.com&#x2F;</a> which is written by someone who is seriously passionate about making Haskell understandable to regular programmers. Before writing the book he kept track of the best resources for learning Haskell but was always thinking the community needs something better for beginners. So I think it would be worth buying.<p>For parallel and concurrency programming this book is excellent <a href="http:&#x2F;&#x2F;chimera.labs.oreilly.com&#x2F;books&#x2F;1230000000929" rel="nofollow">http:&#x2F;&#x2F;chimera.labs.oreilly.com&#x2F;books&#x2F;1230000000929</a> and is free online to read. I am working through the concurrency chapters and it is blowing my mind how excellent concurrency support is in Haskell AND how someone who is smart enough to work on the GHC for 15 years can explain concurrency in a way that is accessible to someone fairly new to Haskell and concurrency. You&#x27;d probably need the grounding of haskellbook first though before reading this.<p>For a Haskell project I have decided to make a stock exchange using the concurrency I am learning from the above book. Eventually it may be good enough for someone wanting to run a bitcoin exchange or similar. Happy to have you help me if you like.<p>&gt; What are the characteristics of a problem that is especially suited to FP?<p>Really, any programming problem is suitable for FP. I think web applications and server applications are especially suited. Writing desktop applications is trickier mainly because of a lack of a really nice paradigm. The nicest thing I&#x27;ve seen so far in that respect is the Elm language - which is for the browser but the ideas could be applied to the native desktop too.<p>The classic applications for FP is compilers but Haskell is a general purpose language and ideal for producing the kind of business apps that Java&#x2F;C# is often used for.
评论 #11907725 未加载
AnimalMuppet将近 9 年前
To produce the benefits you want, you&#x27;re probably going to need a side project that you stick with for a while, one that pushes you to figure out how to do things that aren&#x27;t necessarily easy to do in (simple) FP. To me, the kind of side project that is likely to do that is one where <i>you care about the project</i>. Forget whether the problem is &quot;suited to FP&quot; or not. Do something you <i>want</i> to do.
eatonphil将近 9 年前
If you want to be boring, try writing purely functional data structures (check out Containers in the Ponyo source via ponyo.org). Otherwise, do something interesting like writing a web server from scratch or a wrapper to FastCGI. These are the kinds of things I do in every new language I want to learn (OCaml, SML, Scheme, etc.).
runT1ME将近 9 年前
Have you read Functional Programming in Scala?<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Functional-Programming-Scala-Paul-Chiusano&#x2F;dp&#x2F;1617290653&#x2F;ref=sr_1_1?ie=UTF8&amp;qid=1465849313&amp;sr=8-1&amp;keywords=functional+programming+in+scala" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Functional-Programming-Scala-Paul-Chi...</a>
meric将近 9 年前
You could try implement monads in an OO language.