Hacker Newsnew | past | comments | ask | show | jobs | submit | wvs's commentslogin

"half 8 >>= half" might look a lot different from "half . half $ 8", but they're actually identical in underlying structure! The monad version is just using the wrong operator for visual comparison.

(.) composes two functions[1] but (>>=) composes a monad value with a monad function[2]. It'd be nice if we had an operator to compose two monad functions instead.

We can define that operator in terms of (>>=): "g <=< f = \x -> f x >>= g". You can check that the types work out[3]. Notice the great similarity to (.). (It's because they're both categorical composition operators of functions.)

Now we can write "half <=< half $ 8" and everything's dandy.

  [1]: (.) :: (b -> c) -> (a -> b) -> (a -> c)
  [2]: (>>=) :: m a -> (a -> m b) -> m b
  [3]: (<=<) :: (b -> m c) -> (a -> m b) -> (a -> m c)


This is impressive, but it does not make me want to try Haskell more.


Ahaha, I agree. Abstract monad derivations are quite a foreboding introduction.


Absolutely right! (And you preempted my comment at the top level).

I think one reason for "monad hell" is unawareness about this kind of composable style.


http://www.impredicative.com/ur/ has a very strong type system that claims to statically prevent any kind of code injection outright.


The main issue I have with singletons is that any mutable global state prevents your application from being first-class within its own runtime environment.

This is of course useful for unit testing, but also reduces hidden state dependencies between submodules.


The core issue is that encryption is useless without authentication. A MITM could just replace the original self-signed certificate with his own and read the decrypted plaintext while proxying the request so the user doesn't notice.


Yes; more importantly, a MITM can replace a validly signed certificate with a self-signed certificate. If browsers are lax about self-signed certificates, all TLS connections are weakened, not just the ones that "opt out" of "good" certificates.


Coming from a *nix background, it seems odd to me that a kernel null dereference would be exploitable from userland. Or that kernel functions be directly addressable from userland.

Is kernel memory mapped into user processes on Windows?


Most file references in Apple's frameworks track by both the target's path and inode, with the inode considered "more canonical". This is used in NSDocument apps where when you move a file with it still open, the app can tell where it went and continue working at the new path. Finder aliases (different from symlinks) also do this.



http://globulation2.org/ is an interesting RTS that tries to reduce micromanagement. It doesn't use a macro system, but a guidable AI.


Finding dropped words in coherent sentences is trivially easy given a large enough corpus of the language. Just looking at the occurrence probabilities of the surrounding words would be enough for most cases.


At least there's full disk encryption with FileVault, if you want encryption.


Yes, and under OS X Lion, FileVault2 is apparently a complete rewrite of the earlier FileVault, and it appears to be solid. TrueCrypt is also an excellent (and multi-platform) alternative.

But using whole-disk encryption doesn't invalidate my comments about Spotlight and Versions. When you've logged in (i.e., mounted the encrypted volume), Spotlight and Versions will still be storing pieces of yours files in hidden locations, you still can't truly delete a file without a lot of know-how, etc.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: