Send Beginners mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

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


Today's Topics:

   1. Re:  another type problem
      (Sumit Sahrawat, Maths & Computing, IIT (BHU))
   2. Re:  another type problem (Brandon Allbery)
   3. Re:  another type problem
      (Sumit Sahrawat, Maths & Computing, IIT (BHU))
   4. Re:  another type problem (Roelof Wobben)


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

Message: 1
Date: Tue, 12 May 2015 19:54:54 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
        <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] another type problem
Message-ID:
        <CAJbEW8OF+7=2snvphquxgio9ltcsypx-nslf4r6+nbkjrcb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

The type of the cons operator (:) is

    (:) :: a -> [a] -> [a]

The way you are invoking it expects it to have the type

    (:) :: a -> Maybe [a] -> [a] -- not valid

One solution is to write such a function yourself, while the other would be
to rewrite your code to invoke it correctly.

On 12 May 2015 at 19:46, Brandon Allbery <[email protected]> wrote:

> On Tue, May 12, 2015 at 10:11 AM, Roelof Wobben <[email protected]> wrote:
>
>>  I do not understand what you are saying to me.
>>
>> I know that init produces a Maybe [a] . That is why I did put a Just
>> before it.
>>
>
> You are invoking it again though, and using its result as if it produces
> [a] instead of Maybe [a].
>
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> [email protected]
> [email protected]
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>


-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150512/c6332719/attachment-0001.html>

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

Message: 2
Date: Tue, 12 May 2015 10:25:04 -0400
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] another type problem
Message-ID:
        <cakfcl4xm327g3oboh4ak7yrud9beoteoe_g4o23gzslxy3n...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, May 12, 2015 at 10:21 AM, Roelof Wobben <[email protected]> wrote:

> What is then the right way to do. I still do not understand what you are
> trying to make clear to me.
>

Ask yourself: what is the type of (Just (x: (init' xs))) ?

-- 
brandon s allbery kf8nh                               sine nomine associates
[email protected]                                  [email protected]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150512/a1472d6c/attachment-0001.html>

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

Message: 3
Date: Tue, 12 May 2015 19:56:20 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
        <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] another type problem
Message-ID:
        <CAJbEW8O=pEHVLJ23jN=jcHtVg=sdaie+jwtwwvsxp2lyk8a...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Also remember that Just has the type

    Just :: a -> Maybe a

Thus putting in a Just doesn't help with your issue.

On 12 May 2015 at 19:54, Sumit Sahrawat, Maths & Computing, IIT (BHU) <
[email protected]> wrote:

> The type of the cons operator (:) is
>
>     (:) :: a -> [a] -> [a]
>
> The way you are invoking it expects it to have the type
>
>     (:) :: a -> Maybe [a] -> [a] -- not valid
>
> One solution is to write such a function yourself, while the other would
> be to rewrite your code to invoke it correctly.
>
> On 12 May 2015 at 19:46, Brandon Allbery <[email protected]> wrote:
>
>> On Tue, May 12, 2015 at 10:11 AM, Roelof Wobben <[email protected]> wrote:
>>
>>>  I do not understand what you are saying to me.
>>>
>>> I know that init produces a Maybe [a] . That is why I did put a Just
>>> before it.
>>>
>>
>> You are invoking it again though, and using its result as if it produces
>> [a] instead of Maybe [a].
>>
>> --
>> brandon s allbery kf8nh                               sine nomine
>> associates
>> [email protected]
>> [email protected]
>> unix, openafs, kerberos, infrastructure, xmonad
>> http://sinenomine.net
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
>
> --
> Regards
>
> Sumit Sahrawat
>



-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150512/f4833a46/attachment-0001.html>

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

Message: 4
Date: Tue, 12 May 2015 16:27:30 +0200
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] another type problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150512/3c36ad71/attachment.html>

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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 83, Issue 21
*****************************************

Reply via email to