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: More type errors I'm having trouble with (Thomas Koster)
2. Re: Issue with MultiParamTypeClasses (Ovidiu Deac)
3. Re: Functional Programming for the Object Oriented (David Moberg)
----------------------------------------------------------------------
Message: 1
Date: Tue, 8 Dec 2015 14:53:51 +1100
From: Thomas Koster <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] More type errors I'm having trouble
with
Message-ID:
<CAG1wH7BD+LT0K=fS+JJwSFXcJDTVTzNjczj+1JRCrZG=56p...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
On 4 December 2015 at 08:58, Dan Stromberg <[email protected]> wrote:
> I read somewhere (probably Learn You a Haskell or Real-World Haskell) that
> beginners should use a lot of type declarations, but perhaps that's not a
> great idea after all.
I agree. Excessive type signatures makes code harder to read, less
"beautiful" (yes, Haskell code can be beautiful), and increases the
surface area for bugs, typos and other mistakes.
Type inference in Haskell is an excellent aid for beginners and pros
alike, and beginners should learn to feel comfortable with it. Haskell
style commentators generally agree that type signatures for top-level
bindings are a good thing, but they should be used sparingly
everywhere else.
If you are using GHC, I have also found that temporarily removing some
top-level type signatures and compiling with -Wall may give you some
new insights into your functions. GHC warns you about the missing
signatures and tells you what it infers, which may be more
general/polymorphic than the type you originally entered. This can
help greatly to spot polymorphic functions, reduce code duplication
and find places where you can use folds and traversals from the
standard library (Data.Foldable, Data.Traversable, etc.).
--
Thomas Koster
------------------------------
Message: 2
Date: Tue, 8 Dec 2015 09:20:19 +0200
From: Ovidiu Deac <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Issue with MultiParamTypeClasses
Message-ID:
<cakvse7uupxx5aefon5kgayki_cymnskg1zdvxfr5isury+g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Indeed, with newtype it works like a charm. Thanks!
On Sun, Dec 6, 2015 at 8:26 PM, Marcin Mrotek <[email protected]>
wrote:
> Hello,
>
> This is not an issue with MultiParamTypeClasses. It's just that type
> synonyms always have to be used fully applied. You can use a newtype
> instead:
>
> newtype AdjList a = AdjList [(a,[a])]
>
> instance Graph AdjList Int where
> (...)
>
> Best regards,
> Marcin Mrotek
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/45884918/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 8 Dec 2015 12:45:03 +0100
From: David Moberg <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Functional Programming for the Object
Oriented
Message-ID:
<cal2+mivm5vfm_weidzcehb2agsgf9v5kx0jge_yz4qcdpbh...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Thanks I liked this video! :)
2015-11-18 20:35 GMT+01:00 ?ystein Kolsrud <[email protected]>:
> I gave a presentation on functional programming a couple of weeks ago
> that I thought might be of interest to this community as well:
>
> https://www.youtube.com/watch?v=I2tMmsZC1ZU
>
> It's target audience is programmers familiar with object oriented
> programming, and it presents how concepts from the functional paradigm
> are relevant also in most modern OO languages.
>
> For more information about the presentation, please refer to the following
> site:
>
>
> http://www.foocafe.org/previous_event/functional-programming-for-the-object-oriented
>
> --
> Mvh ?ystein Kolsrud
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/bd17acee/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 90, Issue 12
*****************************************