You can use Ellie to "test" the code, changing only the result function and adding your extra code
Extra documentation to use this as reference:
- barcode
- status ( can only be: Delivered, Failed, On Course)
- deliveryTime if the package was delivered (you can use String for this field)
- failedTime if the delivery fails (you can use String for this field)
2 - Create an address type that has 2 different shapes, it can be a coordinates address or a textual address:
1 - Coordinate address, with longitude and latitude
2 - Postal address, with address line, postal code, city and country
- E.g. [1,2,3] -> [2,3,4]
- E.g. ["jouderian", "miguel", "suraj"] -> ["Hello jouderian", "Hello miguel", "Hello suraj"]
type alias Package =
{ barcode : String, status : String }
packages : List Package
packages =
[ { barcode = "111111", status = "Delivered" }
, { barcode = "2222222", status = "OnCourse" }
, { barcode = "33333", status = "Delivered" }
, { barcode = "44444", status = "FailedDelivery" }
This exercises are using different functions that we haven't discussed yet, but you can check the documentation here and try to do it
- Given a list of numbers, return all the numbers higher than 10
- Given a list of packages, return all the packages that are "Delivered"