Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/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: Haskell Weekly News (Amy de Buitl?ir)
2. Re: Haskell Weekly News (Alexander Berntsen)
3. Re: Haskell Weekly News (Thiago Negri)
4. Re: Haskell Weekly News (Darren Grant)
5. Question about define my own typeclass (ke dou)
6. Re: Question about define my own typeclass (Brandon Allbery)
7. Re: Question about define my own typeclass (ke dou)
----------------------------------------------------------------------
Message: 1
Date: Thu, 27 Mar 2014 12:55:31 +0000 (UTC)
From: Amy de Buitl?ir <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Haskell Weekly News
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
I miss HWN. Especially the "quotes of the week".
------------------------------
Message: 2
Date: Thu, 27 Mar 2014 14:01:16 +0100
From: Alexander Berntsen <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Haskell Weekly News
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 27/03/14 13:55, Amy de Buitl?ir wrote:
> I miss HWN.
+1
I assume the editor doesn't have time for it any longer, but maybe
they'll find it encouraging that we miss it at least. :-)
- --
Alexander
[email protected]
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iF4EAREIAAYFAlM0IRwACgkQRtClrXBQc7UYEwEAqMUsZVGebIlmhNN7nj8OgL3g
uaa1zGgdKjonmmaRoAwA/24yBCbkCyEQix2SyMJvomZdAnnUQaBCQggyB7pADZmf
=sDi+
-----END PGP SIGNATURE-----
------------------------------
Message: 3
Date: Thu, 27 Mar 2014 12:21:18 -0300
From: Thiago Negri <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell Weekly News
Message-ID:
<CABLneZtRv0WA0S=_wqxh0QXPw2HctnWRYv0SjfBYLkvEF=b...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
+1
2014-03-27 10:01 GMT-03:00 Alexander Berntsen <[email protected]>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 27/03/14 13:55, Amy de Buitl?ir wrote:
> > I miss HWN.
> +1
>
> I assume the editor doesn't have time for it any longer, but maybe
> they'll find it encouraging that we miss it at least. :-)
>
> - --
> Alexander
> [email protected]
> https://secure.plaimi.net/~alexander
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iF4EAREIAAYFAlM0IRwACgkQRtClrXBQc7UYEwEAqMUsZVGebIlmhNN7nj8OgL3g
> uaa1zGgdKjonmmaRoAwA/24yBCbkCyEQix2SyMJvomZdAnnUQaBCQggyB7pADZmf
> =sDi+
> -----END PGP SIGNATURE-----
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140327/7745c956/attachment-0001.html>
------------------------------
Message: 4
Date: Thu, 27 Mar 2014 08:24:49 -0700
From: Darren Grant <[email protected]>
To: Haskell Beginners <[email protected]>
Subject: Re: [Haskell-beginners] Haskell Weekly News
Message-ID:
<CA+9vpFfXHeoryWFwcamnwWxv_X+9jg=nbcspowbc-zwfvqc...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Indeed thank you for the HWNs of the past! I miss them too. :-)
Cheers,
Darren
On Mar 27, 2014 8:21 AM, "Thiago Negri" <[email protected]> wrote:
> +1
>
>
> 2014-03-27 10:01 GMT-03:00 Alexander Berntsen <[email protected]>:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> On 27/03/14 13:55, Amy de Buitl?ir wrote:
>> > I miss HWN.
>> +1
>>
>> I assume the editor doesn't have time for it any longer, but maybe
>> they'll find it encouraging that we miss it at least. :-)
>>
>> - --
>> Alexander
>> [email protected]
>> https://secure.plaimi.net/~alexander
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2.0.22 (GNU/Linux)
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iF4EAREIAAYFAlM0IRwACgkQRtClrXBQc7UYEwEAqMUsZVGebIlmhNN7nj8OgL3g
>> uaa1zGgdKjonmmaRoAwA/24yBCbkCyEQix2SyMJvomZdAnnUQaBCQggyB7pADZmf
>> =sDi+
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140327/1df05776/attachment-0001.html>
------------------------------
Message: 5
Date: Thu, 27 Mar 2014 11:28:01 -0400
From: ke dou <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Question about define my own typeclass
Message-ID:
<CAG1_UCSnsOX_U2oOoXThoNh62Mk2G=26xc3+jsqe_x73ekx...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
Sorry for the spam.
I am new to Haskell.
I want to define my own typeclass which can convert from my own types like
MyBool, MyInt, and MyString to according Haskell types.
Here is my code:
module Conversion where
import qualified Prelude
class Conversion a where
conversion :: a -> b
data MyBool = MyTrue | MyFalse
instance Conversion MyBool where
conversion MyTrue = Prelude.True
conversion MyFalse =Prelude.False
Here is the error message:
Couldn't match expected type `b' with actual type `Prelude.Bool'
`b' is a rigid type variable bound by
the type signature for conversion :: MyBool -> b
at Conversion.hs:11:5
Does anyone know what's wrong with my code, and how to fix it?
Any hints will be appreciated !!
Best,
--Ke
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140327/f521be52/attachment-0001.html>
------------------------------
Message: 6
Date: Thu, 27 Mar 2014 11:36:16 -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] Question about define my own
typeclass
Message-ID:
<cakfcl4xwr01we6yo85mbpjqqukmle-zczd74k3fhdxgy_uk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Thu, Mar 27, 2014 at 11:28 AM, ke dou <[email protected]> wrote:
> class Conversion a where
> conversion :: a -> b
>
b is completely unspecified here, since it's not defined as part of the
typeclass. The literal meaning of this is that "the caller can request any
type it pleases, and you have no way of knowing what it is". So the only
possible result of `conversion` is bottom (e.g. `undefined`).
This is key: it does NOT mean that `conversion` gets to specify the result
type! You can't do that, except by specifying the type in the type
signature.
--
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://www.haskell.org/pipermail/beginners/attachments/20140327/a1ed90dd/attachment-0001.html>
------------------------------
Message: 7
Date: Thu, 27 Mar 2014 11:49:10 -0400
From: ke dou <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Question about define my own
typeclass
Message-ID:
<cag1_ucrx82rtwoh__xscvf5_qoucgtuhhqyfpdc02oaqt_s...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Thanks for your reply.
Yes, I understand that if I specify the 'b' to 'Prelude.Bool', it should
work, but what if I also want use the typeclass Conversion to convert other
types other than MyBool, like MyInt, or MyString?
--Ke
On Thu, Mar 27, 2014 at 11:36 AM, Brandon Allbery <[email protected]>wrote:
> On Thu, Mar 27, 2014 at 11:28 AM, ke dou <[email protected]> wrote:
>
>> class Conversion a where
>> conversion :: a -> b
>>
>
> b is completely unspecified here, since it's not defined as part of the
> typeclass. The literal meaning of this is that "the caller can request any
> type it pleases, and you have no way of knowing what it is". So the only
> possible result of `conversion` is bottom (e.g. `undefined`).
>
> This is key: it does NOT mean that `conversion` gets to specify the result
> type! You can't do that, except by specifying the type in the type
> signature.
>
> --
> 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://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140327/be9ddd89/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 69, Issue 39
*****************************************