• 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

修订版ed5150e18a278c754349c9f9087aab23400c6cf8 (tree)
时间2022-03-02 12:36:12
作者Corbin <cds@corb...>
CommiterCorbin

Log Message

Get everything in the hive typechecked.

Had to remove three experiments which didn't work out. We can always
revisit them later.

更改概述

差异

--- a/cammy-rpy/cammylib/arrows.py
+++ b/cammy-rpy/cammylib/arrows.py
@@ -337,7 +337,7 @@ class Fold(Arrow):
337337 cdom, ccod = self._c.types(cs)
338338 cs.unify(ndom, cs.concrete("1"))
339339 x = cs.fresh()
340- cs.unify(cdom, cs.functor("pair", [ccod, x]))
340+ cs.unify(cdom, cs.functor("pair", [x, ccod]))
341341 cs.unify(ncod, ccod)
342342 return cs.functor("list", [x]), ccod
343343
--- a/cammy-rpy/cammylib/parser.py
+++ b/cammy-rpy/cammylib/parser.py
@@ -47,6 +47,7 @@ class CammyParser(object):
4747 args = []
4848 while not self.canAndDoesEat(')'):
4949 args.append(self.takeExpression())
50+ self.eatWhitespace()
5051 return Functor(head, args)
5152
5253
--- a/hive/complex-graph.cammy
+++ b/hive/complex-graph.cammy
@@ -4,6 +4,9 @@
44 (f/divpair
55 (comp fun/swap f-atan2)
66 (fun/const (f/mulpair f-pi f/2)))
7- (comp f/2 f-recip))
7+ (fun/const (comp f/2 f-recip)))
88 (f/mulpair v2/norm (fun/const f/2)))
99 hv2rgb)
10+
11+Map a complex number to a color. The magnitude is mapped to luminance and the
12+angle is mapped to hue.
--- a/hive/int/add.cammy
+++ /dev/null
@@ -1,3 +0,0 @@
1-(curry (pair
2- (comp (pair (comp fst fst) (comp snd fst)) (uncurry nat/add))
3- (comp (pair (comp fst snd) (comp snd snd)) (uncurry nat/add))))
--- a/hive/int/sub.cammy
+++ /dev/null
@@ -1 +0,0 @@
1-(curry (comp (pair id int/neg) (uncurry int/add)))
--- a/hive/list/triangular.cammy
+++ /dev/null
@@ -1 +0,0 @@
1-(comp (comp (pair id (fun/const zero)) list/repeat) (list/scan zero nat/add))
--- a/hive/nat/fact.cammy
+++ b/hive/nat/fact.cammy
@@ -2,3 +2,5 @@
22 (comp zero (pair id succ))
33 (comp (pair (comp fst succ) snd) (pair fst nat/mul))
44 ) snd)
5+
6+The factorial function on natural numbers.