@@ -99,13 +99,13 @@ fas lhs rhs =
9999 else fas 3 (fas d rhs)
100100 _ -> undefined
101101
102−hax :: Noun -> Noun
103−hax ~(Cell ~(Atom n _) ~(Cell b c _) _) =
102+hax :: Natural -> Noun -> Noun
103+hax n ~(Cell b c _) =
104104 let (a, m) = divMod n 2
105105 in case n of
106106 1 -> b
107− _ | m == 0 -> hax (cell (atom a) (cell (cell b (fas (a + a + 1) c)) c))
108− _ -> hax (cell (atom a) (cell (cell (fas (a + a) c) b) c))
107+ _ | m == 0 -> hax a (cell (cell b (fas (a + a + 1) c)) c)
108+ _ -> hax a (cell (cell (fas (a + a) c) b) c)
109109
110110tar :: Noun -> Noun
111111tar ~(Cell subject ~(Cell a b _) _) = tar' a b subject
@@ -136,7 +136,7 @@ tar' b c subject = case b of
136136 6 -> case tar' sig (tar' sig (tar' four (cell four x) subject) twoThree) (cell h j) of
137137 ~(Cell u v _) -> tar' u v subject
138138 10 -> case x of
139− ~(Cell b' ~(Cell u v _) _) -> hax $ cell b' $ cell (tar' u v subject) $ tar' h j subject
139+ ~(Cell ~(Atom b' _) ~(Cell u v _) _) -> hax b' $ cell (tar' u v subject) $ tar' h j subject
140140 11 -> case x of
141141 Cell _ ~(Cell u v _) _ -> tar' sig three (cell (tar' u v subject) (tar' h j subject))
142142 Atom _ _ -> tar' h j subject