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: Add Global Package (Jeffrey Brown)
2. import question (Galaxy Being)
3. Re: import question (Francesco Ariis)
4. Re: import question ([email protected])
5. Re: import question (Galaxy Being)
6. Re: import question (Francesco Ariis)
7. Re: import question (Galaxy Being)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Feb 2021 08:07:19 -0500
From: Jeffrey Brown <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Add Global Package
Message-ID:
<CAEc4Ma3q_re8w++yk_paU1LqutNf4M-W0+ppPKqGWkP=+wt...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
If you use Stack then you can add a .cabal file to your project that
indicates what it depends on. Here's an example I use:
https://github.com/JeffreyBenjaminBrown/montevideo/blob/master/mtv-util/mtv-util.cabal
(It uses the `random` package too; if you search for "random" you'll find
the dependencies.)
Stack has global config options too:
https://docs.haskellstack.org/en/stable/yaml_configuration/
which seems likely to offer the same capability; I don't know how to do it
that way as I always work within a project with a cabal file.
On Wed, Feb 17, 2021 at 2:08 AM Francesco Ariis <[email protected]> wrote:
> Il 16 febbraio 2021 alle 20:49 A. Mc. ha scritto:
> > I'm attempting to install and update the .yaml file so I don't have to
> run
> > the command $ stack ghci --package random every single time I want to
> load
> > a module that imports System.Random. Or maybe I need to use chocolatey?
>
> No idea with stack, but with cabal is:
>
> cabal install --lib random
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
--
Jeff Brown | Jeffrey Benjamin Brown
LinkedIn <https://www.linkedin.com/in/jeffreybenjaminbrown> | Github
<https://github.com/jeffreybenjaminbrown> | Twitter
<https://twitter.com/carelogic> | Facebook
<https://www.facebook.com/mejeff.younotjeff> | very old Website
<https://msu.edu/~brown202/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20210217/1d4fe747/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 17 Feb 2021 11:13:19 -0600
From: Galaxy Being <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] import question
Message-ID:
<cafahfsv4w-z3eop2qrj5egmu2dnybvtwjfzk9bwh5ye2mvn...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I'm trying to use Decimal but (I'm guessing) I don't know how to import it.
import Data.Decimal
dList :: [Decimal]
dList = [1.1,1.2..2.0]
: <interactive>:70:11-17: error:
: Not in scope: type constructor or class `Decimal'
Obviously I was asleep the day the teacher told us how to do this. . . .
LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20210217/23f1a589/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 17 Feb 2021 19:57:00 +0100
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] import question
Message-ID: <20210217185700.GA30720@extensa>
Content-Type: text/plain; charset=utf-8
Il 17 febbraio 2021 alle 11:13 Galaxy Being ha scritto:
> I'm trying to use Decimal but (I'm guessing) I don't know how to import it.
>
> import Data.Decimal
>
> dList :: [Decimal]
> dList = [1.1,1.2..2.0]
>
> : <interactive>:70:11-17: error:
> : Not in scope: type constructor or class `Decimal'
Works here. You need to add `Decimal` the dependencies of your project
or install it globally first
—F
------------------------------
Message: 4
Date: Wed, 17 Feb 2021 12:58:35 -0700
From: "[email protected]" <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] import question
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Is it possible you mean to use Double or Float instead of Decimal?
Tom
On Wed, Feb 17, 2021 at 11:13:19AM -0600, Galaxy Being wrote:
> I'm trying to use Decimal but (I'm guessing) I don't know how to import it.
>
> import Data.Decimal
>
> dList :: [Decimal]
> dList = [1.1,1.2..2.0]
>
> : <interactive>:70:11-17: error:
> : Not in scope: type constructor or class `Decimal'
>
> Obviously I was asleep the day the teacher told us how to do this. . . .
>
> LB
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
Message: 5
Date: Wed, 17 Feb 2021 14:17:32 -0600
From: Galaxy Being <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] import question
Message-ID:
<CAFAhFSXv+LHYCCcW4ds+eooZsyfGvtyNgsxCLc9pK89Sc=k...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
How would I install it globally? I'm not using projects, I'm just at the
ghci REPL.
On Wed, Feb 17, 2021 at 12:57 PM Francesco Ariis <[email protected]> wrote:
> Il 17 febbraio 2021 alle 11:13 Galaxy Being ha scritto:
> > I'm trying to use Decimal but (I'm guessing) I don't know how to import
> it.
> >
> > import Data.Decimal
> >
> > dList :: [Decimal]
> > dList = [1.1,1.2..2.0]
> >
> > : <interactive>:70:11-17: error:
> > : Not in scope: type constructor or class `Decimal'
>
> Works here. You need to add `Decimal` the dependencies of your project
> or install it globally first
> —F
> _______________________________________________
> 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/20210217/3cb133d8/attachment-0001.html>
------------------------------
Message: 6
Date: Wed, 17 Feb 2021 21:42:31 +0100
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] import question
Message-ID: <20210217204230.GA19781@extensa>
Content-Type: text/plain; charset=utf-8
Il 17 febbraio 2021 alle 14:17 Galaxy Being ha scritto:
> How would I install it globally? I'm not using projects, I'm just at the
> ghci REPL.
Most likely
cabal install --lib Decimal
Check what Tom has said too —F
------------------------------
Message: 7
Date: Wed, 17 Feb 2021 19:26:37 -0600
From: Galaxy Being <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] import question
Message-ID:
<CAFAhFSUV_wUE=pme1jzwopkcuedkkf6o6owtdtorp2ivazk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I'm trying to create a list of real numbers with a two-decimal interval, a
la
> [1.0,1.01,1.02,...1.99,2.00]
however, I get the float approximation problem
[1.0,1.01,1.02,1.03,1.04,1.05,1.06,1.07,1.08,1.09,1.1,1.11,1.12,1.1300000000000001,1.1400000000000001,...
So I attempted to compensate with
import Data.Decimal
map (roundTo 2) [1.00,1.01..2.0]
I don't have to do it this way if there is another rounding function to
correct the float overrun issue.
On Wed, Feb 17, 2021 at 2:43 PM Francesco Ariis <[email protected]> wrote:
> Il 17 febbraio 2021 alle 14:17 Galaxy Being ha scritto:
> > How would I install it globally? I'm not using projects, I'm just at the
> > ghci REPL.
>
> Most likely
>
> cabal install --lib Decimal
>
> Check what Tom has said too —F
> _______________________________________________
> 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/20210217/812c7cca/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 151, Issue 8
*****************************************