-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual Modules and Elm.Arg #88
Conversation
src/Elm.elm
Outdated
@@ -10,8 +10,10 @@ module Elm exposing | |||
, Declaration | |||
, comment, declaration | |||
, withDocumentation | |||
, expose, exposeWith | |||
, group |
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.
I think a withGroup : Declaration -> Declaration
could also make sense?
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.
Do you know if you'd need that in your code or if group
would work out?
My thinking is that group
is going to be pretty great for defining related things all right next to each other, which I already kinda do.
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.
I don't think it would be needed, and one can keep using exposeWith
in that case?
Thinking more about it, I think that pushing towards having a group close to each other is good
src/Elm.elm
Outdated
done : Fn Expression -> Expression | ||
done (Fn toFnDetails) = |
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.
I would call this fnDone
? And probably the above fnArg
.
The reason is that Elm.fnDone
is ~clear, Elm.done
is not? Am I done with a let? With a function?
) | ||
|
||
|
||
body : (args -> Expression) -> Fn args -> Expression |
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.
I'm mildly confused by this? What's the purpose?
(Elm.value | ||
{ importFrom = modName | ||
, name = Format.sanitize name | ||
, annotation = Nothing |
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.
Here we could grab the type from the Arg
, couldn't we?
src/Elm/Declare.elm
Outdated
{ declaration : Declaration | ||
, call : List Expression -> Expression | ||
, callFrom : List String -> List Expression -> Expression | ||
{ declaration : Elm.Declaration |
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.
What if you instead accept a Fn tipe
and return a Decl tipe
? Or something in that vein
src/Elm/Declare.elm
Outdated
|
||
{-| -} | ||
with : Decl required -> Module (required -> val) -> Module val | ||
with decl mod = |
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.
We also need withUnexposed : Decl optional -> Module val -> Module val
I think.
Plus either have with
implicitly expose or add an expose/exposeWith : Decl -> Decl
Improve types, deduplicate code
Add Elm.Case.string
Move the getter to before type args, add variant3 and variant4
Add Elm.Declare.withDocumentation
[Post Big Release] Cleanup
An API sketch!
That's mostly implemented!