DEV Community

Discussion on: Find the last element of a list

Collapse
 
ivobalbaert profile image
ibalbaert

Thanks very much for this tutorial! I am trying to learn Unison, so this helps. But the versions with the fold patterns where still above my understanding level. I also don't understand the use of drop
Any suggestions where I could find a simple explanation?

Some remarks:
The ' in the last line should be dropped: last' = foldl (_ -> y -> Just y) Nothing
I am using release M1m:

  • case of is replaced by match with;
    • in the prop.last test !(list nat) is not understood by ucm: