Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
codygman
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
67 ms
·
661.
▲
by
codygman
12y ago
> Cheers for the long and thoughtful reply :-) I just want to help myself and everyone to have the right information so we can all make the best decisions for ourselves ;) I get the feeling and I've had it before as well, mostly du
662.
▲
by
codygman
12y ago
> * Non-exhaustive patterns error was disappointing after being told that "if it compiles it will run". It seems to be the Haskell equivalent of NullPointerException (I'm told OCaml doesn't have this problem). I agre
663.
▲
by
codygman
12y ago
I agree, I would prefer that it was an error as well. For my personal projects I use -WError, but sane defaults count for a lot.
664.
▲
by
codygman
12y ago
> In the end, even something as simple as reading a list integers in the IO monad can be an exercise in frustration Only if you need it to do it in less than 164616 bytes, otherwise I'd just use: replicateM 1000 (return 42)
665.
▲
by
codygman
12y ago
> I found that it wasn't as safe as it claimed to be and that the tooling was not very good. How was Haskell not "as safe as it claimed to be"? What tooling was not very good? What tooling was missing for you?
666.
▲
by
codygman
12y ago
Haskell can be very handy for solving real world problems as well.
667.
▲
by
codygman
12y ago
I highly recommend "You could have invented Monads", it helped me a lot. I also recommend the Haskell Wikibook: http://en.wikibooks.org/wiki/Haskell/Understanding_monads
668.
▲
by
codygman
12y ago
Also, if you can post some code examples where you "feel you are missing something" I (or others) might be able to provide the functional examples.
669.
▲
by
codygman
12y ago
You can use forM. As for why for loops are imperative or if they are... Not sure. A few thoughts come to mind: For loops dont return a value, whereas forM and even forM_ both return values. They are normal functions rather than just control
670.
▲
by
codygman
12y ago
Can you give some details and links to bugs involved?
671.
▲
by
codygman
12y ago
I totally agree with you.
672.
▲
by
codygman
12y ago
> laziness tricks When your language is lazy by default, is it really a trick to take advantage of that? Do you consider this a trick? take 1 [5..] How about this Fibonacci definition? fibs = 0 : 1 : zipWith (+) fibs (tail
673.
▲
by
codygman
12y ago
Type-driven development, purity, equational reasoning, exhaustiveness checking, pattern matching, STM, Maybe/option types, generics, and alternative concurrency methods? These are many of my reasons at least.
674.
▲
by
codygman
12y ago
> The choice of a pure functional language like Haskell to do lots of IO seems like a strange choice given that Haskell makes side effects like IO more difficult than other languages. I'm curious to know how that affected the implem
675.
▲
by
codygman
12y ago
Awesome response, but.... > (In case the Pedagogical Brethren wish to come and "correct" me.) Seems very unnecessary and is a big departure from the Haskell community I'm personally used to. On top of that, it's not
676.
▲
by
codygman
12y ago
> Yes, and perhaps the bash programmer could likely eliminate that fault through testing, perhaps about as likely as the Haskell programmer could get the Haskell compiler to accept a program at all! Testing all the things that can go wro
677.
▲
by
codygman
12y ago
> The result is that the program will run in an infinite loop until either the fixed-size Int rolls over to 0, or the bignum-style integer consumes all available memory. That's certainly incorrect behavior. But I'd like to see
678.
▲
by
codygman
12y ago
> Sometimes I'd like my typechecker to launch some missiles. You'd like missiles to be launched at compile time?
679.
▲
by
codygman
12y ago
> suggesting that Go popularized typeclasses smacks of fanboyism I'm not exactly a fan of Go nor am I a fanboy, quite the opposite these days. I don't have to like go to mention that the way interfaces are used kind of accompl
680.
▲
by
codygman
12y ago
> A code base littered with Maybes is certainly a code smell. It's not because Maybe (and usually more practical Either) have functor instances. What this means is you can use fmap to apply pure functions to Maybes, Eithers, or any
681.
▲
by
codygman
12y ago
> "set -u" does help the bash programmer to reject incorrect bash programs and to put "test" where necessary, just as the Haskell compiler helps the Haskell programmer. Except the Haskell compiler (GHC here) doesn
682.
▲
by
codygman
12y ago
Can you explain how? Obviously at least two people either disagree or aren't privy to the knowledge you hold!
683.
▲
by
codygman
12y ago
But didn't Go effectively popularize typeclasses through interfaces?
684.
▲
by
codygman
12y ago
> You have proved the original (deductive) claim "if it compiles, it works" for that one specific example, but that does not hold in general. Are you sure it does not hold in general? Upon repeating mightybytes example with all
685.
▲
by
codygman
12y ago
I wouldn't consider StaticPointers a hack. I believe this is the feature you are talking about.
686.
▲
by
codygman
12y ago
fromMaybe (error "CALL ME!") Nothing
687.
▲
by
codygman
12y ago
I see that as a null error. Using maybe or optional would have solved that problem.
688.
▲
by
codygman
12y ago
> So, yes, type safety in golang is not as powerful as it is in Haskell. I think we already knew that though didn't we :) That is just a really big one for me I wanted to share and get others opinion on. I guess I just feel like a l
689.
▲
by
codygman
12y ago
Check out my update if you haven't seen it already. tl;dr The problem for me personally is when you start making functions based on the type of media and sacrifice type safety if MediaType is a string.
690.
▲
by
codygman
12y ago
Cool, that's a good refactoring. What if we don't care about the errors and just want to return nil or the value. The caveat is that when any of your http requests get a non 200 response code no further processing is done and nil
More ›