Menu

回溯 5 小时

…… 那么这次,也许能够出现新的“结局”吧

Lens Over Tea 笔记 1

因为发到 Medium 上会太丢人,所以发这里。

如果发现有什么错误,很可能是我错了。

类型

Lens s a  代表从 s 中获取 a,改变 s 中 a 的一个特殊结构。

例:Lens [a] a 代表:

  1. 我们可以从 [a] 中获取 a
  2. 我们可以在 [a] 中改变 a

例 2:Lens 可以代表:

  1. 我们可以从一个整数中获取这个整数的绝对值
  2. 我们可以从这个整数中改变这个整数的绝对值

比如说,假设我们有 x = -2 以及 y = 3, 假设我们用 Lens 以及同样的“操作函数”对 x 和 y 进行平方,那么运行结果是 f(x) = -4, f(y) = 9。

Lens s t a b 是 Generalized Lens,代表“整体结构”被从 s 变成了 t,“局部结构”从 a 变到了 b。

例:Lens [a] [a] a a 等价于 Lens [a] a,代表整体结构从 [a] 变到 [a],局部结构从 a 变到 a。

实现

我们先看一些有趣的结构:

我们仔细观察 Lens s t a b 的具体类型:

那么 Lens [a] [a] a a 等价于:

即为:

  1. 给我两个输入
  2. 第一个输入是一个 a -> f a,即一个将列表内元素映射到“包含”这个列表内元素的““容器(Functor)””内。
  3. 第二个输入是列表本身
  4. 最后返回结果为之前设置的“容器”,会包含一个最终“更新过”的列表本身

如果我们用 Identity 作为容器的话,那么结果如下:

“简化”之后就是:

就是普通的函数式列表更新。

如果我们采用 Const 作为容器的话,那么结果如下:

但是我们只能获得 Const 的第一个类型的结果,所以 Const a [a] 的 [a] 是永远获取不了的,我们只能获取 Const a [a] 的 a,也就是我们需要的“读取”效果。

例:

这样也就成功利用 Functor 和 Lens 的结构来做到:“一个函数结构,但是可以用来改变结构也可以用来读取结构”

 

China is Funny!

1.

People joke, and jokes mock, and by the way, mocking hurts.

We yearn for entertainment, spices of life, an escape out of our daily lives. We joke; we jest. Often totalitarian regimes conjure up “national enemies”, as to the Nazis are the Jews, as to the 50s U.S. are the “damn communists”. Well then, China is commonly regarded as a totalitarian regime, at least by the west.

So what are our “national enemies”?

 

2.

Americans frequently overestimate the “oppressiveness of the totalitarian Beijing”. Judging by the fact that your average American cannot differentiate between Japanese, Chinese, Korean, the people, and the languages, sometimes I just think the average American conflates Imperial China, Japan, North Korea, Korea, Panda Express, Stalinist USSR, and anything that seems “oriental” into one giant concept known as the “communist China”.

Sometimes to comedic effects: before entering Beijing, some paranoid tech worker was surprised to find that the Chinese government had complete disinterest in his copy of “1984”, his laptop, and his thoroughly encrypted hard drive.

Well, why would the Chinese government just randomly confiscate or decrypt some businessman’s laptop?

Anecdotes like this pops up quite a lot: the U.S’s liberal stances on feminists theory or queer theory or whatever theory that the Chinese mass simply does not care about, some random American still thinking that Chinese people can take concubines, the U.S’s view on Dalai Lama, on Tibet.

American people can bring great fun to China. American people are funny!

They want racial equality! They want Muslim refugees into their nation despite them being in a war of terrorism against Muslims.

What a joke!

 

3.

Well the problem with this “America is so funny” view is that: first, this is what Chinese media wants us to believe, and well, you know what Chinese media is like.

Chinese people maintain a weird sense of cynicality. They do not believe the “positive” aspects of many of the Chinese state media. They openly jest that the media only depicts the “good”, the “harmonious”, and the “politically correct”. Because of course if you do not judge those with a negative light you will be discarded as “naive”.

Yet the Chinese people fail to apply the same principles to their foreign news. They judge their news purely on face value. They like to mock the foreigners; they know that Americans are bad at maths, and every foreign news education-related, due to the nature of mass news, always seem to descend to the common denominator of “haha, these dumb Americans, so bad at maths”, or due to China’s long history of playing history whataboutism, descend to something like “but you Americans have such a bad human rights record too!”.

 

4.

The second problem is simply, the American people also view Chinese people as ignorant, and usually on online forums, Chinese people are “fun”.

They cheat, and yes, when they were not allowed to cheat, they even marched on the streets in protest for “not allowing us to cheat is unfair when everyone else cheats!”.

They obey to their party; they are racists: hey they even played this super racist ad on their TV! They are great copycats, with a complete disregard for copyrights, or even human rights!

 

5.

Well I am going to say that I am personally not feeling good when nations are making fun of each using facts that no one dare to critically consider.

It is like a perpetual “mocking” war to feel superior to other nations, and that is fine, as nationalism and patriotism always helps a nation, except to the individuals who should focus more on their own rationality.

 

6.

And I do not know the solution at all. I am writing this just to procrastinate my finals review anyway.

杂谈

游戏他们玩着口袋妖怪,却无心去玩养成类更佳精髓的游戏。

音乐他们听着二次元音乐,他们喜欢他们的音乐,但是当出现更佳小众的音乐的时候,他们选择了拒绝,被说成不好听。没有错,但是也很苍白。

他们晒着美食,晒着美景,有心周末去玩,却对有人会专门寻觅咖啡豆现磨咖啡感到奇怪。

他们对着美国的中餐感到不快,专程寻找着正宗的中餐,却对某些人要专门寻找茶叶感到不解。

 

你们所追求的生活品质,到最后,真的是“生活品质”吗,还是你们这个圈子之间养出来的“共同爱好”呢……?

当提出这些区别的时候,何必用“人都有各自的爱好”来维护呢…… 对小众爱好感到的奇怪,是不是能反思一下呢?

 

最后受伤的都是小众的角色啊。

“困难模式”

忽然觉得有种美好的“经历”叫做“成长”。

为了一个目标探索多年的我,总觉得比很多同龄人或多或少有着一种更佳“浓”的颜色。

不过几年来,每年固有的失败,未达成的愿望,给他人带来的失望,也——

很后悔啊。

 

那么,作为困难模式的玩家,在这里,再度“重置”。

 

希望这次,能够摆脱之前的所有困境,之前的所有包袱,达成自己最终的目标。