Say I have a function doSomething : a -> Cmd b and another getArgument : Task x a. Can I combine them to get a single Cmd b?
Classic example would be getting current time with Time.now and passing it to a function Time.Posix -> Cmd b. In my case I want to use timestamp in the name of a file downloaded with File.Download.string.
Is there a way to compose the Task and a function returning a Cmd? Or do I always need two Msgs an two updates - first to get a and then to pass it to the doSomething and return a Cmd b?
Agreed - these kinds of tricks comes at a cost. Alternatively, you could make a specialized GetTimeForSaveFile-message, without the type-parameter. It feels “dumber”, but it’s probably the best approach