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. Re:  haskell platform (DJ)
   2. Re:  haskell platform (Rein Henrichs)
   3.  Typeclass question (Alan Buxton)
   4. Re:  Typeclass question (David McBride)


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

Message: 1
Date: Wed, 13 Jan 2016 15:15:28 -0500
From: DJ <ja...@arqux.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] haskell platform
Message-ID: <5696b060.5090...@arqux.com>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"



On 16-01-11 11:12 PM, amin...@gmail.com wrote:
> "Use stack" is one solution but the Haskell Platform is alive and well 
> too. Your distro has an old version of the HP but the current HP has a 
> recent GHC.
>
> Tom
>
Right - thanks for pointing that out. I see that I can download a 
current one from the "generic" link on the HP page. No doubt that is 
what I should use if I stick with HP.

Now I am left to wonder why package maintainers are so far behind on 
Ubuntu and Mint. Which I actually don't care enough about to find the 
answer, since I have two options.

Best,

- DJ -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160113/ff0fab3f/attachment-0001.html>

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

Message: 2
Date: Wed, 13 Jan 2016 20:44:49 +0000
From: Rein Henrichs <rein.henri...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] haskell platform
Message-ID:
        <cajp6g8wkqcjfzekg_elv8nwdnsw3k0xgihdjgashrstmwkb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

DJ, FWIW:

The policies of the various OS-level package managers tend to make it
difficult for maintainers to update packages frequently. Taking Ubuntu as
an example, packages in ubuntu repos stay at the same version for *the
entire release cycle* of the Ubuntu release that they are on unless a newer
version is backported via the backport repository. In practice, this
generally means that most packages are up to 6 months out of date most of
the time?and packages on older releases can be *years* out of date. (Other
distros such as Arch use a rolling release model that effectively means
that packages tend to get update every few weeks rather than every few
quarters.)

For any software whose rate of change exceeds the rate of change allowed
for by the release cycle or other maintenance practices of your distro,
it's best to seek alternate sources if you intend to use latest
versions. The general strategy for acquiring newer versions of software
through your OS-level package manager is to find alternative repositories.
For Ubuntu, this means the use of PPAs.

However, if you combine the difficulty in installing the latest HP with the
fact that it has more or less fallen into disfavor with the introduction of
Stack, which manages its own installation separately from your OS-level
package manager, the best solution for most people is probably just to use
Stack at this point.

On Wed, Jan 13, 2016 at 12:15 PM DJ <ja...@arqux.com> wrote:

>
>
> On 16-01-11 11:12 PM, amin...@gmail.com wrote:
>
> "Use stack" is one solution but the Haskell Platform is alive and well
> too. Your distro has an old version of the HP but the current HP has a
> recent GHC.
>
> Tom
>
> Right - thanks for pointing that out. I see that I can download a current
> one from the "generic" link on the HP page. No doubt that is what I should
> use if I stick with HP.
>
> Now I am left to wonder why package maintainers are so far behind on
> Ubuntu and Mint. Which I actually don't care enough about to find the
> answer, since I have two options.
>
> Best,
>
> - DJ -
> _______________________________________________
> 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/20160113/eaeb70dc/attachment-0001.html>

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

Message: 3
Date: Wed, 13 Jan 2016 21:53:00 -0000
From: "Alan Buxton" <alanbux...@gmail.com>
To: "'The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell'" <beginners@haskell.org>
Subject: [Haskell-beginners] Typeclass question
Message-ID: <005501d14e4c$c619b6b0$524d2410$@gmail.com>
Content-Type: text/plain; charset="iso8859-7"

What am I doing wrong in this admittedly contrived example?

 

The code below will compile. It works as expected, unless I try to do
"toMyParam Nothing". See below:

?: let arr = [P1 3.0, P2 'x']

?: toMyParam False

P2 'F'

?: toMyParam (Just 'x')

P2 'x'

?: toMyParam Nothing

 

<interactive>:38:1:

    No instance for (ToMyParam a0) arising from a use of `toMyParam'

    The type variable `a0' is ambiguous


Code below:

 

 

data MyParam = P1 Double | P2 Char deriving Show

 

class ToMyParam a where

  toMyParam :: a -> MyParam

 

instance ToMyParam Bool where

  toMyParam False = P2 'F'

  toMyParam True = P2 'T'

 

instance ToMyParam Char where

  toMyParam = P2

 

instance ToMyParam Double where

  toMyParam = P1

 

instance ToMyParam a => ToMyParam (Maybe a) where

  toMyParam Nothing = P1 0.0

  toMyParam (Just x) = toMyParam x

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160113/f1763122/attachment-0001.html>

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

Message: 4
Date: Wed, 13 Jan 2016 16:59:33 -0500
From: David McBride <toa...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Typeclass question
Message-ID:
        <CAN+Tr40=vg5egfxzcksjvg0qhj-zxfefajbecrkhf3emfwt...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

"toMyParam Nothing" is of type "ToMyParam a => Maybe a", but because you
used Nothing and not Just (something of type a) doesn't know what the "a"
is and so you have to tell it.  The fact that you don't reference the a in
the Nothing case does not exempt you from this requirement.

toMyParam (Nothing :: Maybe Char) will fix your error.  I think there might
be a way to get rid of this ambiguity via a type extension but I'm not
entirely sure.

On Wed, Jan 13, 2016 at 4:53 PM, Alan Buxton <alanbux...@gmail.com> wrote:

> What am I doing wrong in this admittedly contrived example?
>
>
>
> The code below will compile. It works as expected, unless I try to do
> ?toMyParam Nothing?. See below:
>
> ?: let arr = [P1 3.0, P2 'x']
>
> ?: toMyParam False
>
> P2 'F'
>
> ?: toMyParam (Just 'x')
>
> P2 'x'
>
> ?: toMyParam Nothing
>
>
>
> <interactive>:38:1:
>
>     No instance for (ToMyParam a0) arising from a use of `toMyParam'
>
>     The type variable `a0' is ambiguous
>
>
> Code below:
>
>
>
>
>
> data MyParam = P1 Double | P2 Char deriving Show
>
>
>
> class ToMyParam a where
>
>   toMyParam :: a -> MyParam
>
>
>
> instance ToMyParam Bool where
>
>   toMyParam False = P2 'F'
>
>   toMyParam True = P2 'T'
>
>
>
> instance ToMyParam Char where
>
>   toMyParam = P2
>
>
>
> instance ToMyParam Double where
>
>   toMyParam = P1
>
>
>
> instance ToMyParam a => ToMyParam (Maybe a) where
>
>   toMyParam Nothing = P1 0.0
>
>   toMyParam (Just x) = toMyParam x
>
>
>
>
>
> _______________________________________________
> 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/20160113/fcb82628/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 91, Issue 21
*****************************************

Reply via email to