Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/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.  "Cyclic" instance of Enum (Patrick LeBoutillier)
   2. Re:  Installing HDBC (Kathleen Lynch)
   3. Re:  Installing HDBC (Kathleen Lynch)
   4. Re:  "Cyclic" instance of Enum (Daniel Fischer)
   5. Re:  Installing HDBC (Daniel Fischer)
   6. Re:  Installing HDBC (Kathleen Lynch)
   7. Re:  Installing HDBC (Daniel Fischer)
   8. Re:  Installing HDBC (Kathleen Lynch)
   9. Re:  Installing HDBC (JETkoten)


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

Message: 1
Date: Tue, 1 Feb 2011 14:14:05 -0500
From: Patrick LeBoutillier <patrick.leboutill...@gmail.com>
Subject: [Haskell-beginners] "Cyclic" instance of Enum
To: beginners <beginners@haskell.org>
Message-ID:
        <AANLkTi=b15d6dfv5uj+dmquwxxfvgbqkdygk5l3l-...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I've created an instance of Enum that repeats the same elements when
it gets to the end:


module Music.Note.Name where


data Name = C | D | E | F | G | A | B
            deriving (Show, Eq)

instance Enum Name where
  toEnum 0 = C
  toEnum 1 = D
  toEnum 2 = E
  toEnum 3 = F
  toEnum 4 = G
  toEnum 5 = A
  toEnum 6 = B
  toEnum i = toEnum $ i `mod` 7

  fromEnum C = 0
  fromEnum D = 1
  fromEnum E = 2
  fromEnum F = 3
  fromEnum G = 4
  fromEnum A = 5
  fromEnum B = 6

  enumFromTo x y = map toEnum [a .. b']
    where a = fromEnum x
          b = fromEnum y
          b' = if a <= b then b else b + 7

  enumFromThen x1 x2 = error "enumFromThen not supported for Music.Note.Name"
  enumFromThenTo x1 x2 y = error "enumFromThenTo not supported for
Music.Note.Name"


Does this violate any implicit rules that an Enum instance should
follow? Is there a better way to do this?


Thanks,

Patrick

-- 
=====================
Patrick LeBoutillier
Rosem?re, Qu?bec, Canada



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

Message: 2
Date: Tue, 01 Feb 2011 14:20:22 -0500
From: "Kathleen Lynch" <kmandpjly...@verizon.net>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID: <3319FC2BB8D24CCB843A23840D5FEDF2@UserPC>
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
        reply-type=original

I entered the command you gave me: cabal install HDBC-sqlite3
It returned the following error:
    Resolving dependencies...
    Configuring HDBC-sqlite3-2.3.1.0...
    cabal: Missing dependency on a foreign library:
    * Missing C library: sqlite3

I then went to the link you provided: 
http://hackage.haskell.org/package/HDBC-sqlite3
I extracted the tar file, HDBC-sqlite3-2.3.1.0.tar, and tried to un-tar it 
but get the following message:
    "Error reading header after processing 0 entries"

I'd appreciate any help...


----- Original Message ----- 
From: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
To: "Kathleen Lynch" <kmandpjly...@verizon.net>
Cc: <beginners@haskell.org>
Sent: Tuesday, February 01, 2011 1:33 PM
Subject: Re: [Haskell-beginners] Installing HDBC


> On Tuesday 01 February 2011 19:03:32, Kathleen Lynch wrote:
>> ...I got everything installed but am getting the following message:
>>
>> Prelude> :module Database.HDBC.Sqlite3
>> <no location info>:
>>     Could not find module `Database.HDBC.Sqlite3':
>>       it is not a module in the current program, or in any known
>> package.
>
> It's in http://hackage.haskell.org/package/HDBC-sqlite3
>
> $ cabal install HDBC-sqlite3
>
> (similarly for mysql, postgresql, odbc). I suppose those packages depend 
> on
> having the foreign library installed, so they come alone. It's a bit
> annoying (especially if one is not told which packages one needs), but
> having to install multiple databases when one wants to use only one would
> be at least as bad.
>
> Cheers,
> Daniel 




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

Message: 3
Date: Tue, 01 Feb 2011 14:23:45 -0500
From: "Kathleen Lynch" <kmandpjly...@verizon.net>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Kathleen Lynch" <kmandpjly...@verizon.net>,        "Daniel Fischer"
        <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID: <BD6FD5714F334B269210AD6AF2CFCC2B@UserPC>
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
        reply-type=response

BTW, I'm doing this on a Windows Vista PC...

----- Original Message ----- 
From: "Kathleen Lynch" <kmandpjly...@verizon.net>
To: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
Cc: <beginners@haskell.org>
Sent: Tuesday, February 01, 2011 2:20 PM
Subject: Re: [Haskell-beginners] Installing HDBC


>I entered the command you gave me: cabal install HDBC-sqlite3
> It returned the following error:
>    Resolving dependencies...
>    Configuring HDBC-sqlite3-2.3.1.0...
>    cabal: Missing dependency on a foreign library:
>    * Missing C library: sqlite3
>
> I then went to the link you provided: 
> http://hackage.haskell.org/package/HDBC-sqlite3
> I extracted the tar file, HDBC-sqlite3-2.3.1.0.tar, and tried to un-tar it 
> but get the following message:
>    "Error reading header after processing 0 entries"
>
> I'd appreciate any help...
>
>
> ----- Original Message ----- 
> From: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
> To: "Kathleen Lynch" <kmandpjly...@verizon.net>
> Cc: <beginners@haskell.org>
> Sent: Tuesday, February 01, 2011 1:33 PM
> Subject: Re: [Haskell-beginners] Installing HDBC
>
>
>> On Tuesday 01 February 2011 19:03:32, Kathleen Lynch wrote:
>>> ...I got everything installed but am getting the following message:
>>>
>>> Prelude> :module Database.HDBC.Sqlite3
>>> <no location info>:
>>>     Could not find module `Database.HDBC.Sqlite3':
>>>       it is not a module in the current program, or in any known
>>> package.
>>
>> It's in http://hackage.haskell.org/package/HDBC-sqlite3
>>
>> $ cabal install HDBC-sqlite3
>>
>> (similarly for mysql, postgresql, odbc). I suppose those packages depend 
>> on
>> having the foreign library installed, so they come alone. It's a bit
>> annoying (especially if one is not told which packages one needs), but
>> having to install multiple databases when one wants to use only one would
>> be at least as bad.
>>
>> Cheers,
>> Daniel
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners 




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

Message: 4
Date: Tue, 1 Feb 2011 20:43:01 +0100
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] "Cyclic" instance of Enum
To: beginners@haskell.org
Message-ID: <201102012043.01349.daniel.is.fisc...@googlemail.com>
Content-Type: text/plain;  charset="iso-8859-1"

On Tuesday 01 February 2011 20:14:05, Patrick LeBoutillier wrote:
> Hi,
>
> I've created an instance of Enum that repeats the same elements when
> it gets to the end:
>


>
> Does this violate any implicit rules that an Enum instance should
> follow?

If you make that type also an instance of Bounded. Says the report:

>  For any type that is an instance of class Bounded as well as Enum, the
> following should hold:
>
>     * The calls succ maxBound and pred minBound should result in a
> runtime error. * fromEnum and toEnum should give a runtime error if the
> result value is not representable in the result type. For example,
> toEnum 7 :: Bool is an error. * enumFrom and enumFromThen should be
> defined with an implicit bound, thus: enumFrom     x   = enumFromTo    
> x maxBound
>         enumFromThen x y = enumFromThenTo x y bound
>           where
>             bound | fromEnum y >= fromEnum x = maxBound
>
>                   | otherwise                = minBound

but otherwise, it's okay.

> Is there a better way to do this?

None obvious.

Cheers,
Daniel




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

Message: 5
Date: Tue, 1 Feb 2011 21:07:01 +0100
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Kathleen Lynch" <kmandpjly...@verizon.net>
Cc: beginners@haskell.org
Message-ID: <201102012107.01302.daniel.is.fisc...@googlemail.com>
Content-Type: text/plain;  charset="iso-8859-1"

On Tuesday 01 February 2011 20:20:22, Kathleen Lynch wrote:
> I entered the command you gave me: cabal install HDBC-sqlite3
> It returned the following error:
> ? ? Resolving dependencies...
> ? ? Configuring HDBC-sqlite3-2.3.1.0...
> ? ? cabal: Missing dependency on a foreign library:
> ? ? * Missing C library: sqlite3

That means you don't have the C library installed, or at least that cabal 
can't find it. You have to install it otherwise or put it in a directory in 
your %PATH%. I'm not familiar with Windows, so I can't tell you how to do 
that. You could search on the haskellwiki, perhaps there are instructions 
there.

>
> I then went to the link you provided:
> http://hackage.haskell.org/package/HDBC-sqlite3
> I extracted the tar file, HDBC-sqlite3-2.3.1.0.tar, and tried to un-tar
> it but get the following message:
> ? ? "Error reading header after processing 0 entries"

If cabal complains about a missing foreign dependency, trying a manual 
install won't help, runhaskell ./Setup configure won't look anywhere cabal 
doesn't.





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

Message: 6
Date: Tue, 01 Feb 2011 16:39:02 -0500
From: "Kathleen Lynch" <kmandpjly...@verizon.net>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID: <05C0348F9D5E41B299D08921839AD1D7@UserPC>
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
        reply-type=original

...almost a rhetorical question - but does Haskell support "Microsoft SQL 
Server 2005 Compact Edition"?

----- Original Message ----- 
From: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
To: "Kathleen Lynch" <kmandpjly...@verizon.net>
Cc: <beginners@haskell.org>
Sent: Tuesday, February 01, 2011 3:07 PM
Subject: Re: [Haskell-beginners] Installing HDBC


On Tuesday 01 February 2011 20:20:22, Kathleen Lynch wrote:
> I entered the command you gave me: cabal install HDBC-sqlite3
> It returned the following error:
> Resolving dependencies...
> Configuring HDBC-sqlite3-2.3.1.0...
> cabal: Missing dependency on a foreign library:
> * Missing C library: sqlite3

That means you don't have the C library installed, or at least that cabal
can't find it. You have to install it otherwise or put it in a directory in
your %PATH%. I'm not familiar with Windows, so I can't tell you how to do
that. You could search on the haskellwiki, perhaps there are instructions
there.

>
> I then went to the link you provided:
> http://hackage.haskell.org/package/HDBC-sqlite3
> I extracted the tar file, HDBC-sqlite3-2.3.1.0.tar, and tried to un-tar
> it but get the following message:
> "Error reading header after processing 0 entries"

If cabal complains about a missing foreign dependency, trying a manual
install won't help, runhaskell ./Setup configure won't look anywhere cabal
doesn't.





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

Message: 7
Date: Tue, 1 Feb 2011 22:59:27 +0100
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Kathleen Lynch" <kmandpjly...@verizon.net>
Cc: beginners@haskell.org
Message-ID: <201102012259.27388.daniel.is.fisc...@googlemail.com>
Content-Type: text/plain;  charset="iso-8859-1"

On Tuesday 01 February 2011 22:39:02, Kathleen Lynch wrote:
> ...almost a rhetorical question - but does Haskell support "Microsoft
> SQL Server 2005 Compact Edition"?

I doubt anybody wrote a binding yet. I didn't find anything on hackage and 
most library writers work on *nixen, so the likelihood isn't large. In 
principle, however, I see no reason why it shouldn't be possible to write a 
binding.



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

Message: 8
Date: Tue, 01 Feb 2011 17:00:31 -0500
From: "Kathleen Lynch" <kmandpjly...@verizon.net>
Subject: Re: [Haskell-beginners] Installing HDBC
To: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID: <507B51783C7D429F92954AACCD0C4F13@UserPC>
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
        reply-type=original

...I put it in my PATH [C:\users\user] and put the file Sqlite3 in that 
folder [C:\users\user] where I'm running Cabal and extended the Cabal 
command as follows - nothing helps...
    cabal install 
HDBC-sqlite3 --extra-include-dirs=C:\Users\User --extra-lib-dirs=C:\Users\User

...At this point, I'm unable to install Sqlite3 and GTK...

...I know this is 'open source' but it really shouldn't be this hard to do 
these installations...

...I'll go back to my Monads and see if I can figure them out and then take 
a look at F# - I might have better luck there...

Bye

----- Original Message ----- 
From: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>
To: "Kathleen Lynch" <kmandpjly...@verizon.net>
Cc: <beginners@haskell.org>
Sent: Tuesday, February 01, 2011 3:07 PM
Subject: Re: [Haskell-beginners] Installing HDBC


On Tuesday 01 February 2011 20:20:22, Kathleen Lynch wrote:
> I entered the command you gave me: cabal install HDBC-sqlite3
> It returned the following error:
> Resolving dependencies...
> Configuring HDBC-sqlite3-2.3.1.0...
> cabal: Missing dependency on a foreign library:
> * Missing C library: sqlite3

That means you don't have the C library installed, or at least that cabal
can't find it. You have to install it otherwise or put it in a directory in
your %PATH%. I'm not familiar with Windows, so I can't tell you how to do
that. You could search on the haskellwiki, perhaps there are instructions
there.

>
> I then went to the link you provided:
> http://hackage.haskell.org/package/HDBC-sqlite3
> I extracted the tar file, HDBC-sqlite3-2.3.1.0.tar, and tried to un-tar
> it but get the following message:
> "Error reading header after processing 0 entries"

If cabal complains about a missing foreign dependency, trying a manual
install won't help, runhaskell ./Setup configure won't look anywhere cabal
doesn't.





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

Message: 9
Date: Tue, 01 Feb 2011 18:09:54 -0500
From: JETkoten <jetko...@gmail.com>
Subject: Re: [Haskell-beginners] Installing HDBC
To: beginners@haskell.org
Message-ID: <4d4892c2.9050...@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed



On 2/1/11 5:00 PM, Kathleen Lynch wrote:
> ...I put it in my PATH [C:\users\user] and put the file Sqlite3 in 
> that folder [C:\users\user] where I'm running Cabal and extended the 
> Cabal command as follows - nothing helps...
>    cabal install HDBC-sqlite3 --extra-include-dirs=C:\Users\User 
> --extra-lib-dirs=C:\Users\User
>
> ...At this point, I'm unable to install Sqlite3 and GTK...
>
> ...I know this is 'open source' but it really shouldn't be this hard 
> to do these installations...
>
> ...I'll go back to my Monads and see if I can figure them out and then 
> take a look at F# - I might have better luck there...
>
> Bye
Any progress on your Mac efforts? In OS X, once you've installed Xcode 
and the (*very important*) Unix Development Support part of it, it's as 
easy as:

sudo port install sqlite

...if you've also installed Macports, or "port", which is the 
cabal-install of the Mac world.

You just run that command in the Terminal command line app (found in 
Applications/Utilities) and it automatically puts the app or lib that 
you've requested in your path, because macports adds itself and its /opt 
directory to your path when you install it.

You'll probably find it a lot easier to add things and have cabal be 
able to find them, and it'll be a bit easier for others to help too, 
because OS X is *nix-y.



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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 32, Issue 3
****************************************

Reply via email to