omegazero | 15 years ago | on: Level 3 outbid Akamai on Netflix by reselling stolen bandwidth
omegazero's comments
omegazero | 15 years ago | on: Lisk — Lisp and Haskell
Taking the authors example and moving some of the processing to a where clause makes the flow much easier to follow:
someFunction conn (Foo n) (K {x=zot}) plib = do
withTransaction conn $ \db ->
coconut <- sizzleQuery [Foob n]
potato <- sizzleQuery [Foob n]
let sizzle = (zotify coconut) ++ potato ++ gravy
record = fasterize $ makeRecord' sizzle
date = dateOrError sizzle
in catch handler $ insertIntoDB sizzle plib
where sizzleQuery = queryTheDB "select * from sausages where sizzle = ?"
zotify c = zot (plib $ zip [1..] c)
dateOrError d = error "Unable to parse date"
`fromMaybe` parseDate d "date"
handler e = do something `with` (k $ the exception)
makeRecord' s = (MakeRecord { recName = sizzle "name"
, recAge = sizzle "age"
, recDate = date
})
$ Plib </> (fromMaybe "" $ sausages >>= bacon)
Also one of my favorite features of Haskell is using the $ as an unmatched left parenthesis, saving you from that blob of closing parenthesis that every lisp expression accumulates.One last thing, the author complains about the ambiguity of the indentation, but doesn't make any comment about the brace & semi-colon syntax. I personally don't like it, but it should be explained why it isn't an acceptable solution.
omegazero | 16 years ago | on: SourceForge Blocks Syria, Sudan, Iran, N. Korea & Cuba
omegazero | 16 years ago | on: Overweight students forced to take fitness course or not graduate
"Forced" seems a bit strong a word though when it's your choice where (or if) you attend college.
omegazero | 16 years ago | on: Ask HN: What's in your .vimrc file?
nmap H :s/\v(\S{8})/\1 /g<CR>:s/\v((\S{8} ){8})/\1<C-V><CR>/g<CR>:nohl<CR>
omegazero | 17 years ago | on: Instead of charging $X, why not charge $2X with prob 1/2 and $0 with prob 1/2?
There's always going to be less people you can afford 2X than X.
Or consider just the part of the transmission that occurs within Comcast's network. Case 1: data is sent from Comcast-user-A to Comcast-user-B, both pay a share of the costs. Case 2: data is sent from Comcast-user-A to Level3-Border-Router, only Comcast-user-A pays.