diff --git a/content/guides/core/hoon-school/Q-func.md b/content/guides/core/hoon-school/Q-func.md index 7d7d65ed..4a6651eb 100644 --- a/content/guides/core/hoon-school/Q-func.md +++ b/content/guides/core/hoon-school/Q-func.md @@ -114,30 +114,16 @@ q=15 120 ``` -### Exercise: Calculate a Factorial - -- Use `++reel` to produce a gate which calculates the factorial of a number. - - -## Aside on Wet Gates - -If you've already encountered [wet gates](/guides/core/hoon-school/R-metals) and how they handle their sample, you may eventually circle back around to attempting to write statements which curry a wet gate. For instance, here is an attempt to curry `++reel` which itself takes a gate (in this case `++add`) as an argument: +If you've already encountered [wet gates](/guides/core/hoon-school/R-metals) and how they handle their sample, you may eventually circle back around to attempting to write statements which curry a wet gate. For instance, here we curry `++reel` which itself takes a gate (in this case `++add`) as an argument: ```hoon > ((curr reel add) `(list @)`[1 2 3 4 ~]) -mull-grow --find.i.a -dojo: hoon expression failed +10 ``` -Unfortunately, `++cury` and `++curr` don't work with wet gates, and you'll see a `mull-grow` error. - -One solution is to “dry out” the wet gate using [`++bake`](/reference/hoon/stdlib/2b#bake): +### Exercise: Calculate a Factorial -```hoon -> ((curr (bake reel ,[(list @) _add]) add) `(list @)`[1 2 3 4 ~]) -10 -``` +- Use `++reel` to produce a gate which calculates the factorial of a number. ## Classic Operations