• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

A categorical programming language


Commit MetaInfo

修订版120cf18b2648b020c167ba1e389d8fdc51838640 (tree)
时间2021-11-14 15:03:49
作者Corbin <cds@corb...>
CommiterCorbin

Log Message

Refactor demos.

更改概述

差异

--- a/hive/demo/burning-ship.cammy
+++ b/hive/demo/burning-ship.cammy
@@ -1,9 +1,3 @@
11 (comp
2- (comp
3- (pair v2/burning-ship (comp (fun/const f-zero) fun/dup))
4- fun/app-80)
5- (comp
6- (comp (pair v2/norm (fun/const f/2)) f-lt)
7- (comp
8- (comp either (case f-zero f-one))
9- (v3/triple id id id)))))
2+ (fractal-membership v2/burning-ship nat/256)
3+ (v3/broadcast (f/subpair (fun/const f-one) id)))
--- a/hive/demo/mandelbrot.cammy
+++ b/hive/demo/mandelbrot.cammy
@@ -1,12 +1,3 @@
11 (comp
2- (comp
3- (comp
4- (fun/apppair
5- (fun/const (comp nat/256 nonempty/unfold))
6- (pair (comp (fun/const f-zero) fun/dup) v2/mandelbrot))
7- snd)
8- (comp
9- (list/filter (comp (pair v2/norm (fun/const f/2)) f-lt))
10- (comp list/len
11- (f/divpair nat/to-f (fun/const (comp nat/256 nat/to-f))))))
2+ (fractal-membership v2/mandelbrot nat/256)
123 (v3/broadcast (f/subpair (fun/const f-one) id)))
--- /dev/null
+++ b/hive/fractal-membership.cammy
@@ -0,0 +1,6 @@
1+(comp
2+ (iter-fractal @0 @1)
3+ (comp
4+ (list/filter (comp (pair v2/norm (fun/const f/2)) f-lt))
5+ (comp list/len
6+ (f/divpair nat/to-f (fun/const (comp @1 nat/to-f))))))
--- /dev/null
+++ b/hive/iter-fractal.cammy
@@ -0,0 +1,5 @@
1+(comp
2+ (fun/apppair
3+ (fun/const (comp @1 nonempty/unfold))
4+ (pair (comp (fun/const f-zero) fun/dup) @0))
5+ snd)
--- /dev/null
+++ b/hive/nat/2.cammy
@@ -0,0 +1 @@
1+(comp zero (comp succ succ))
--- /dev/null
+++ b/hive/nat/256.cammy
@@ -0,0 +1 @@
1+(comp (pair nat/2 nat/8) nat/exp)
--- /dev/null
+++ b/hive/nat/3.cammy
@@ -0,0 +1 @@
1+(comp nat/2 succ)
--- /dev/null
+++ b/hive/nat/8.cammy
@@ -0,0 +1 @@
1+(comp (pair nat/2 nat/3) nat/exp)