Better HN
topnewbestaskshowjobs
Log inSign up

secretguy

4 karma · joined Sep 13, 2013 (13y ago) · 2 submissions

Submissions

comment 12y ago · link · parent

Can you point out any misleading information in their advertisements?

By the way, it is a full blown OS.

comment 13y ago · link · parent

Or perhaps like this if you do not want to use `reverse` and want it to be tail recursive:

    collatz :: Int -> [Int]
    collatz x = go id x []
      where
        go :: ([Int] -> [Int]) -> Int -> [Int] -> [Int]
        go f 1 = f . (1:) 
        go f n = 
          if even n
            then go (f . (n:)) (n `div` 2)
            else go (f . (n:)) (3 * n + 1)