Send Beginners mailing list submissions to
        [email protected]

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
        [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.  appropriateness of haskell for GUIs (Michael P Mossey)
   2. Re:  Fractional Int (Brandon S. Allbery KF8NH)
   3. Re:  Fractional Int (Zachary Turner)
   4. Re:  Fractional Int (Brandon S. Allbery KF8NH)
   5. Re:  Fractional Int (Brandon S. Allbery KF8NH)
   6. Re:  appropriateness of haskell for GUIs (Andy Elvey)


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

Message: 1
Date: Fri, 20 Mar 2009 16:16:38 -0700
From: Michael P Mossey <[email protected]>
Subject: [Haskell-beginners] appropriateness of haskell for GUIs
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello, I'm totally new to Haskell. I'm thinking of using it for a 
personal project, which is a gui-based musical score editor. (*) Why 
Haskell? I've always been interested in proving my software's 
correctness, usually in practical and informal sense. In other words, I 
would like to reduce bugs by having a really good understanding of what 
my software does. I also just want to learn Haskell.

Before I invest a lot of time in learning Haskell, however, I want to 
understand if it's the right language for doing a gui-based musical 
score editor. First of all, I need a gui toolkit of some sort, and I 
notice that bindings to Qt exist. I'm already very familiar with Qt, so 
that's good. I also need to access the Windows midi api, and I see there 
is a module called hmidi.

However, a gui program is essentially event driven and heavily interacts 
with the outside world. I don't know how compatible these ideas are with 
Haskell.

If I don't use Haskell, I will probably use Python, which I already know 
well. So basically the question is: Haskell or Python? Note: I would 
enjoy learning Haskell, so this is not a question of which language is 
better in an absolute sense... if Haskell is suitable, but not the best 
choice, I will still probably use it.

Thanks,
Mike

(*) For those who ask why I'm doing my own music score editor when many 
already exist, it's because it needs to be integrated with my own 
computer-assisted composition system. As an editor, it will be 
primitive: that's not its main purpose.


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

Message: 2
Date: Fri, 20 Mar 2009 19:37:32 -0400
From: "Brandon S. Allbery KF8NH" <[email protected]>
Subject: Re: [Haskell-beginners] Fractional Int
To: Sean Bartell <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

On 2009 Mar 20, at 18:01, Sean Bartell wrote:
> For a type "a" to be Fractional requires there to be:
> (/) :: a -> a -> a
> You can't divide an Int by another Int and (in general) get a third
> Int. You would probably want something like a "Fractionable"
> typeclass, with
> (/) :: a -> a -> b
> which would result in a Rational, but Haskell doesn't have this.


...but there is (%) :: (Integral a) => a -> a -> Ratio a

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : 
http://www.haskell.org/pipermail/beginners/attachments/20090320/82dd6ffd/PGP-0001.bin

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

Message: 3
Date: Fri, 20 Mar 2009 19:07:45 -0500
From: Zachary Turner <[email protected]>
Subject: Re: [Haskell-beginners] Fractional Int
To: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

2009/3/20 Brandon S. Allbery KF8NH <[email protected]>

> On 2009 Mar 20, at 18:01, Sean Bartell wrote:
>
>> For a type "a" to be Fractional requires there to be:
>> (/) :: a -> a -> a
>> You can't divide an Int by another Int and (in general) get a third
>> Int. You would probably want something like a "Fractionable"
>> typeclass, with
>> (/) :: a -> a -> b
>> which would result in a Rational, but Haskell doesn't have this.
>>
>
>
> ...but there is (%) :: (Integral a) => a -> a -> Ratio a
>

Thanks, I knew about % but didn't remember about it when I was working on
this sample :)  So that being said, consider the following:

Prelude Data.Ratio> let x = 5::Int
Prelude Data.Ratio> :t x
x :: Int
Prelude Data.Ratio> :t (x%3)
(x%3) :: Ratio Int
Prelude Data.Ratio> let y = truncate (x%3)
Prelude Data.Ratio> :t y
y :: Integer

Why does y now have the type Integer instead of Int?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20090320/20c3543b/attachment-0001.htm

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

Message: 4
Date: Fri, 20 Mar 2009 20:14:38 -0400
From: "Brandon S. Allbery KF8NH" <[email protected]>
Subject: Re: [Haskell-beginners] Fractional Int
To: Zachary Turner <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Skipped content of type multipart/alternative-------------- next part 
--------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : 
http://www.haskell.org/pipermail/beginners/attachments/20090320/57e56837/PGP-0001.bin

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

Message: 5
Date: Fri, 20 Mar 2009 20:18:41 -0400
From: "Brandon S. Allbery KF8NH" <[email protected]>
Subject: Re: [Haskell-beginners] Fractional Int
To: Zachary Turner <[email protected]>
Cc: beginners beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Skipped content of type multipart/alternative-------------- next part 
--------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : 
http://www.haskell.org/pipermail/beginners/attachments/20090320/68f8ced4/PGP-0001.bin

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

Message: 6
Date: Sat, 21 Mar 2009 19:58:03 +1300
From: Andy Elvey <[email protected]>
Subject: Re: [Haskell-beginners] appropriateness of haskell for GUIs
To: Michael P Mossey <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Michael P Mossey wrote:
> Hello, I'm totally new to Haskell. I'm thinking of using it for a 
> personal project, which is a gui-based musical score editor. (*) Why 
> Haskell? I've always been interested in proving my software's 
> correctness, usually in practical and informal sense. In other words, 
> I would like to reduce bugs by having a really good understanding of 
> what my software does. I also just want to learn Haskell.
>
> Before I invest a lot of time in learning Haskell, however, I want to 
> understand if it's the right language for doing a gui-based musical 
> score editor. First of all, I need a gui toolkit of some sort, and I 
> notice that bindings to Qt exist. I'm already very familiar with Qt, 
> so that's good. I also need to access the Windows midi api, and I see 
> there is a module called hmidi.
>
> However, a gui program is essentially event driven and heavily 
> interacts with the outside world. I don't know how compatible these 
> ideas are with Haskell.
>
> If I don't use Haskell, I will probably use Python, which I already 
> know well. So basically the question is: Haskell or Python? Note: I 
> would enjoy learning Haskell, so this is not a question of which 
> language is better in an absolute sense... if Haskell is suitable, but 
> not the best choice, I will still probably use it.
>
> Thanks,
> Mike
>
> (*) For those who ask why I'm doing my own music score editor when 
> many already exist, it's because it needs to be integrated with my own 
> computer-assisted composition system. As an editor, it will be 
> primitive: that's not its main purpose.
> _______________________________________________
Hi Michael - 
I'm also new to Haskell.  Although I can't really give a definitive 
answer as to whether Haskell is appropriate for GUIs, I can mention 
several GUI libraries that exist for Haskell.  They are wxHaskell, 
Gtk2Hs and qtHaskell. 
The following page mentions those and a number of others -
http://www.haskell.org/haskellwiki/Applications_and_libraries/GUI_libraries

Note - that page says that "there is no standard (GUI lib) and all are 
more or less incomplete."  Don't be too put off by that - from what I've 
seen, although I haven't used them myself, both wxHaskell and Gtk2HS now 
seem to be quite complete.  I can't really comment on qtHaskell as I 
haven't seen that in action. 

- Hope this helps....
- Andy



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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 9, Issue 25
****************************************

Reply via email to