Sometimes I find myself programming a template "if the Bool is not false" or "if the list is not empty, use it, otherwise use something else."
I am looking for functions for Bool and List, which are possibly Maybe functions. Whether there is a?
Update: I wanted to use the Bool case as a generalization of a list. For example, when working with Data.Text as T:
if T.null x then x else foo x
I want to reduce this boiler plate code.
source
share