Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Non-exhaustive patterns in function error (Galaxy Being)
   2. Re:  Non-exhaustive patterns in function error (Francesco Ariis)
   3. Re:  Non-exhaustive patterns in function error (Bob Ippolito)
   4. Re:  Non-exhaustive patterns in function error (Galaxy Being)
   5. Re:  Non-exhaustive patterns in function error (Brody Berg)


----------------------------------------------------------------------

Message: 1
Date: Thu, 25 Feb 2021 17:23:46 -0600
From: Galaxy Being <borg...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: [Haskell-beginners] Non-exhaustive patterns in function error
Message-ID:
        <cafahfsx5rh13m54fvgtzuccdcq3g7l76fcz_kaijby4g7ro...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I have this

intersect1 :: ([a],[a]) -> [a]
intersect1 (s,[])              = []
interesct1 (s,t:ts) | elem t s = t : intersect1 (s,ts)
                    | otherwise = intersect1 (s,ts)

and when I try this

intersect1 ([1,2],[1,2,3])

I get the error

 Non-exhaustive patterns in function intersect1

Not sure what's wrong with this.

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210225/4d19fc10/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 26 Feb 2021 00:45:41 +0100
From: Francesco Ariis <fa...@ariis.it>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] Non-exhaustive patterns in function
        error
Message-ID: <20210225234541.GA31267@extensa>
Content-Type: text/plain; charset=us-ascii

Il 25 febbraio 2021 alle 17:23 Galaxy Being ha scritto:
> I have this
> 
> intersect1 :: ([a],[a]) -> [a]
> intersect1 (s,[])              = []
> interesct1 (s,t:ts) | elem t s = t : intersect1 (s,ts)
>                     | otherwise = intersect1 (s,ts)
> 
> and when I try this
> 
> intersect1 ([1,2],[1,2,3])
> 
> I get the error
> 
>  Non-exhaustive patterns in function intersect1
> 
> Not sure what's wrong with this.

Pattern (_,[]) is not matched!


------------------------------

Message: 3
Date: Thu, 25 Feb 2021 15:52:30 -0800
From: Bob Ippolito <b...@redivi.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Non-exhaustive patterns in function
        error
Message-ID:
        <CACwMPm8d6C8fCEbE=xdu0gfooga_8cb6kkfrsx+igsztsus...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

It's the typo. Note that you'll also need an Eq a typeclass constraint for
this type signature to be correct (which is the next error you'd get)

-- underscores for emphasis
inter_se_ct1
inter_es_ct1


On Thu, Feb 25, 2021 at 3:24 PM Galaxy Being <borg...@gmail.com> wrote:

> I have this
>
> intersect1 :: ([a],[a]) -> [a]
> intersect1 (s,[])              = []
> interesct1 (s,t:ts) | elem t s = t : intersect1 (s,ts)
>                     | otherwise = intersect1 (s,ts)
>
> and when I try this
>
> intersect1 ([1,2],[1,2,3])
>
> I get the error
>
>  Non-exhaustive patterns in function intersect1
>
> Not sure what's wrong with this.
>
> LB
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210225/d024dfc3/attachment-0001.html>

------------------------------

Message: 4
Date: Thu, 25 Feb 2021 20:00:41 -0600
From: Galaxy Being <borg...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Non-exhaustive patterns in function
        error
Message-ID:
        <cafahfswiwmr5odqst1m4ai21_ognvrf953ch-juhwheyk_f...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

How embarrassing...

intersect1 :: (Eq a) => ([a],[a]) -> [a]


On Thu, Feb 25, 2021 at 5:53 PM Bob Ippolito <b...@redivi.com> wrote:

> It's the typo. Note that you'll also need an Eq a typeclass constraint for
> this type signature to be correct (which is the next error you'd get)
>
> -- underscores for emphasis
> inter_se_ct1
> inter_es_ct1
>
>
> On Thu, Feb 25, 2021 at 3:24 PM Galaxy Being <borg...@gmail.com> wrote:
>
>> I have this
>>
>> intersect1 :: ([a],[a]) -> [a]
>> intersect1 (s,[])              = []
>> interesct1 (s,t:ts) | elem t s = t : intersect1 (s,ts)
>>                     | otherwise = intersect1 (s,ts)
>>
>> and when I try this
>>
>> intersect1 ([1,2],[1,2,3])
>>
>> I get the error
>>
>>  Non-exhaustive patterns in function intersect1
>>
>> Not sure what's wrong with this.
>>
>> LB
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210225/f7c145b7/attachment-0001.html>

------------------------------

Message: 5
Date: Thu, 25 Feb 2021 19:51:41 -0800
From: Brody Berg <brodyb...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Non-exhaustive patterns in function
        error
Message-ID:
        <CAGAyAWN+2CdvDDtGRXiDR4B=ruwuggcmbtts6ojuyv8+g2c...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Don’t worry about it. We’ve all been there.

On Thu, Feb 25, 2021 at 18:01 Galaxy Being <borg...@gmail.com> wrote:

> How embarrassing...
>
> intersect1 :: (Eq a) => ([a],[a]) -> [a]
>
>
> On Thu, Feb 25, 2021 at 5:53 PM Bob Ippolito <b...@redivi.com> wrote:
>
>> It's the typo. Note that you'll also need an Eq a typeclass constraint
>> for this type signature to be correct (which is the next error you'd get)
>>
>> -- underscores for emphasis
>> inter_se_ct1
>> inter_es_ct1
>>
>>
>> On Thu, Feb 25, 2021 at 3:24 PM Galaxy Being <borg...@gmail.com> wrote:
>>
>>> I have this
>>>
>>> intersect1 :: ([a],[a]) -> [a]
>>> intersect1 (s,[])              = []
>>> interesct1 (s,t:ts) | elem t s = t : intersect1 (s,ts)
>>>                     | otherwise = intersect1 (s,ts)
>>>
>>> and when I try this
>>>
>>> intersect1 ([1,2],[1,2,3])
>>>
>>> I get the error
>>>
>>>  Non-exhaustive patterns in function intersect1
>>>
>>> Not sure what's wrong with this.
>>>
>>> LB
>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners@haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210225/7cfab5d0/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 151, Issue 12
******************************************

Reply via email to