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.  solutions (Andy Larocque)
   2.  Accounting Engine in Haskell (Amiruddin Nagri)
   3. Re:  Accounting Engine in Haskell (Lyndon Maydwell)
   4. Re:  Accounting Engine in Haskell (Amiruddin Nagri)
   5. Re:  Accounting Engine in Haskell (Yitzchak Gale)
   6.  type ambiguity confusion (Thomas)
   7. Re:  type ambiguity confusion (Stephen Tetley)


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

Message: 1
Date: Mon, 14 Jun 2010 22:06:34 -0400
From: Andy Larocque <abla...@gmail.com>
Subject: [Haskell-beginners] solutions
To: beginners@haskell.org
Message-ID:
        <aanlktimuffd9urqu4xcbvt1ihmkdkkydz-grr4g3u...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I'm working my way thru Simon Thompson's book "The Craft of Functional
Programming" and would really like to find solutions to the exercises in
chapters 14,15,16 . I have no idea if any of my own solutions are even
close. Does anyone have them?
AL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100614/128a1f97/attachment-0001.html

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

Message: 2
Date: Tue, 15 Jun 2010 13:38:27 +0530
From: Amiruddin Nagri <amir.na...@gmail.com>
Subject: [Haskell-beginners] Accounting Engine in Haskell
To: haskell-c...@haskell.org, beginners@haskell.org
Message-ID:
        <aanlktimqtcdelcadwdt7pzbmoroc5n_peff9-ua-x...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

My current project is about making an accounting engine that handles all
the journal entries, transactions, portfolios etc. The communication
with the engine is based on simple protocol, the things to be taken
care of in the order are consistency, handling large data(performance) and
availability.

I came across a video lecture by Simon Peyton Jones where he gives an
example from Financial domain (derivatives etc) to explain how haskell is
being used and the advantages provided.

I am interested in knowing if Haskell will be the right fit for my project.
My requirements are transactional nature, which I believe is one of the
strengths of functional programming, also handling large data set and being
available. there is no such requirement for partitioning of data and the
application is going to be centrally hosted on a single server.

AFAIK OCaml and other functional languages are heavily used in financial
domain, some of the reason are same as features I am looking for.
I wanted some insight as to how Haskell is going to help me with my project.
Also there has been some concerns because of lazy evaluation in Haskell and
memory leaks associated with it.
http://jlouisramblings.blogspot.com/2010/04/haskell-vs-erlang-for-bittorent-clients.html

Also, if you have any suggestions of the choice of programming
language, we have been looking into other functional languages like
 Scala and Clojure. But we have not dig deep on the performance
aspects of these languages, if someone can shed a light on the pros-
cons of these languages, it will help us very much to come to a
decision.

-Regards,
Amir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100615/169e7007/attachment-0001.html

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

Message: 3
Date: Tue, 15 Jun 2010 16:12:12 +0800
From: Lyndon Maydwell <maydw...@gmail.com>
Subject: Re: [Haskell-beginners] Accounting Engine in Haskell
To: amir.na...@gmail.com
Cc: beginners@haskell.org, haskell-c...@haskell.org
Message-ID:
        <aanlktim6c4prvgcww211pcffyb80leeykfghuryg1...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

I don't think I can be of much help with regards to the questions, but
would you be able to post a link to the SPJ lecture?

Thanks :-)

On Tue, Jun 15, 2010 at 4:08 PM, Amiruddin Nagri <amir.na...@gmail.com> wrote:
>
> My current project is about making an accounting engine that handles all
> the journal entries, transactions, portfolios etc. The communication
> with the engine is based on simple protocol, the things to be taken
> care of in the order are consistency, handling large data(performance) and
> availability.
>
> I came across a video lecture by Simon Peyton Jones where he gives an
> example from Financial domain (derivatives etc) to explain how haskell is
> being used and the advantages provided.
>
> I am interested in knowing if Haskell will be the right fit for my project.
> My requirements are transactional nature, which I believe is one of the
> strengths of functional programming, also handling large data set and being
> available. there is no such requirement for partitioning of data and the
> application is going to be centrally hosted on a single server.
>
> AFAIK OCaml and other functional languages are heavily used in financial
> domain, some of the reason are same as features I am looking for.
> I wanted some insight as to how Haskell is going to help me with my project.
> Also there has been some concerns because of lazy evaluation in Haskell and
> memory leaks associated with it.
> http://jlouisramblings.blogspot.com/2010/04/haskell-vs-erlang-for-bittorent-clients.html
>
> Also, if you have any suggestions of the choice of programming
> language, we have been looking into other functional languages like
>  Scala and Clojure. But we have not dig deep on the performance
> aspects of these languages, if someone can shed a light on the pros-
> cons of these languages, it will help us very much to come to a
> decision.
>
> -Regards,
> Amir
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>


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

Message: 4
Date: Tue, 15 Jun 2010 13:52:01 +0530
From: Amiruddin Nagri <amir.na...@gmail.com>
Subject: Re: [Haskell-beginners] Accounting Engine in Haskell
To: Lyndon Maydwell <maydw...@gmail.com>
Cc: beginners@haskell.org, haskell-c...@haskell.org
Message-ID:
        <aanlktiloit7d7cinlfmzhulsqmog3hltmtnnqdyng...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

It should be somewhere here ->
http://www.haskell.org/haskellwiki/Video_presentations

-Amir


On Tue, Jun 15, 2010 at 1:42 PM, Lyndon Maydwell <maydw...@gmail.com> wrote:

> I don't think I can be of much help with regards to the questions, but
> would you be able to post a link to the SPJ lecture?
>
> Thanks :-)
>
> On Tue, Jun 15, 2010 at 4:08 PM, Amiruddin Nagri <amir.na...@gmail.com>
> wrote:
> >
> > My current project is about making an accounting engine that handles all
> > the journal entries, transactions, portfolios etc. The communication
> > with the engine is based on simple protocol, the things to be taken
> > care of in the order are consistency, handling large data(performance)
> and
> > availability.
> >
> > I came across a video lecture by Simon Peyton Jones where he gives an
> > example from Financial domain (derivatives etc) to explain how haskell is
> > being used and the advantages provided.
> >
> > I am interested in knowing if Haskell will be the right fit for my
> project.
> > My requirements are transactional nature, which I believe is one of the
> > strengths of functional programming, also handling large data set and
> being
> > available. there is no such requirement for partitioning of data and the
> > application is going to be centrally hosted on a single server.
> >
> > AFAIK OCaml and other functional languages are heavily used in financial
> > domain, some of the reason are same as features I am looking for.
> > I wanted some insight as to how Haskell is going to help me with my
> project.
> > Also there has been some concerns because of lazy evaluation in Haskell
> and
> > memory leaks associated with it.
> >
> http://jlouisramblings.blogspot.com/2010/04/haskell-vs-erlang-for-bittorent-clients.html
> >
> > Also, if you have any suggestions of the choice of programming
> > language, we have been looking into other functional languages like
> >  Scala and Clojure. But we have not dig deep on the performance
> > aspects of these languages, if someone can shed a light on the pros-
> > cons of these languages, it will help us very much to come to a
> > decision.
> >
> > -Regards,
> > Amir
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners@haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100615/f0be1aba/attachment-0001.html

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

Message: 5
Date: Tue, 15 Jun 2010 12:34:27 +0300
From: Yitzchak Gale <g...@sefer.org>
Subject: Re: [Haskell-beginners] Accounting Engine in Haskell
To: amir.na...@gmail.com
Cc: beginners@haskell.org, haskell-c...@haskell.org
Message-ID:
        <aanlktinqyz4tnetubgoytkvdf4vjbaqaiv6w4yigi...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Amir,

Amiruddin Nagri wrote:
> My current project is about making an accounting engine...

Take a look at the related but different project "hledger".

http://hackage.haskell.org/package/hledger
http://hackage.haskell.org/package/hledger-lib

> consistency, handling large data(performance) and
> availability...
> I am interested in knowing if Haskell will be the right fit
> for my project.

These things can certainly be achieved, and Haskell is
a great platform for it. Reliability and assurance of correctness
are very important for financial systems, and Haskell is
especially good at providing them together with good
performance.

However, keep in mind that you are undertaking a very
ambitious project. There are a lot of little design decisions
to be made along the way which, if made without a lot of
previous experience in whatever language you are using,
could lead to serious problems later on in a large system
like this.

I recommend:

o Start with a less ambitious version of the project -
  a simpler prototype with less requirements, or components
  that can be developed as a stand-alone and later integrated
  into your larger system.

o Work closely with the community, on the #haskell
  IRC channel and the Haskell Cafe mailing list, to get
  guidance from experienced Haskellers. Share and discuss
  your code as you go along.

(Or, if you select a different language that you are not
very experienced in for developing large high-assurance
commercial systems, do the same with that language's
community.)

> Also there has been some concerns because of lazy evaluation
> in Haskell and memory leaks associated with it.

The possibility for memory and performance leaks in large
systems written in Haskell is no more or less than in any
other mature programming language. As in any language,
it takes experience and care to avoid them as your application
scales up.

Good luck,
Yitz


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

Message: 6
Date: Tue, 15 Jun 2010 15:57:50 +0200
From: Thomas <hask...@phirho.com>
Subject: [Haskell-beginners] type ambiguity confusion
To: beginners@haskell.org
Message-ID: <4c1786de.1040...@phirho.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello all!

This is a simplified example:
import Control.Exception

testHandle :: Integer -> IO (Maybe Integer)
testHandle i = handle (\_ -> return Nothing)
         (return (Just i))

It gives me an "ambiguous type variable" arising from the use of 
"handle". Ok, I understand that the type variable is ambiguous. And in 
fact I can resolve this with either wrapping it in a specialised handler:
import Control.Exception

handleIO :: (IOException -> IO a) -> IO a -> IO a
handleIO ec nc = handle ec nc

testHandle :: Integer -> IO (Maybe Integer)
testHandle i = handleIO (\_ -> return Nothing)
         (return (Just i))

or resolving it directly:
{-# LANGUAGE ScopedTypeVariables #-}

import Control.Exception

testHandle :: Integer -> IO (Maybe Integer)
testHandle i = handle (\ (_ :: IOException) -> return Nothing)
         (return (Just i))

However: Why does the ambiguity matter in the first place?
The corresponding value is never used (\_ -> return Nothing).

And there's another doubt: I got this example from a book (Real World 
Haskell, chapter 9) where actually the first version is used, without 
resolving the ambiguity in any way. And it does not show up in the 
errata list.
So there's likely something I'm still missing about this issue?!?!

Any hints would be really appreciated!
Thanks in advance.
Thomas




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

Message: 7
Date: Tue, 15 Jun 2010 15:07:38 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] type ambiguity confusion
Cc: beginners@haskell.org
Message-ID:
        <aanlktinmtza-knf3qaixyxhxcuqxyadol_1e9kity...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On 15 June 2010 14:57, Thomas <hask...@phirho.com> wrote:

>
> However: Why does the ambiguity matter in the first place?
> The corresponding value is never used (\_ -> return Nothing).

Hi Thomas

GHC has to resolve all types, even if they are for values that are not
used at runtime.

> And there's another doubt: I got this example from a book (Real World
> Haskell, chapter 9) where actually the first version is used, without
> resolving the ambiguity in any way. And it does not show up in the errata
> list.
> So there's likely something I'm still missing about this issue?!?!


The type of handle in Control.Exception has (probably) changed since
RWH was written.

latest (from ghc-6.10.1 onwards):
handle  :: Exception  e => (e -> IO  a) -> IO  a -> IO  a

old (upto ghc-6.8.3, I think, the so called Old.Exception):
handle  :: (Exception  -> IO  a) -> IO  a -> IO  a

Best wishes

Stephen


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

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


End of Beginners Digest, Vol 24, Issue 14
*****************************************

Reply via email to