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.  Getting Crypto package imported (Dustin Lee)
   2. Re:  Getting Crypto package imported (Kim-Ee Yeoh)
   3. Re:  Getting Crypto package imported (Dustin Lee)
   4. Re:  Getting Crypto package imported (Kim-Ee Yeoh)
   5.  problem with SDL-gfx (Mart?n Villagra)
   6. Re:  problem with SDL-gfx (Francesco Ariis)
   7.  how to write this function (Dennis Raddle)


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

Message: 1
Date: Tue, 8 Dec 2015 07:55:51 -0700
From: Dustin Lee <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Getting Crypto package imported
Message-ID:
        <CAN3sYc0=kzjhrdoicpavusupk9q9b2uwu3uuim-jvo+wclr...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I used cabal to install Crypto and it seemed to work fine

Here is what I see at the prompt when I try to import the module

$ ghci
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :m +Crypto

<no location info>:
    Could not find module `Crypto'
    It is not a module in the current program, or in any known package.
Prelude> :m +Crypto.Hash

<no location info>:
    Could not find module `Crypto.Hash'
    It is not a module in the current program, or in any known package.
Prelude> :m +Crypto.Hash.Data

<no location info>:
    Could not find module `Crypto.Data'
    It is not a module in the current program, or in any known package.


Here is my package list.

$ ghc-pkg list
/var/lib/ghc/package.conf.d
   Cabal-1.14.0
   array-0.4.0.0
   base-4.5.0.0
   bin-package-db-0.0.0.0
   binary-0.5.1.0
   bytestring-0.9.2.1
   containers-0.4.2.1
   deepseq-1.3.0.0
   directory-1.1.0.2
   extensible-exceptions-0.1.1.4
   filepath-1.3.0.0
   ghc-7.4.1
   ghc-prim-0.2.0.0
   haskell2010-1.1.0.1
   haskell98-2.0.0.1
   hoopl-3.8.7.3
   hpc-0.5.1.1
   integer-gmp-0.4.0.0
   old-locale-1.0.0.4
   old-time-1.1.0.0
   pretty-1.1.1.0
   process-1.1.0.1
   rts-1.0
   template-haskell-2.7.0.0
   time-1.4
   unix-2.5.1.0
/home/dlee/.ghc/i386-linux-7.4.1/package.conf.d
   Crypto-4.2.5.1
   HUnit-1.3.0.0
   QuickCheck-2.8.1
   primitive-0.6.1.0
   random-1.1
   tf-random-0.5
   transformers-0.4.3.0


I'd appreciate tips on how to troubleshoot what's going on.



-- 
Dustin Lee
qhfgva=rot13(dustin)
?( ? )?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/85afae18/attachment-0001.html>

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

Message: 2
Date: Tue, 8 Dec 2015 22:10:30 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Getting Crypto package imported
Message-ID:
        <capy+zdrhmxy_cxtdwfkmkjkoj6p5axuwjqh5qw--thaz9zt...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Dec 8, 2015 at 9:55 PM, Dustin Lee <[email protected]> wrote:

> Prelude> :m +Crypto


A glance at the main listing here:

https://hackage.haskell.org/package/Crypto

reveals that the module names are like

Data.Digest.MD5
Codec.Encryption.AES

So ":m +Data.Digest.MD5" should work.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/41577122/attachment-0001.html>

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

Message: 3
Date: Tue, 8 Dec 2015 08:33:58 -0700
From: Dustin Lee <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Getting Crypto package imported
Message-ID:
        <CAN3sYc1jkvHwH0sT0bX4Mv4vh6X4VbByWui5=ggziwr81d3...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Ugg...  Thanks.   I was following a tutorial that used different import
names.   I guess either the names changed since then or I grabbed a
different package.

In any case, thanks!


On Tue, Dec 8, 2015 at 8:10 AM, Kim-Ee Yeoh <[email protected]> wrote:

>
> On Tue, Dec 8, 2015 at 9:55 PM, Dustin Lee <[email protected]> wrote:
>
>> Prelude> :m +Crypto
>
>
> A glance at the main listing here:
>
> https://hackage.haskell.org/package/Crypto
>
> reveals that the module names are like
>
> Data.Digest.MD5
> Codec.Encryption.AES
>
> So ":m +Data.Digest.MD5" should work.
>
> -- Kim-Ee
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>


-- 
Dustin Lee
qhfgva=rot13(dustin)
?( ? )?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/316ebb44/attachment-0001.html>

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

Message: 4
Date: Tue, 8 Dec 2015 22:42:46 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Getting Crypto package imported
Message-ID:
        <capy+zdsydctz5jghn0+wa7gm7v2ybl960vzn9fs5na24_vo...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Dec 8, 2015 at 10:33 PM, Dustin Lee <[email protected]> wrote:

> I was following a tutorial that used different import names.   I guess
> either the names changed since then or I grabbed a different package.


Is the tutorial on the web? Perhaps you could contact the author to update
it or add clarifying information?

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/09f69cdf/attachment-0001.html>

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

Message: 5
Date: Tue, 8 Dec 2015 12:44:18 -0300
From: Mart?n Villagra <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] problem with SDL-gfx
Message-ID:
        <cae7wea+iw27f8frs2ddrq4e7m5oxgmgn8ce8kgn1rvy7kc+...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello!
I hope you can help me. I'm trying to use SDL-gfx but it seems it isn't
linking it correctly. When I try to run this simple file with runhaskell:
import Graphics.UI.SDL.Primitives
main = putStrLn "Hello"

It gives:
sdl.test.hs: <command line>: can't load .so/.DLL for:
/home/username/.cabal/lib/i386-linux-ghc-7.10.2/SDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF/
libHSSDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF-ghc7.10.2.so
 
(/home/username/.cabal/lib/i386-linux-ghc-7.10.2/SDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF/
libHSSDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF-ghc7.10.2.so: undefined symbol:
SDL_initFramerate)

Notes:
* SDL works fine in all cases.
* My system is i386, using Arch Linux. I tried with another computer with
x86_64 with Arch Linux and it worked.
* It works if I compile it with ghc and run the executable.
* I installed the package using cabal install SDL-gfx with no errors.
* I installed the library in the OS just in case, and double checked that
it exist in /usr/lib/libSDL_gfx.so and that it contains the symbol
SDL_initFramerate.
* The long *.so library reported by runhaskell also constains
SDL_initFramerate.
* GHCi gives the same error (when executing main).
* I'm trying to make a cabal package that uses this library, and cabal gave
the same error within the sandbox.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/ca536e3a/attachment-0001.html>

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

Message: 6
Date: Tue, 8 Dec 2015 19:58:46 +0100
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] problem with SDL-gfx
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1

On Tue, Dec 08, 2015 at 12:44:18PM -0300, Mart?n Villagra wrote:
> Hello!
> I hope you can help me. I'm trying to use SDL-gfx but it seems it isn't
> linking it correctly. When I try to run this simple file with runhaskell:
> import Graphics.UI.SDL.Primitives
> main = putStrLn "Hello"
> 
> It gives:
> sdl.test.hs: <command line>: can't load .so/.DLL for:
> [..]

Hello Mart?n, SDL-gfx maintainer here. Could you try:

    runhaskell -L/usr/include/SDL/ -lSDL_gfx prova.hs

(this works in Debian, modify the -L dir appropriately if you are using
Arch).


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

Message: 7
Date: Tue, 8 Dec 2015 13:19:27 -0800
From: Dennis Raddle <[email protected]>
To: Haskell Beginners <[email protected]>
Subject: [Haskell-beginners] how to write this function
Message-ID:
        <CAKxLvoo9yRvB-KeM84=wyjfhoybecjfdvqcibtukrnqzvcx...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

In my music translation program, I have a ton of data and configuration
that goes into every note computation, so I've decided to use the State
monad to pass it around. Also, the generated output is just a list of MIDI
events, so I think I'll use Writer to gather the output.

I will be dealing with several different MIDI synthesizers, which have
different specifications and manner of control. But there is enough in
common that I can write a single function to do the translation, provided
that I provide that function with some data that is specific to the synth,
and also I need to configure it with some functions specific to the synth.

Let's say my State/Writer type is called Tr.

type Tr a = StateT Configuration (Writer [MidiEvent]) a

This is the data I provide to StateT:

data Configuration = Configuration
  { t1 :: SynthSpecificData
  , f1 :: Tr SynthSpecificComputationResult
  , score :: WholeMusicalScore
  }

So I need to write

translate :: Tr ()

computeMidiEvents = runWriter (runStateT translate theConfig)

So inside 'translate' I want to call 'f1' among many other things. Let's
just consider the f1 call first. I wrote this first:

translate = do
  f <- gets f1
  f

That works but looks a little weird. I think this works also:

translate = join (gets f1)

Is that better?

D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151208/6b360777/attachment.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 13
*****************************************

Reply via email to