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.

My Haskell Journey from C#

101 pointsby jose_zapalmost 7 years ago

7 comments

barglalmost 7 years ago
I&#x27;m curious, as a C# developer myself. Why didn&#x27;t you jump over to F#? I&#x27;ve looked at both as a FP next step for my own career, but I haven&#x27;t made the plunge with either.<p>Thanks for the write-up. Really hit the spot for me as someone who doesn&#x27;t want to get pigeon holed into C# forever.
millstonealmost 7 years ago
No real minuses discussed here so I thought I&#x27;d share some from my FP journey, which was SML -&gt; OCaml -&gt; Haskell -&gt; Clojure. Each had its own sort of enlightenment, both in strengths and weaknesses.<p>IMO an under-appreciated weakness of Haskell is its culture of poor code quality and engineering practices, e.g. in how code is structured, (not) commented, or named.<p>Example, inspecting a graph in Haskell via fgl, we encounter the foundational Decomp type [1]:<p><pre><code> type Decomp g a b = (MContext a b, g a b) </code></pre> `a` and `b` are types, and in languages geared towards engineering, we would give them actual names: a is a NodeTag and b is an EdgeTag. But in Haskell it is customary to not provide this information, instead falling back on the type checker to ensure the code is consistent. There is not much effort put into useful naming: map vs mapM vs mapM_...<p>Second example, the simplex algorithm [2]:<p><pre><code> addart :: (Num e, Enum a, Ix a, Num a) =&gt; Array (a, a) e -&gt; Array (a, a) e addart a = array ((-1,0),(n,m+n)) $ z ++ xsi ++ b ++ art ++ x where z = ((-1,0), a!(0,0)) : [ ((-1,j),0) | j &lt;- [1..n] ] ++ [ ((-1,j+n),a!(0,j)) | j &lt;- [1..m] ] xsi = ((0,0), -colsum a 0) : [ ((0,j),0) | j &lt;- [1..n] ] ++ [ ((0,j+n), -colsum a j) | j &lt;- [1..m] ] b = [ ((i,0), a!(i,0)) | i &lt;- [1..n] ] art = [ ((i,j), if i == j then 1 else 0) | i &lt;- [1..n], j &lt;- [1..n] ] x = [ ((i,j+n), a!(i,j)) | i &lt;- [1..n], j &lt;- [1..m] ] ((_,_),(n,m)) = bounds a </code></pre> this code is astonishingly compact, but totally impenetrable. It has no comments, useful names, etc. This write-only code is typical<p>Haskell and its culture have significant weaknesses from an engineering perspective.<p>1: <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;fgl-5.6.0.0&#x2F;docs&#x2F;Data-Graph-Inductive-Graph.html#t:Decomp" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;fgl-5.6.0.0&#x2F;docs&#x2F;Data-Gr...</a><p>2: <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;dsp-0.2.4&#x2F;docs&#x2F;src&#x2F;Matrix-Simplex.html" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;dsp-0.2.4&#x2F;docs&#x2F;src&#x2F;Matri...</a>
评论 #17748676 未加载
评论 #17749066 未加载
评论 #17751180 未加载
评论 #17749447 未加载
mark_l_watsonalmost 7 years ago
Good writeup, short but some interesting comments and links.<p>I have also had a journey with Haskell. I really enjoy Haskell and have worked hard on developing skills. That said, there often seems to be other languages that seem better for me, for individual projects. Machine learning? Usually need to use Python. Web development? Hard to beat Rails for productivity. Enterprise Systems? It is usually written in Java. Doing ‘research programming’ to explore data and ideas? I usually favor Common Lisp, but sometimes use Haskell.<p>For me, I think Haskell will always just be a language I very much like but only occasionally use.
评论 #17746629 未加载
ilovecachingalmost 7 years ago
I would recommend Programming in Haskell by Graham over other introductory texts. Not only is it a small read, Graham does a great job of avoiding the mire and excells at teaching critical concepts with simple examples. You&#x27;re better off reading Programming in Haskell three or four times than reading some of these more intricate or simplified texts once. It will give you a groundwork of the fundamentals, and you will not have incorrect definitions of important concepts.<p>The key to Haskell is to think like a functional programmer. Most of us are trained to think in ways other than functional programming. This is a skill that takes time to build, and a book can&#x27;t necessarily impart upon you.<p>A issue with today&#x27;s programmers is that they require instant gratification from their programming languages. Remember that it takes a large investment to learn a foreign language. The more you learn, the more you can express. Haskell and FP takes times to master because they are powerful tools that allow you to express complex ideas succinctly.<p>So don&#x27;t get discouraged if it seems foreign, it is. With Haskell you can say a lot with a little, and it will pay dividends for years to come.
评论 #17747575 未加载
Bizarroalmost 7 years ago
<i>I regret not listening to people’s advice about this sooner and spending a lot of time looking for the best Haskell IDE &#x2F; development tools. In the end, everybody else was right and unfortunately, the current state of the available tools is not good enough. The process that most people seem to use, and the one I also adopted is using my favorite text editor with syntax highlighting.</i><p>Wonderful. That&#x27;s like driving a Lamborghini with a school bus steering wheel.
评论 #17748949 未加载
评论 #17749016 未加载
3rdAccountalmost 7 years ago
I think K framework isn&#x27;t the best project name as there is a &quot;k&quot; language that goes along with the kdb+ database. It is popular in wall street.
Stratoscopealmost 7 years ago
Ah, so hard to read. Look, in the web of the written word, it just doesn&#x27;t work to use flush justified white text on a black background and a scrawny font weight of 300.<p>All those things do on a web page is make it hard for people to read your (presumably interesting) message.<p>I even tried to override the font-weight and text-align in the developer tools, but for some reason that didn&#x27;t work like it usually does, and I didn&#x27;t have the patience to pursue it further.<p>If you could please make this look like a normal website - dark text on a light background, no flush justification, and normal font weight - I would be able to read it. Thanks!
评论 #17746481 未加载