Conversation
|
This looks great. Two questions:
Thanks. |
|
For 1, I was copying what clojure called it (same with nth). I'll change it to /= to keep with haskell. I'll add documentation tonight, sorry for the delay. |
|
Oh, gotcha, I didn’t realize Clojure had a function named And no worries—I’d just like to make it a policy to avoid adding functions to the standard library without also adding documentation, but there’s no rush. |
ef40c56 to
c7ed1b9
Compare
c7ed1b9 to
e9d457b
Compare
|
The documentation has been added. |
| 128) | ||
| (take 5 (unfoldr (λ [x] (Just (Tuple x {x + 2}))) 0)))} | ||
|
|
||
| @defproc[(concat [_ (Monoid m)] [ms (t:List m)]) m]{ |
There was a problem hiding this comment.
These uses of Monoid need to be t:Monoid to be properly linked.
|
|
||
| @(hackett-examples | ||
| (unfoldr (λ [x] (if {x == 1} Nothing | ||
| (Just (Tuple (show x) (quotient! x 2))))) |
There was a problem hiding this comment.
If you’re going to use quotient! and remainder! in examples, they probably need documentation as well. (My policy so far has basically been to document everything undocumented as I use them in other pieces of documentation.)
| @defproc[(fold-map [_ (Monoid m)] [f {a t:-> m}] [xs (List a)]) m]{ | ||
|
|
||
| Applies @racket[f] to each element of @racket[xs] and concatenates each resulting list. Equivalent | ||
| to @racket[=<<] when @racket[m] is @racket[(List b)] for some @racket[b]. |
There was a problem hiding this comment.
The two uses of List here should be t:List.
| (all? (<= 2) {1 :: (error! "never happens") :: Nil}) | ||
| (all? (<= 1) Nil))} | ||
|
|
||
| @defproc[(elem? [_ (t:Eq a)] [x a] [xs (t:List a)]) t:Bool]{ |
There was a problem hiding this comment.
I don’t think there’s currently a great way to typeset this sort of function, but I don’t think this is a good way. Maybe just use defthing here for now.
The git history should be a lot nicer now.