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.

A Taste of Haskell

157 pointsby def-over 8 years ago

15 comments

agentgtover 8 years ago
As for the Java bashing in the beginning I&#x27;m not saying Java is anywhere near the expressive power of Haskell but many people think different things based on Java because of features they either don&#x27;t know about, outdated libraries used, or experiences with older versions and codebases.<p>For example most don&#x27;t know that Java actually does have macro like capabilities through APT (annotation processor that will work automagically I might add). Some might say ewww its not macros but then again annotation processing might just be 80&#x2F;20 good enough (aka what OCaml learned with ppx vs camlp) and that Java now sort of has traits and that its code swapping is actually fairly good (jrebel). There are even sadly people that don&#x27;t know Java has lambdas, and even some (usually C++ dudes) that don&#x27;t know it has generics. Most don&#x27;t even know that you can combine interfaces with generic types as in: `&lt;T extends Comparable &amp; Serializable&gt; void someFunc(T t)`.<p>Yes Java is not Rust, Haskell or even OCaml in expressiveness but it certainly is more powerful than Golang and definitely compiles fast (albeit starts up slow).<p>That being said OCaml is still my favorite. Compiles fast and easier for me to understand. Super mature and lots of companies use it.
评论 #12785575 未加载
评论 #12786106 未加载
sa1over 8 years ago
That&#x27;s not really the Sieve of Eratosthenes. The list data structure is not well suited for the algorithm. See [1] for a proper discussion. As someone who wants to write Haskell(and loves it) for code with mathematically well defined guarantees, the propagation of such examples, where the guarantees or behavior is not clear to the author, is not helpful.<p>[1]: <a href="https:&#x2F;&#x2F;www.cs.hmc.edu&#x2F;~oneill&#x2F;papers&#x2F;Sieve-JFP.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.hmc.edu&#x2F;~oneill&#x2F;papers&#x2F;Sieve-JFP.pdf</a>
评论 #12783515 未加载
评论 #12784728 未加载
评论 #12783707 未加载
TheAceOfHeartsover 8 years ago
I got started with Haskell recently, and I&#x27;m really regretting not having picked it up earlier. Most of what I knew about types came from C, C++, or Java; so it&#x27;s a big leap.<p>I&#x27;ve been using Haskell for Mac IDE [0] while experimenting, and it&#x27;s been great fun.<p>The thing that prompted me to give Haskell a a try was this video [1] of a guy using Haskell to generate Elm types, in order to maintain consistent types across the stack. This idea captivated my interests. I&#x27;m confident that GraphQL and Relay, or something along those lines, is gonna be the future.<p>My experience so far has been that Elixir feels more welcoming and beginner friendly. There&#x27;s nothing wrong with the Haskell community (or my limited interactions with it so far), but so far it&#x27;s just felt a bit drier.<p>[0] <a href="http:&#x2F;&#x2F;haskellformac.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;haskellformac.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=sh4H8yzXnvw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=sh4H8yzXnvw</a>
评论 #12785104 未加载
评论 #12786112 未加载
Dzugaruover 8 years ago
Don&#x27;t know about Haskell, but what really got me (a long time CSharp programmer) into functional programming was this awesome site [1] (and a man behind it with his awesome talks) - which is focused on core aspects of FP (applicable in most languages nowadays) in real-world applications.<p>[1] <a href="https:&#x2F;&#x2F;fsharpforfunandprofit.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fsharpforfunandprofit.com&#x2F;</a>
评论 #12784171 未加载
androidfoxover 8 years ago
Nice link. One related question : where have you used Haskell in real life. Do some top companies use Haskell to solve problems
评论 #12783385 未加载
评论 #12785908 未加载
评论 #12786588 未加载
评论 #12783325 未加载
评论 #12784808 未加载
评论 #12783476 未加载
评论 #12783298 未加载
评论 #12784475 未加载
评论 #12790065 未加载
评论 #12787982 未加载
评论 #12787983 未加载
mahyarmover 8 years ago
I really want to warn people from using long-to-compile languages in big projects. And by long, I mean longer than C++. From what I heard Haskell has compile time issues.<p>You will regret it once your in that position and it is hard to get out of once your there.
评论 #12784804 未加载
joobusover 8 years ago
I&#x27;ve spent quite a bit of time with Haskell, and all the beginner text like this link are easy to grok, but where I&#x27;ve constantly come up short is trying to write an app with, for example, a configuration and a database connection. Having multiple levels of Monad transformers just confuses me and I never get anywhere useful. Something like:<p>App MaybeT IO (StateT IO (EitherT IO Text SomeRecord))<p>Or something. I haven&#x27;t figured this out.
评论 #12785517 未加载
评论 #12786198 未加载
评论 #12787984 未加载
评论 #12787569 未加载
ciesover 8 years ago
There are some book recommendations at the bottom of the article, which are missing the (IMHO) latest-and-greatest introductory resource to Haskell: the book Haskell from First Principles.<p><a href="http:&#x2F;&#x2F;haskellbook.com" rel="nofollow">http:&#x2F;&#x2F;haskellbook.com</a>
KennyCasonover 8 years ago
I love Haskell, but if you hate Java, but still want to leverage the nice Java ecosystem, (libs, IntelliJ, JVM, tooling, etc) try Kotlin! :) <a href="https:&#x2F;&#x2F;kotlinlang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kotlinlang.org&#x2F;</a>
评论 #12784670 未加载
评论 #12786471 未加载
评论 #12785363 未加载
评论 #12784184 未加载
kinkdrover 8 years ago
Started learning Haskell just a couple of weeks ago. My only complaint with the language so far is that I cannot have the same name for a field in two records in the same module.<p>Other than that it is amazing the confidence it gives me; if it compiles it works (r).
评论 #12783497 未加载
评论 #12783408 未加载
krautsourcedover 8 years ago
This may sound (and probably is) quite superficial, but I am immediately put off by any language that uses syntax like this: foldr&#x27; (+) :: Num t1 =&gt; t1 -&gt; [t1] -&gt; t1 Why? Because of things like =&gt; and -&gt; are just a pain to write all the time and make you chase all over the keyboard, even more so on non-english keyboards. Just my very personal preference of course, but still...
评论 #12787348 未加载
lifeisstillgoodover 8 years ago
How bad is it looking at the examples and thinking &quot;I love that lambda symbol as a prompt. I want&quot;<p>I have to revisit my base setup soon. The 1990s wants its bash_profile back
jjawssdover 8 years ago
How difficult is it in your experience for developers to learn Haskell while on the job?
评论 #12783664 未加载
评论 #12784580 未加载
NotThe1Pctover 8 years ago
I tried haskell queues a while ago - under the advice of a friend and compared with a straightforward C++ queue - it was about 100x slower. Abandoned the idea.
评论 #12784452 未加载
评论 #12786979 未加载
xamuelover 8 years ago
I taught myself Haskell because people say it improves you as a programmer. I didn&#x27;t see that, but I have a math PhD so maybe I&#x27;m just too familiar with abstract types to gain new insight from Haskell.<p>As a language, it&#x27;s sterile. You can tell it was designed by committee.
评论 #12784960 未加载
评论 #12784785 未加载