[Haskell-cafe] incomplete-uni-patterns
Teofil Camarasu
teofilcamarasu at gmail.com
Thu Jan 26 10:34:14 UTC 2023
Another possibility is to write something like:
main = do
[addr, port] <- pure args
...
This is desugared in terms of `fail` rather than `error`, so it will also
do the right thing in the `Maybe` monad.
Though of course this only works in do-notation.
-- Teo
On Thu, 26 Jan 2023, 09:35 Henning Thielemann, <
lemming at henning-thielemann.de> wrote:
>
> On Thu, 26 Jan 2023, Kazu Yamamoto (山本和彦) via Haskell-Cafe wrote:
>
> > Even if this example is not appearing to you, there are a lot of
> > situations of this kind in practical code.
>
> I know. Each of this is an occasion to think about more appropriate types,
> such that only valid values can be
> represented._______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230126/bfd95cc8/attachment.html>
More information about the Haskell-Cafe
mailing list