• anton@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    Instead of

    if let Some(a_) = a{
        ()
    } else if let Some(b_)=b{
        ()
    } else {
        dostuff 
    }
    

    you could just use

    if a.isNone()&&b.isNone(){
        dostuff
    }
    

    Also if you don’t use the value in a match just use _

  • 82cb5abccd918e03@lemmygrad.ml
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    Doesn’t that construction only work in categories that also contain their own morphisms as objects since a profunctor maps (Cᵒᵖ × C) → Set and not the same like (Cᵒᵖ × C) → C? Since the category of Haskell types special, containing its own morphisms, so the profunctor could be like (haskᵒᵖ × hask) -> hask? or I just don’t understand it.

  • 6mementomori@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I don’t nearly know enough to understand this but is anyone willing to help me get the thing on the top :>