Since Time.now cannot fail (visible as per the type variable x), you can simply use http://package.elm-lang.org/packages/NoRedInk/elm-task-extra/2.0.0/Task-Extra#performFailproof, which relieves you from writing anything for the supposed fail case.
Am Mittwoch, 22. Juni 2016 schrieb Niklas Koponen : > Hi! > > I'm trying to get the current time in elm but I can't figure out how use > tasks. Now definition looks like this > > now : Task x Time > > The guide regarding tasks says: > > Second, notice that the error type is the type variable x. When we saw >> Http.getString it had a concrete error type Http.Error. The Time.now task >> is different in that it will not fail in a special way. You will always get >> the time back. This type variable x is basically saying “I am not going to >> force you to handle a particular type of errors” because it does not >> produce any. > > > I have this message: > > NewEntry Time > > The problem is I don't know what to write for the error when I do > Task.perform > > Task.perform NewEntry [WHAT HERE?] Time.now > > -Niklas > > -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <javascript:_e(%7B%7D,'cvml','elm-discuss%[email protected]');> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
