This function should never return Nothing, but it uses Bytes.Decode.decode, which returns a Maybe String.
If this is the case, can't you modify fromBytes to look like this?
fromBytes : Bytes -> String
fromBytes =
Decode.fromBytes |> Maybe.withDefault ""
The default value will never get used (if it does there's a bug which should be fixed anyway) and the user gets a nicer API to work with.
This function should never return Nothing, but it uses Bytes.Decode.decode, which returns a Maybe String.If this is the case, can't you modify
fromBytesto look like this?The default value will never get used (if it does there's a bug which should be fixed anyway) and the user gets a nicer API to work with.