HN user

rfw

115 karma
Posts0
Comments42
View on HN
No posts found.
[GET] "/api/user/rfw/stories?hitsPerPage=30&page=0": 500 Failed to fetch user stories

Characterizing people wanting to contribute to the basic living conditions of people so pejoratively as 'unfortunate' and a 'continuation of the "white man's burden" ideology' is an extremely bad faith view of those who choose to do so.

We can implement it with a single `amb` function, too (I took some shortcuts that might have hidden some of the nature of the implementation)!

    -- Lifts a list into Amb.
    amb :: [a] -> Amb a
If we assume Amb is just List, then:
    amb = id
If we write the example in the original article in desugared style, we get:
    amb [1, 2, 3] >>= \x ->
    amb [4, 5, 6] >>= \y ->
    if x * y /= 8 then amb [] else pure () >>
    pure (x, y)
(we are forced to use an awkward condition with `pure ()` on the else branch when calling `amb` because Haskell requires us to return values on all branches. We can rewrite it equivalently in terms of `when` to hide that detail:
    amb [1, 2, 3] >>= \x ->
    amb [4, 5, 6] >>= \y ->
    when (x * y /= 8) (amb []) >>
    pure (x, y)
It now looks more similar to the original example.)

It ends up looking like continuation-passing style: conceptually, if we encounter `amb []` in the nested function, the nested computation ends and we start examining the next value in the list values being assigned to `x`: the implementation given in the original post does end up using callcc, so with some imagination you might be able to derive some kind of equivalence here :)

amb without side-effects can also be expressed in terms of the List monad, e.g.:

    do x <- [1, 2, 3]
       y <- [4, 5, 6]
       if x * y == 8 then pure (x, y)
                     else []
which can be equivalently reworded as the list comprehension:
    [(x, y) | x <- [1, 2, 3], y <- [4, 5, 6], x * y == 8]
i.e., the underlying structure of amb without side-effects can also be understood as just a search of the input space for values that fulfill some criteria, rather than as backtracking via continuations.

1. https://en.oxforddictionaries.com/definition/inclusivity

The practice or policy of including people who might otherwise be excluded or marginalized, such as those who have physical or mental disabilities and members of minority groups.

2. Without an understanding of power, is there a useful definition of "inclusivity"?

Or is it just a whitewashed feelgood platitude that can't mean anything in the end, because if you include everyone, including people who are decidedly discriminating against you, that it constitutes some ideal of "inclusiveness"?

Inclusivity is about wanting to better include minorities or disabled people in spaces where they may have been discriminated against and affecting their livelihoods, e.g. the workplace.

Using a definition of inclusivity here without a consideration for power dynamics between the parties involved is totally uncharitable: as you've observed in your comment, there is no barrier to actually denying "exclusive rights" to activists, so it's more a matter of respect to the people who want to use the symbol (e.g. the pride flag, which few people have issues with it being used to exclusively represent LGBT groups) to make their cause more visible, rather than a lack of "inclusivity".

Nat = Nat + 1 does end up being meaningful: since ultimately the numbers that fall out (e.g. Bool = 2) end up describing the sizes of sets, an interpretation of Nat is some infinite cardinal (aleph-null), which is the size of the set of natural numbers.

Forgive me if I misunderstand, I still don't understand your concern – TypeScript has type safety because it can check types at compile time (vs. JavaScript which has very limited type safety at run time). I don't think it's fair to call it a facade, because it is definitely commonly accepted as type safe.

The US announced their participation in the TPP in 2009, a free trade agreement encompassing trade between the US and New Zealand. The Obama administration had been very gung-ho about its ratification in the US, so I don't think the question of nuclear powered warships comes up much anymore.

I don't think you can squarely point to the New Zealand–China FTA for whichever interpretation of colonization you'd like – immigration laws were mostly unchanged by the FTA with the exception of short term work visas, and property purchases by Chinese investors is not an exclusively "countries who have negotiated free trade agreements with China" phenomenon (see Vancouver in Canada, Seattle in the US).

The Cult of DD 9 years ago

I think most people wouldn't know the difference (I had no idea!) and the knowledge might fall into the realm of obscure trivia.

Neat! Extension methods and getting rid of "var that = this;" in one!

It seems that it also extends to full expressions on the right-hand side of ::, so you can even do, for using Array operations over things that look like arrays but not quite:

    document.querySelectorAll('p')::([].map)(f)
instead of:
    [].map.call(document.querySelectorAll('p'), f)
(replace [].map with Array.prototype.map if it feels less gross)

The rule is misleading in cases like:

    int* arr[][10];
Spiral rule would state "arr is an array of pointers to arrays of 10 ints", where actually it would be "arr is an array of array of 10 pointers to int".

Instead, when you write declarations, do it from right-to-left, e.g.:

   char const* argv[];
"argv is an array of pointers to constant characters"

It doesn't help with reading, unfortunately.

Unfortunately, the usefulness is limited – the size of all Vects must be known at compile time. While this does prevent a large class of bugs that arise from incorrect compile-time knowledge, the size of the class of runtime bugs affected by this is a lot smaller, as for each differently-lengthed Vect, a distinct instantiation of the Vect type needs to exist at compile-time.

I love the idea! A few examples are a bit strawmanish but really when you're comparing languages like that who can resist the strawman.

The Clojure solutions do sacrifice a lot of safety though, due to dynamic typing (e.g. the visitor pattern, which relies on basically strings to do its dispatching).