deepakjois/blaze-html — comment on commit aa17899d21d27a33b4f631a05ece843570af5063
File:  line 0
By meiersi:

Note that `fromJust` is always a red herring in code. It results in unnecessary possibilities for (even very uninformative) runtime failures. The error message is always `"*** Exception: Maybe.fromJust: Nothing"`. In most cases, you can avoid using `fromJust` using pattern matching. Here,

False -> case stripPrefix "data-" k of
Just prefix ->
Nothing | ignore -> ""
| otherwise ->

does the trick. It gives you a static guarantee that your code never bails due to slight differences in the validity check and the actual use of `fromJust`.