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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Architecture of a Real World Haskell Application

151 点作者 davidkellis大约 11 年前

5 条评论

jarrett大约 11 年前
As the author says, there&#x27;s quite a lot of imperative stuff in this design. I&#x27;m still on the fence about whether that&#x27;s the best way to build large applications with GUIs, network access, etc.<p>With the imperative approach, you make liberal use of the IO monad. There&#x27;s a lot of explicit reading from and writing to mutable storage. If you&#x27;re doing this approach right, you mostly just use the IO monad for actual IO and threading; most of the real logic of the program is kept pure. This approach has the advantage of being familiar. And more importantly, it just plain works. It&#x27;s how I tend to do things.<p>Yet I can&#x27;t help but wonder if there&#x27;s a better way. The above approach, while comfortable, leaves me with a bad taste in my mouth, like I&#x27;m somehow fighting against the language. I&#x27;ve often heard functional reactive programming (FRP) described as the best alternative. Though I remain skeptical. I&#x27;d be interested in opinions about the future of FRP.
评论 #7717098 未加载
评论 #7716284 未加载
评论 #7716406 未加载
评论 #7717887 未加载
ixmatus大约 11 年前
Not sure if &quot;Architecture&quot; is the right word here. More like, &quot;How I built a Real World Haskell Application&quot;.<p>When I read about how to &quot;architect&quot; something I&#x27;m think about how to structure my Cabal file (a common pattern in my apps is a &quot;library&quot; of types, parsers, and utilities that are jointly used by multiple executables of <i>the same program</i>). I also think about structuring my tests, the naming and structure of module directory hierarchies, maybe also how to structure the program around the Main entry point.<p>I think there may also be a more interesting couple of &quot;sub-articles&quot; in this article: &quot;How I built a server daemon in Haskell&quot; and &quot;How I built a GUI client in Haskell&quot;.
评论 #7715853 未加载
egonschiele大约 11 年前
&gt; it could benefit from the lens library, but last time I tried it did have problems with compilation with profiling information<p>In my experience, template haskell does not play well with profiling. If you were deriving lenses with TH, you could try writing them out yourself. That might solve this issue.
z3phyr大约 11 年前
It is great to see Haskell being &#x27;used&#x27; in the &#x27;space-science industry&#x27; (please tell me a good word for this)<p>I would love to read more about mainstream functional language being used in scientific domains like CERN, ESA, NASA or SpaceX.
评论 #7715886 未加载
评论 #7723709 未加载
dangirsh大约 11 年前
Very cool to see Haskell being used more in the space space. I&#x27;ve recently built a command line tool in Haskell with a subset of these features for my team&#x27;s testing:<a href="https://github.com/dangirsh/Auto" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dangirsh&#x2F;Auto</a><p>I agree that the existing tools are pretty limited