Better HN
topnewbestaskshowjobs
Log inSign up

g__

39 karma · joined Aug 31, 2009 (17y ago) · 18 submissions

Submissions

comment 15y ago · link · parent

Functor typeclass in Haskell models category-theoretic endofunctor rather well.

comment 15y ago · link · parent

DON'T start functional programming with monads. Familiarize with currying, pattern matching, how to create data types in Haskell, using recursion instead of loops, higher order functions, list comprehensions, type classes, polymorphism in Haskell (different than subtyping in OOP). Ignore monads for a while. To understand monads you must have a good grip of those concepts. You can start with http://learnyouahaskell.com/chapters.

You'll see Haskell tutorials delay telling about the concept. There's a reason.

For a bird's eye of monads you can check this: http://www.reddit.com/r/programming/comments/64th1/monads_in...

If you are ready, read and do exercises in http://blog.sigfpe.com/2007/04/trivial-monad.html and then http://blog.sigfpe.com/2006/08/you-could-have-invented-monad....

comment 16y ago · link · parent

What does the following mean, on http://www.google.cn/landing/cnexp/indexd.html?

我们已移至 google.com.hk

请收藏我们的新网址

comment 16y ago · link · parent

GHC 6.6 is almost 4 years old, please upgrade. (http://hackage.haskell.org/platform/)

comment 16y ago · link · parent

And it's extremely fast:

  $ pv /dev/zero > /dev/null
  18.6GB 0:00:05 [3.76GB/s] [    <=>                                            ]

6.

Wikileaks is back(wikileaks.org ↗)

2 points · by g__ · 16y ago · discuss

comment 16y ago · link · parent

Iterators sometimes require restructuring, as in

http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

In Haskell they don't - you might write this "producer-consumer" composing a function that produces a stream with a function that consumes a stream. How would you approach that problem in C++?

comment 16y ago · link · parent

Under assumption P=NP, a polynomial algorithm is already known (!): http://en.wikipedia.org/wiki/P_%3D_NP_problem#Polynomial-tim...

The problem is: will humanity find a feasible algorithm?

9.

Online math videos(mathoverflow.net ↗)

1 points · by g__ · 17y ago · discuss

comment 17y ago · link · parent

I have mixed feelings.

http://stackoverflow.com/questions/184118/what-programming-b...

http://www.amazon.com/review/R1W0YZZWT53Y9M/ref=cm_cr_rdp_pe...

comment 17y ago · link · parent

You'd have to determine if a program halts. Unless you restrict to non-Turing-complete language, this is undecidable.

comment 17y ago · link · parent

This answer is also correct in another way :)

http://threesixty360.wordpress.com/2008/04/30/1-2-4-8-what-c...

comment 17y ago · link · parent

I Was also an Illegal E-Mail Spammer for 5 Years. I got Caught. AMA

http://www.reddit.com/r/IAmA/comments/9ebku/

comment 17y ago · link · parent

Simple version of B-T in 1D:

http://www.math.ucla.edu/~tao/resource/general/121.1.00s/tar...

comment 17y ago · link · parent

and $ map can be shortened to all in many places.

I'd use pointless style more: row = (!!)

The function valid has a lot of repetition, maybe the repeating part can be abstracted of?

Instead of length possible > 0, you can use not $ null possible. This is faster, since it doesn't go through the whole list.

Instead of pattern matching on Maybe (tile), you can use Prelude's maybe.

16.

Puzzles(wiki.xkcd.com ↗)

3 points · by g__ · 17y ago · discuss

comment 17y ago · link · parent

Another nice collection:

http://www.reddit.com/r/programming/comments/9220o/ask_progg...

comment 17y ago · link · parent

http://news.ycombinator.com/item?id=825589