You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kale needs to be able to handle parsing command line arguments, implicitly.
Current strategy
Search for a data Args = Args data type. If it is not present, then we ignore it. If it is not a product type, then we should fail loudly, probably.
Extract the text of the record. So data Args = Args Int gives us Int. data Args = Args { userName :: String } is {userName :: String }. data Args = Args { fooId :: Int <?> "The Foo's ID" } gives us { fooId :: Int <?> "The Foo's ID" }.
Paste the text of the arguments to the record into the creation of that variant of the sum type. So if we have
moduleFooTaskwheredataArgs=Args{userName::String}
then the generated code should do:
dataCommand=Foo{userName::String}
A problem with this is that any duplicate fields need to share a type.
Then, we'll need to transform the Command arguments into the Args constructor:
case cmd ofFoo {..} ->FooTask.task FooTask.Args {..}
is probably sufficient. hooray for recordwildcards!
The text was updated successfully, but these errors were encountered:
When the current setup attempts to parse the value and copy it into the Task module, it won't have the types imported!
Possible fix: If we're parsing a Foo.hs that has the preproccessor enabled, then we'll be looking for Foo/Types.hs. If that file is present, we import it. End users can ensure that they reexport all the types they need in there.
kale
needs to be able to handle parsing command line arguments, implicitly.Current strategy
Search for a
data Args = Args
data type. If it is not present, then we ignore it. If it is not a product type, then we should fail loudly, probably.Extract the text of the record. So
data Args = Args Int
gives usInt
.data Args = Args { userName :: String }
is{userName :: String }
.data Args = Args { fooId :: Int <?> "The Foo's ID" }
gives us{ fooId :: Int <?> "The Foo's ID" }
.Paste the text of the arguments to the record into the creation of that variant of the sum type. So if we have
then the generated code should do:
A problem with this is that any duplicate fields need to share a type.
Then, we'll need to transform the
Command
arguments into theArgs
constructor:is probably sufficient. hooray for recordwildcards!
The text was updated successfully, but these errors were encountered: