We have S.ifElse, but we currently lack straightforward case folding for the Boolean type (S.maybe and S.either provide case folding for Maybe a and Either a b respectively).
I think S.boolean would be a good addition to the library.
The one thing I very much dislike about the function is that one must learn that the constructors are essentially defined in false | true order rather than in true | false order. This is arbitrary, and does not match the argument order of S.ifElse. If we decide to add this function we should make it consistent with Haskell's bool, so some confusion is unavoidable.
We have
S.ifElse
, but we currently lack straightforward case folding for theBoolean
type (S.maybe
andS.either
provide case folding forMaybe a
andEither a b
respectively).I think
S.boolean
would be a good addition to the library.The one thing I very much dislike about the function is that one must learn that the constructors are essentially defined in
false | true
order rather than intrue | false
order. This is arbitrary, and does not match the argument order ofS.ifElse
. If we decide to add this function we should make it consistent with Haskell'sbool
, so some confusion is unavoidable.