freckle / bcp47

BCP-47 for Haskell
https://freckle.github.io/bcp47/
2 stars 1 forks source link

Add mapMaybe for Trie #16

Closed z0isch closed 3 years ago

z0isch commented 3 years ago

I needed a mapMaybe like function over Trie a when trying to write a function to union two Tries with some default behavior in text-assets

This implements mapMaybe but with a slight wrinkle in that you ultimately must return a Maybe (Trie a) due to the fact that Trie a should be non-empty.