[Haskell-cafe] Using Data.String.Conversions
borgauf at gmail.com
Wed Jun 30 03:18:47 UTC 2021
Sorry, but this didn't work for me. First,
$ cabal -z install --lib string-conversions
cabal: unrecognized 'install' option `-z'
however, without -z it does run and performs an install as you indicate . .
. but then the rest doesn't work, i.e.,
$ cabal repl -z
> :set -package string-conversions
<no location info>: error:
Could not load module ‘Data.String.Conversions’
It is a member of the hidden package ‘string-conversions-0.4.0.1’.
Perhaps you need to add ‘string-conversions’ to the build-depends in
your .cabal file.
However, this did work
$ stack install string-conversions
tf8-string > using precompiled package
string-conversions> Configuring string-conversions-0.4.0.1...
string-conversions> Preprocessing library for string-conversions-0.4.0.1..
string-conversions> Building library for string-conversions-0.4.0.1..
string-conversions> [1 of 2] Compiling Data.String.Conversions
$ stack ghci --package string-conversions
Prelude> import Data.String.Conversions as CS
Prelude CS> :t cs
cs :: ConvertibleStrings a b => a -> b
*But*, now I am able to follow your cabal way and it does work.
So this is very confusing for a beginner. But happy ending this time. Any
lessons I can learn from this? For example, why was this so difficult?
On Tue, Jun 29, 2021 at 6:44 PM Viktor Dukhovni <ietf-dane at dukhovni.org>
> On Tue, Jun 29, 2021 at 05:39:42PM -0500, Galaxy Being wrote:
> > My problem is I can import and expose Data.Time, but
> > Data.String.Conversions will not import to my global REPL. Any tips on
> > doing this project-based would be enlightening too.
> One thing that works is:
> $ cabal -z install --lib string-conversions
> Resolving dependencies...
> In order, the following will be built (use -v for more details):
> - utf8-string-1.0.2 (lib) (requires build)
> - string-conversions-0.4.0.1 (lib) (requires download & build)
> Completed utf8-string-1.0.2 (lib)
> Completed string-conversions-0.4.0.1 (lib)
> $ cabal repl -z
> λ> :set -package string-conversions
> package flags have changed, resetting and loading new packages...
> λ> import Data.String.Conversions as CS
> λ> :t cs
> cs :: ConvertibleStrings a b => a -> b
> There are surely other ways, that you might prefer, but this should get
> you started.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
Grand Marais, MN, USA
borgauf at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe