IntersectMBO / formal-ledger-specifications

Formal specifications of the cardano ledger
Apache License 2.0
36 stars 13 forks source link

Naming of `mapPartial` #446

Closed WhatisRT closed 3 months ago

WhatisRT commented 4 months ago

mapPartial isn't a a name that will be understood without explanation. Should we rename it to something else? Are there other good options, like a set-builder notation?

WhatisRT commented 4 months ago

We discussed some alternative options like map*, map? and mapPartialFun. Classical notation for mapping a set with a function would be f(X) or f[X] where X is a set, but that doesn't really apply here.

For now, we decided to leave it as it is and add a description for mapPartial in the Notation Section.

jmchapman commented 3 months ago

mapMaybe?

WhatisRT commented 3 months ago

I guess that's another option, but it doesn't save us from having to explain it. In which case, sticking with mapPartial is a bit easier.

jmchapman commented 3 months ago

It still requires explanation but it's Haskell terminology so should be more familiar to some...