Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's interesting, thanks! It seems this one discriminates the different possibilities by type, and not by some extra tag (like the constructor in Haskell's ADTs). I wonder how that works, if you want to write something like the `either' function (or even just write down its type in C++):

    either :: (a -> c) -> (b -> c) -> Either a b -> c


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

Search: