That's why it is a provided function. :-) 2016-06-22 14:28 GMT+02:00 Niklas Koponen <[email protected]>:
> Thank you! That did the trick. > > Took a look at the Task.Extra source and I have to admit it would have > been impossible for me to come up with that solution. > > -Niklas > > keskiviikko 22. kesäkuuta 2016 14.53.20 UTC+3 Niklas Koponen kirjoitti: >> >> 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]. > 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.
