News for hackers. Stuff that matters.
Re:Functors, Applicatives, and Monads in Pictures (2013) by iamcurious on Thursday October 21, 2021 @09:28AM (#28944033)
The unwrapping is implicit so you can pretend it's not there until you absolutely need it. To take a related example from c# (please excuse my pseudo c#, I'm rusty) you can use the operator ?. to say:

    return myList?.deleteFirst?.takeFirst?.name
you could also say:

    if (myList != null){
        firstDeleted = myList.deleteFirst;
        if (firstDeleted != null){
            newFirst = myList.takeFirst;
            if( newFirst != null){
                return  name;
            }  
        } 
    }
but I find the first one much easier to think about.

There are no comments on this comment yet.