-
Notifications
You must be signed in to change notification settings - Fork 33
Docstrings on variables in environments #177
Conversation
src/Radicle/Internal/Effects.hs
Outdated
[ ("print!", \case | ||
[x] -> do | ||
putStrS (renderPrettyDef x) | ||
pure nil | ||
xs -> throwErrorHere $ WrongNumberOfArgs "print!" 1 (length xs)) | ||
|
||
, ( "doc!" | ||
, oneArg' "actual-doc" $ \case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why actual-doc
and not doc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just when I was developping, I didn't want to conflict with document
(which I thought was called doc
). Will fix.
1b69a2e
to
2610a20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More coming
[ ("print!", \case | ||
[x] -> do | ||
putStrS (renderPrettyDef x) | ||
pure nil | ||
xs -> throwErrorHere $ WrongNumberOfArgs "print!" 1 (length xs)) | ||
|
||
, ( "doc!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't actually impure, right? Is the idea that documentation raises questions about referential transparency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's as impure as print!
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It print's a formatted text to output, rather than return a string.)
f75eed8
to
874e3c9
Compare
@jkarni Replaced doc-objects with simple strings. |
0ef6a15
to
6439651
Compare
6439651
to
199f4c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from suggestions, LGTM!
@jameshaydon can you update the PR description to reflect the new design? |
This PR adds:
def
special form which takes a documentation object.doc!
primfn which prints the docs.apropos!
primfn which prints docs for all variables in scope.Fixes #163.
Fixes #71.