[Haskell] Help lead Haskell: Executive Director sought for Haskell Foundation

2020-12-07 Thread Richard Eisenberg
Posting on behalf of the Haskell Foundation Working Group. Please forward 
widely!



The Haskell Foundation is seeking an Executive Director. Please find the job 
description here: https://haskell.foundation/ 
ed-job-description 


The Haskell Foundation (HF) is an independent, non-profit organization 
dedicated to driving Haskell adoption and open-source development. 

HF seeks a full-time Executive Director (ED) to lead and develop the 
organization going forward. The ED is responsible for furthering the HF’s 
mission and vision, ensuring that resources are in place to accomplish its 
goals. The HF is supported by an active group of volunteers, and the ED will be 
a key focal point for that community, in addition to hiring support staff.

This is a salaried position. Salary will be commensurate with the experience, 
qualities, and location of the individual, and will also reflect the 
Foundation’s status as a non-profit organisation funded by donations.


___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] Help wanted: Postfix admin guru for Haskell.org

2019-11-09 Thread Gershom B
We've been getting increasing amounts of bounces and dropped mail for
haskell.org emails (things sent hackage trustees, things sent from our
wiki and hackage servers, etc). We _mainly_ have kept things working,
but it looks like policies have been amped up in terms of requiring
various measures. Additionally, there's something about reverse dns
and valid hostnames that seems to not be configured correctly,
according to mxtoolbox. Along with all that, we'd really like to
migrate the mail infrastructure to our new packet servers, away from
rackspace.

As such, we could use some concentrated help from someone familiar
with maintaining and administering  postfix servers, if someone is up
to volunteer for the task.

Thanks!

--Gershom
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] Help inform GHC's development priorities

2018-10-18 Thread Ben Gamari
tl;dr. Please a take a minute to express your thoughts on
   GHC's development priorities via this survey [1].


Hello everyone,

The GHC developers want to ensure that we are working on problems that
of most importance to you, the Haskell community. To this end we are
surveying the community [1], asking how our users interact with GHC and
which problems need to be addressed most urgently.

We hope you will take a few minutes to give us your thoughts [1].

Thanks in advance for your time and, finally, thanks to the financial
supporters that make our work GHC possible.

Cheers,

- Ben and the rest of the GHC developers



[1] 
https://docs.google.com/forms/d/e/1FAIpQLSdh7sf2MqHoEmjt38r1cxCF-tV76OFCJqU6VabGzlOUKYqo-w/viewform


signature.asc
Description: PGP signature
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] Help wanted with Wiki.Haskell.Org

2015-04-20 Thread Gershom B
One of the central repositories of knowledge in the Haskell world is the 
HaskellWiki (https://wiki.haskell.org). This wiki has been with the Haskell 
community for years, and contains a wealth of knowledge. Like other services on 
the haskell.org domain and with haskell.org equipment, ultimate responsibility 
for maintaining it falls on the Haskell Committee. However, it is a community 
wiki, and requires care and maintenance and contributions from all of us. 

The wiki has been, and continues to be, a vital component in the Haskell world. 
Like any wiki, it is fueled by contributions from many people, and in this 
sense it is thriving. 

However, it could use a certain amount of attention and work in three key 
areas. We are looking for volunteers to step up in these regards, 

1) Account Creation Management: Account creation is manual only because 
spambots otherwise destroy us. It would be worth investigating if a full 
upgrade and new plugins could help this issue. In the meantime, the 
responsibility for creating new accounts has fallen on only one person for 
years. This is not a good situation. We would like to set up a mail alias for 
wiki admins and extend account creation rights to a range of people. If you 
would be willing to be one of a team of responders to account creation 
requests, please write and let us know. 

2) Technical and design oversight: Now that we have a new haskell.org homepage, 
the current wiki frontpage could use a redesign. For that matter, the whole 
wiki could use a bit of a redesign to bring it into a more modern style. Along 
with that, it may be the case that additional plugins — such as for typesetting 
code or equations better — could be quite helpful. It would be good to have a 
mediawiki admin who wants to help improve the technical capacities of the site, 
as well as to overhaul its look. Again, if you are interested in taking charge 
of this, please let us know.

3) Content curation:  One issue with a large collection of documents written by 
different people is the lack of curation. Some pages fall out of date, 
information is spread across multiple pages instead of collected together, and 
quality varies greatly. Without a central authority, no one is responsible (or 
empowered) to fix the situation. There is a balance between keeping things 
up-to-date and preserving the historic content of the wiki, and without people 
feeling empowered to make big changes, the tendency will always fall towards 
the latter.

We're looking for people in the community to volunteer to help improve this 
status quo. The task, generally speaking, is to be responsible for curating and 
improving the content of the wiki, but that's clearly a vague description with 
lots of room for individual embellishment. This doesn't need to be a single 
person either: a team working in a coordinated fashion could be incredibly 
effective. 

Once more, depending on response, we’d be happy to designate and empower people 
to make broader changes on the wiki or to organize a team to do so. If you are 
interested in this as well, please let us know.

Gershom,
for the Haskell.org Committee


___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [arch-haskell] help upgrading packages

2014-05-16 Thread Bardur Arantsson
On 2014-05-15 23:18, Magnus Therning wrote:
 On Thu, May 15, 2014 at 05:29:13PM +0200, Bardur Arantsson wrote:
 On 2014-05-15 11:35, Magnus Therning wrote:
 On Wed, May 14, 2014 at 10:47 PM, Bardur Arantsson s...@scientician.net 
 wrote:
 On 2014-05-12 15:47, Magnus Therning wrote:
 [--snip--]

 All I needed to install build-wrapper (which I think was the
 inital problem package in this thread) was to do

 $ mkdir somewhere/buildwrapper
 $ cd somewhere/buildwrapper
 $ cabal sandbox init
 $ cabal install buildwrapper

 Add somewhere/buildwrapper to $PATH. Bonus points for using
 stow or similar.
 The key point in the above recipe is to *NOT* have all kinds of
 libraries installed system-wide (aka. via pacman). It usually
 works better that way.

 Surely you should then `cabal install` the tool so you don't end up
 with a complete sandbox with every dependency of buildwrapper's in
 it, no?

 You *do* need to keep the sandbox around (or at least parts of it).
 That's where the last cabal install line installs to.
 
 Well, wouldn't you want the binary installed somewhere else, so you
 don't need to keep the sandbox around?  Or do you build all your
 haskell tools (hlint, hoogle, buildwrapper, hasktags, ghc-mod, etc) in
 the same sandbox?
 

What I do for executable-only is pretty simple. I use stow to manage all
non-distro software that I install, so I have one directory
per package, like so:

  ~/stow/ghc-mod/lib/ghc-mod/src
  ~/stow/hums/lib/hums/src
  (etc.)

Each of these directories contains a full sandbox with a locally-run
cabal install.

For each package I add a bin directory, so

 ~/stow/ghc-mod/bin

and put in the necessary relative symlinks:

 ~/stow/ghc-mod-4.0.2/bin
cpphs - ../lib/ghc-mod/.cabal-sandbox/bin/cpphs
ghc-mod - ../lib/ghc-mod/.cabal-sandbox/bin/ghc-mod
ghc-modi - ../lib/ghc-mod/.cabal-sandbox/bin/ghc-modi
hlint - ../lib/ghc-mod/.cabal-sandbox/bin/hlint
HsColour - ../lib/ghc-mod/.cabal-sandbox/bin/HsColour

And finally use stow to merge the package into my ~ directory, so that
all the bin/ symlinks end up in my ~/bin.

(I use stow because I'm pretty pendantic about keeping packages
separate from everything else in my $HOME, but you could also just have
a ~/src with a sandbox for every package and add symlinks directly from
your ~/bin into the sandboxes. It's just that since all my non-haskell
non-distro self-built software is managed by stow, I chose to also use
stow for this.)

 For some packages you would have to keep the sandbox around and do
 it your way though, e.g. `pandoc` since it contains both a library
 and executables.

 If you want to use a sandboxed thing as a library then you need to
 develop inside the sandbox, so e.g. you'd just create a little
 cabal file for your project which declares all the dependencies and
 use cabal to build your project.
 
 That's indeed the case, but that's *not* the point I was trying to
 make.  If a package only consists of executables you can use the
 `install` target of the Cabal file to install them.  If a package
 consists of both a library and executables it's more manual work.

I think we might be talking past each other...

I'm afraid I don't understand what you mean by more manual work. Using
sandboxes the way I've described above doesn't really work at all for
executable + library situations. (So I offered a different solution to
that problem, namely cabal-ifying your own package that depends on a
library and installing your own package in a sandbox.)

 Cabal also works beautifully for hobby type development. Once
 you've created a cabal file you hardly ever need to touch it again.
 :)
 
 But it's overkill.  Do keep in mind that Cabal and `cabal` are two
 different things.  Of course I use Cabal in all my packages, but I
 don't use `cabal` at all.  The main reason I see for using `cabal`
 would be when I need to maintain compatibility with multiple versions
 of GHC and or packages I depend on.
 

If we want to get pendantic, it's probably best to say Cabal vs.
cabal-install (which is where the cabal executable comes from, for
those who don't know).

I use cabal-install for all development with a .cabal file for each of
my projects, I never use Cabal (the library) directly as I've never
encountered a need to. I've not encountered many packages which use
anything other than the standard boilerplate Setup.hs/Setup.lhs file.
(Some packages with *really* complex build requirements do so, e.g.
Gtk2hs, but I assumed that's not quite the level of complexity we're
talking here.)

Anyway, enough rambling on...

Regards,

___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-15 Thread Magnus Therning
On Wed, May 14, 2014 at 10:47 PM, Bardur Arantsson s...@scientician.net wrote:
 On 2014-05-12 15:47, Magnus Therning wrote:
 [--snip--]
 The same goes for me.  Occasionally I revert to installing a package
 for the local user only, but not even then do I use `cabal install` to
 do that, I prefer running `./Setup.hs configure,build,install` myself.

 I do mean to look into using `cabal` myself at some point, because I
 keep on hearing good things about it.  So far every time I've tried it
 I've run into something weird, most recently it was trying to install
 an older version of a lib than was needed, and I already had the newer
 version installed on my system too.  A lot of terrifyingly clever
 people swear by it though, so there has to be something I'm missing
 out on!

 Gah! Just try it!

 All I needed to install build-wrapper (which I think was the inital
 problem package in this thread) was to do

 $ mkdir somewhere/buildwrapper
 $ cd somewhere/buildwrapper
 $ cabal sandbox init
 $ cabal install buildwrapper

 Add somewhere/buildwrapper to $PATH. Bonus points for using stow or
 similar.
 The key point in the above recipe is to *NOT* have all kinds of
 libraries installed system-wide (aka. via pacman). It usually works
 better that way.

Surely you should then `cabal install` the tool so you don't end up
with a complete sandbox with every dependency of buildwrapper's in it,
no?

For some packages you would have to keep the sandbox around and do it
your way though, e.g. `pandoc` since it contains both a library and
executables.

 Disclaimer: I haven't actually used buildwrapper personally, but one
 assumes that it just acts as an executable and doesn't install things
 into its own environment or other weird things.

Personally I think `cabal` really shines when doing more serious
Haskell development than I do.  I never test my Haskell packages on
anything other than the GHC that's in [haskell-core], and neither do I
test them against any other versions of packages than what's found in
[haskell-core].  My Haskell development is completely in my free time
and for fun.  I think that if I ever am lucky enough find myself using
Haskell professionally I'd quickly see more use in what `cabal` has to
offer.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus
___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-15 Thread Bardur Arantsson
On 2014-05-15 11:35, Magnus Therning wrote:
 On Wed, May 14, 2014 at 10:47 PM, Bardur Arantsson s...@scientician.net 
 wrote:
 On 2014-05-12 15:47, Magnus Therning wrote:
 [--snip--]

 All I needed to install build-wrapper (which I think was the inital
 problem package in this thread) was to do

 $ mkdir somewhere/buildwrapper
 $ cd somewhere/buildwrapper
 $ cabal sandbox init
 $ cabal install buildwrapper

 Add somewhere/buildwrapper to $PATH. Bonus points for using stow or
 similar.
 The key point in the above recipe is to *NOT* have all kinds of
 libraries installed system-wide (aka. via pacman). It usually works
 better that way.
 
 Surely you should then `cabal install` the tool so you don't end up
 with a complete sandbox with every dependency of buildwrapper's in it,
 no?
 

You *do* need to keep the sandbox around (or at least parts of it).
That's where the last cabal install line installs to.

 For some packages you would have to keep the sandbox around and do it
 your way though, e.g. `pandoc` since it contains both a library and
 executables.
 

If you want to use a sandboxed thing as a library then you need to
develop inside the sandbox, so e.g. you'd just create a little cabal
file for your project which declares all the dependencies and use cabal
to build your project.

 Disclaimer: I haven't actually used buildwrapper personally, but one
 assumes that it just acts as an executable and doesn't install things
 into its own environment or other weird things.
 
 Personally I think `cabal` really shines when doing more serious
 Haskell development than I do.  I never test my Haskell packages on
 anything other than the GHC that's in [haskell-core], and neither do I
 test them against any other versions of packages than what's found in
 [haskell-core].  My Haskell development is completely in my free time
 and for fun.  I think that if I ever am lucky enough find myself using
 Haskell professionally I'd quickly see more use in what `cabal` has to
 offer.
 

Cabal also works beautifully for hobby type development. Once you've
created a cabal file you hardly ever need to touch it again. :)

Regards,

___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-15 Thread Magnus Therning
On Thu, May 15, 2014 at 05:29:13PM +0200, Bardur Arantsson wrote:
 On 2014-05-15 11:35, Magnus Therning wrote:
 On Wed, May 14, 2014 at 10:47 PM, Bardur Arantsson s...@scientician.net 
 wrote:
 On 2014-05-12 15:47, Magnus Therning wrote:
 [--snip--]

 All I needed to install build-wrapper (which I think was the
 inital problem package in this thread) was to do

 $ mkdir somewhere/buildwrapper
 $ cd somewhere/buildwrapper
 $ cabal sandbox init
 $ cabal install buildwrapper

 Add somewhere/buildwrapper to $PATH. Bonus points for using
 stow or similar.
 The key point in the above recipe is to *NOT* have all kinds of
 libraries installed system-wide (aka. via pacman). It usually
 works better that way.
 
 Surely you should then `cabal install` the tool so you don't end up
 with a complete sandbox with every dependency of buildwrapper's in
 it, no?
 
 You *do* need to keep the sandbox around (or at least parts of it).
 That's where the last cabal install line installs to.

Well, wouldn't you want the binary installed somewhere else, so you
don't need to keep the sandbox around?  Or do you build all your
haskell tools (hlint, hoogle, buildwrapper, hasktags, ghc-mod, etc) in
the same sandbox?

 For some packages you would have to keep the sandbox around and do
 it your way though, e.g. `pandoc` since it contains both a library
 and executables.
 
 If you want to use a sandboxed thing as a library then you need to
 develop inside the sandbox, so e.g. you'd just create a little
 cabal file for your project which declares all the dependencies and
 use cabal to build your project.

That's indeed the case, but that's *not* the point I was trying to
make.  If a package only consists of executables you can use the
`install` target of the Cabal file to install them.  If a package
consists of both a library and executables it's more manual work.

 Disclaimer: I haven't actually used buildwrapper personally, but
 one assumes that it just acts as an executable and doesn't install
 things into its own environment or other weird things.
 
 Personally I think `cabal` really shines when doing more serious
 Haskell development than I do.  I never test my Haskell packages on
 anything other than the GHC that's in [haskell-core], and neither
 do I test them against any other versions of packages than what's
 found in [haskell-core].  My Haskell development is completely in
 my free time and for fun.  I think that if I ever am lucky enough
 find myself using Haskell professionally I'd quickly see more use
 in what `cabal` has to offer.
 
 Cabal also works beautifully for hobby type development. Once
 you've created a cabal file you hardly ever need to touch it again.
 :)

But it's overkill.  Do keep in mind that Cabal and `cabal` are two
different things.  Of course I use Cabal in all my packages, but I
don't use `cabal` at all.  The main reason I see for using `cabal`
would be when I need to maintain compatibility with multiple versions
of GHC and or packages I depend on.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

What gets measured, gets done.
 -- Tom Peters


pgpL8EJJFLR59.pgp
Description: PGP signature
___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-14 Thread Bardur Arantsson
On 2014-05-12 15:47, Magnus Therning wrote:
[--snip--]
 The same goes for me.  Occasionally I revert to installing a package
 for the local user only, but not even then do I use `cabal install` to
 do that, I prefer running `./Setup.hs configure,build,install` myself.
 
 I do mean to look into using `cabal` myself at some point, because I
 keep on hearing good things about it.  So far every time I've tried it
 I've run into something weird, most recently it was trying to install
 an older version of a lib than was needed, and I already had the newer
 version installed on my system too.  A lot of terrifyingly clever
 people swear by it though, so there has to be something I'm missing
 out on!

Gah! Just try it!

All I needed to install build-wrapper (which I think was the inital
problem package in this thread) was to do

$ mkdir somewhere/buildwrapper
$ cd somewhere/buildwrapper
$ cabal sandbox init
$ cabal install buildwrapper

Add somewhere/buildwrapper to $PATH. Bonus points for using stow or
similar.

The key point in the above recipe is to *NOT* have all kinds of
libraries installed system-wide (aka. via pacman). It usually works
better that way.

Disclaimer: I haven't actually used buildwrapper personally, but one
assumes that it just acts as an executable and doesn't install things
into its own environment or other weird things.

Regards,

___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Nicola Squartini
http-conduit and its dependencies moved from haskell-happstack to
haskell-core and at that time the package release number reset to one. You
have to manually uninstall and reinstall those packages.

Nicola


On Sun, May 11, 2014 at 11:49 PM, Michael Katelman katel...@gmail.comwrote:

 I was hoping someone might help me with an issuing I'm having doing a
 system upgrade. When I run pacman -Syu, I get:

 :: Synchronizing package databases...
 haskell-core is up to date
 haskell-happstack is up to date
 core is up to date
 extra is up to date
 community is up to date
 :: Starting full system upgrade...
 warning: haskell-asn1-encoding: local (0.8.1.3-4) is newer than
 haskell-core (0.8.1.3-2)
 warning: haskell-asn1-parse: local (0.8.1-5) is newer than haskell-core
 (0.8.1-2)
 warning: haskell-asn1-types: local (0.2.3-3) is newer than haskell-core
 (0.2.3-1)
 warning: haskell-cipher-aes: local (0.2.7-3) is newer than haskell-core
 (0.2.7-1)
 warning: haskell-cipher-rc4: local (0.1.4-4) is newer than haskell-core
 (0.1.4-1)
 warning: haskell-connection: local (0.2.1-3) is newer than haskell-core
 (0.2.1-2)
 warning: haskell-cprng-aes: local (0.5.2-8) is newer than haskell-core
 (0.5.2-1)
 warning: haskell-crypto-cipher-types: local (0.0.9-3) is newer than
 haskell-core (0.0.9-1)
 warning: haskell-crypto-numbers: local (0.2.3-3) is newer than
 haskell-core (0.2.3-1)
 warning: haskell-crypto-pubkey: local (0.2.4-6) is newer than haskell-core
 (0.2.4-1)
 warning: haskell-crypto-pubkey-types: local (0.4.2.2-3) is newer than
 haskell-core (0.4.2.2-1)
 warning: haskell-crypto-random: local (0.0.7-4) is newer than haskell-core
 (0.0.7-1)
 warning: haskell-http-client-tls: local (0.2.1.1-21) is newer than
 haskell-core (0.2.1.1-2)
 warning: haskell-http-conduit: local (2.1.2-4) is newer than haskell-core
 (2.1.2-2)
 warning: haskell-mime-types: local (0.1.0.4-3) is newer than haskell-core
 (0.1.0.4-2)
 warning: haskell-publicsuffixlist: local (0.1-7) is newer than
 haskell-core (0.1-2)
 warning: haskell-securemem: local (0.1.3-3) is newer than haskell-core
 (0.1.3-1)
 warning: haskell-socks: local (0.5.4-10) is newer than haskell-core
 (0.5.4-2)
 warning: haskell-x509: local (1.4.11-5) is newer than haskell-core
 (1.4.11-2)
 warning: haskell-x509-store: local (1.4.4-9) is newer than haskell-core
 (1.4.4-2)
 warning: haskell-x509-validation: local (1.5.0-9) is newer than
 haskell-core (1.5.0-2)
 resolving dependencies...
 looking for inter-conflicts...
 error: failed to prepare transaction (could not satisfy dependencies)
 :: haskell-connection: requires haskell-network=2.4.2.2-60
 :: haskell-connection: requires haskell-tls=1.2.6-5
 :: haskell-connection: requires haskell-x509=1.4.11-5
 :: haskell-connection: requires haskell-x509-store=1.4.4-9
 :: haskell-connection: requires haskell-x509-validation=1.5.0-9
 :: haskell-cookie: requires haskell-blaze-builder=0.3.3.2-59
 :: haskell-cookie: requires haskell-text=1.1.1.1-1
 :: haskell-cprng-aes: requires haskell-cipher-aes=0.2.7-3
 :: haskell-cprng-aes: requires haskell-crypto-random=0.0.7-4
 :: haskell-http-client-tls: requires haskell-http-client=0.3.2.1-2
 :: haskell-http-client-tls: requires haskell-network=2.4.2.2-60
 :: haskell-http-client-tls: requires haskell-tls=1.2.6-5
 :: haskell-http-conduit: requires haskell-conduit=1.1.1.1-1
 :: haskell-http-conduit: requires haskell-http-client=0.3.2.1-2
 :: haskell-http-conduit: requires haskell-http-types=0.8.4-4
 :: haskell-http-conduit: requires haskell-lifted-base=0.2.2.1-3
 :: haskell-http-conduit: requires haskell-monad-control=0.3.2.3-5
 :: haskell-http-conduit: requires haskell-resourcet=1.1.2-1
 :: haskell-socks: requires haskell-network=2.4.2.2-60
 :: haskell-x509-system: requires haskell-x509=1.4.11-5
 :: haskell-x509-system: requires haskell-x509-store=1.4.4-9


 I really have no idea what to do with this or what would have caused it.
 I'm sure it's some important misunderstanding on my part. Any help would be
 greatly appreciated.

 -Mike

 ___
 arch-haskell mailing list
 arch-haskell@haskell.org
 http://www.haskell.org/mailman/listinfo/arch-haskell


___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Dawid Loubser
I had a similar issue with a large number of packages.
I ended up removing and re-installing my entire Haskell ecosystem, and
now things work again.

I note the absence of certain packages like haskell-buildwrapper (which
EclipseFP tools needs) - and reading the wiki, it seems confusing at
this time whether the Haskell tinkerer / developer should just be using
cabal-install to install all required packages (even though I know that
cabal is not a package management system) or... what?

What are other Haskell developers here doing currently?

kind regards,
Dawid Loubser


On 12/05/2014 08:49, Nicola Squartini wrote:
 http-conduit and its dependencies moved from haskell-happstack to
 haskell-core and at that time the package release number reset to one.
 You have to manually uninstall and reinstall those packages.

 Nicola


 On Sun, May 11, 2014 at 11:49 PM, Michael Katelman katel...@gmail.com
 mailto:katel...@gmail.com wrote:

 I was hoping someone might help me with an issuing I'm having
 doing a system upgrade. When I run pacman -Syu, I get:

 :: Synchronizing package databases...
 haskell-core is up to date
 haskell-happstack is up to date
 core is up to date
 extra is up to date
 community is up to date
 :: Starting full system upgrade...
 warning: haskell-asn1-encoding: local (0.8.1.3-4) is newer than
 haskell-core (0.8.1.3-2)
 warning: haskell-asn1-parse: local (0.8.1-5) is newer than
 haskell-core (0.8.1-2)
 warning: haskell-asn1-types: local (0.2.3-3) is newer than
 haskell-core (0.2.3-1)
 warning: haskell-cipher-aes: local (0.2.7-3) is newer than
 haskell-core (0.2.7-1)
 warning: haskell-cipher-rc4: local (0.1.4-4) is newer than
 haskell-core (0.1.4-1)
 warning: haskell-connection: local (0.2.1-3) is newer than
 haskell-core (0.2.1-2)
 warning: haskell-cprng-aes: local (0.5.2-8) is newer than
 haskell-core (0.5.2-1)
 warning: haskell-crypto-cipher-types: local (0.0.9-3) is newer
 than haskell-core (0.0.9-1)
 warning: haskell-crypto-numbers: local (0.2.3-3) is newer than
 haskell-core (0.2.3-1)
 warning: haskell-crypto-pubkey: local (0.2.4-6) is newer than
 haskell-core (0.2.4-1)
 warning: haskell-crypto-pubkey-types: local (0.4.2.2-3) is newer
 than haskell-core (0.4.2.2-1)
 warning: haskell-crypto-random: local (0.0.7-4) is newer than
 haskell-core (0.0.7-1)
 warning: haskell-http-client-tls: local (0.2.1.1-21) is newer than
 haskell-core (0.2.1.1-2)
 warning: haskell-http-conduit: local (2.1.2-4) is newer than
 haskell-core (2.1.2-2)
 warning: haskell-mime-types: local (0.1.0.4-3) is newer than
 haskell-core (0.1.0.4-2)
 warning: haskell-publicsuffixlist: local (0.1-7) is newer than
 haskell-core (0.1-2)
 warning: haskell-securemem: local (0.1.3-3) is newer than
 haskell-core (0.1.3-1)
 warning: haskell-socks: local (0.5.4-10) is newer than
 haskell-core (0.5.4-2)
 warning: haskell-x509: local (1.4.11-5) is newer than haskell-core
 (1.4.11-2)
 warning: haskell-x509-store: local (1.4.4-9) is newer than
 haskell-core (1.4.4-2)
 warning: haskell-x509-validation: local (1.5.0-9) is newer than
 haskell-core (1.5.0-2)
 resolving dependencies...
 looking for inter-conflicts...
 error: failed to prepare transaction (could not satisfy dependencies)
 :: haskell-connection: requires haskell-network=2.4.2.2-60
 :: haskell-connection: requires haskell-tls=1.2.6-5
 :: haskell-connection: requires haskell-x509=1.4.11-5
 :: haskell-connection: requires haskell-x509-store=1.4.4-9
 :: haskell-connection: requires haskell-x509-validation=1.5.0-9
 :: haskell-cookie: requires haskell-blaze-builder=0.3.3.2-59
 :: haskell-cookie: requires haskell-text=1.1.1.1-1
 :: haskell-cprng-aes: requires haskell-cipher-aes=0.2.7-3
 :: haskell-cprng-aes: requires haskell-crypto-random=0.0.7-4
 :: haskell-http-client-tls: requires haskell-http-client=0.3.2.1-2
 :: haskell-http-client-tls: requires haskell-network=2.4.2.2-60
 :: haskell-http-client-tls: requires haskell-tls=1.2.6-5
 :: haskell-http-conduit: requires haskell-conduit=1.1.1.1-1
 :: haskell-http-conduit: requires haskell-http-client=0.3.2.1-2
 :: haskell-http-conduit: requires haskell-http-types=0.8.4-4
 :: haskell-http-conduit: requires haskell-lifted-base=0.2.2.1-3
 :: haskell-http-conduit: requires haskell-monad-control=0.3.2.3-5
 :: haskell-http-conduit: requires haskell-resourcet=1.1.2-1
 :: haskell-socks: requires haskell-network=2.4.2.2-60
 :: haskell-x509-system: requires haskell-x509=1.4.11-5
 :: haskell-x509-system: requires haskell-x509-store=1.4.4-9


 I really have no idea what to do with this or what would have
 caused it. I'm sure it's some important misunderstanding on my
 part. Any help would be greatly appreciated.

 -Mike

 

Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Nicola Squartini
On Mon, May 12, 2014 at 2:24 PM, Dawid Loubser dawid.loub...@ibi.co.zawrote:

  I had a similar issue with a large number of packages.
 I ended up removing and re-installing my entire Haskell ecosystem, and now
 things work again.

 Normally this should never happen. It's because Haskell is very strict on
dependencies (despite being lazy on other things).
In this case the reason was that those packages were added to the
repository  [haskell-core] with initial release number set to 1, although
they had been in [haskell-happstack] already for some time and their
release number was higher. I removed those immediately
from [haskell-happstack] to avoid duplicate work, but they must also be
manually removed from local, since pacman always keeps the highest
version-release.

In order to avoid this kind of issues in the future we should either have a
policy to coordinate work between different haskell repositories, or merge
everything into a unique repository and call it simply [haskell].



 I note the absence of certain packages like haskell-buildwrapper (which
 EclipseFP tools needs) - and reading the wiki, it seems confusing at this
 time whether the Haskell tinkerer / developer should just be using
 cabal-install to install all required packages (even though I know that
 cabal is not a package management system) or... what?


Personally I don't like installing things using cabal-install because in my
opinion the distro package manager should always be in charge.


 What are other Haskell developers here doing currently?

 kind regards,
 Dawid Loubser



 On 12/05/2014 08:49, Nicola Squartini wrote:

 http-conduit and its dependencies moved from haskell-happstack to
 haskell-core and at that time the package release number reset to one. You
 have to manually uninstall and reinstall those packages.

  Nicola


 On Sun, May 11, 2014 at 11:49 PM, Michael Katelman katel...@gmail.comwrote:

 I was hoping someone might help me with an issuing I'm having doing a
 system upgrade. When I run pacman -Syu, I get:

  :: Synchronizing package databases...
 haskell-core is up to date
 haskell-happstack is up to date
 core is up to date
 extra is up to date
 community is up to date
 :: Starting full system upgrade...
 warning: haskell-asn1-encoding: local (0.8.1.3-4) is newer than
 haskell-core (0.8.1.3-2)
 warning: haskell-asn1-parse: local (0.8.1-5) is newer than haskell-core
 (0.8.1-2)
 warning: haskell-asn1-types: local (0.2.3-3) is newer than haskell-core
 (0.2.3-1)
 warning: haskell-cipher-aes: local (0.2.7-3) is newer than haskell-core
 (0.2.7-1)
 warning: haskell-cipher-rc4: local (0.1.4-4) is newer than haskell-core
 (0.1.4-1)
 warning: haskell-connection: local (0.2.1-3) is newer than haskell-core
 (0.2.1-2)
 warning: haskell-cprng-aes: local (0.5.2-8) is newer than haskell-core
 (0.5.2-1)
 warning: haskell-crypto-cipher-types: local (0.0.9-3) is newer than
 haskell-core (0.0.9-1)
 warning: haskell-crypto-numbers: local (0.2.3-3) is newer than
 haskell-core (0.2.3-1)
 warning: haskell-crypto-pubkey: local (0.2.4-6) is newer than
 haskell-core (0.2.4-1)
 warning: haskell-crypto-pubkey-types: local (0.4.2.2-3) is newer than
 haskell-core (0.4.2.2-1)
 warning: haskell-crypto-random: local (0.0.7-4) is newer than
 haskell-core (0.0.7-1)
 warning: haskell-http-client-tls: local (0.2.1.1-21) is newer than
 haskell-core (0.2.1.1-2)
 warning: haskell-http-conduit: local (2.1.2-4) is newer than haskell-core
 (2.1.2-2)
 warning: haskell-mime-types: local (0.1.0.4-3) is newer than haskell-core
 (0.1.0.4-2)
 warning: haskell-publicsuffixlist: local (0.1-7) is newer than
 haskell-core (0.1-2)
 warning: haskell-securemem: local (0.1.3-3) is newer than haskell-core
 (0.1.3-1)
 warning: haskell-socks: local (0.5.4-10) is newer than haskell-core
 (0.5.4-2)
 warning: haskell-x509: local (1.4.11-5) is newer than haskell-core
 (1.4.11-2)
 warning: haskell-x509-store: local (1.4.4-9) is newer than haskell-core
 (1.4.4-2)
 warning: haskell-x509-validation: local (1.5.0-9) is newer than
 haskell-core (1.5.0-2)
 resolving dependencies...
 looking for inter-conflicts...
 error: failed to prepare transaction (could not satisfy dependencies)
 :: haskell-connection: requires haskell-network=2.4.2.2-60
 :: haskell-connection: requires haskell-tls=1.2.6-5
 :: haskell-connection: requires haskell-x509=1.4.11-5
 :: haskell-connection: requires haskell-x509-store=1.4.4-9
 :: haskell-connection: requires haskell-x509-validation=1.5.0-9
 :: haskell-cookie: requires haskell-blaze-builder=0.3.3.2-59
 :: haskell-cookie: requires haskell-text=1.1.1.1-1
 :: haskell-cprng-aes: requires haskell-cipher-aes=0.2.7-3
 :: haskell-cprng-aes: requires haskell-crypto-random=0.0.7-4
 :: haskell-http-client-tls: requires haskell-http-client=0.3.2.1-2
 :: haskell-http-client-tls: requires haskell-network=2.4.2.2-60
 :: haskell-http-client-tls: requires haskell-tls=1.2.6-5
 :: haskell-http-conduit: requires haskell-conduit=1.1.1.1-1
 :: haskell-http-conduit: requires 

Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Magnus Therning
On Mon, May 12, 2014 at 3:33 PM, Nicola Squartini tens...@gmail.com wrote:
 On Mon, May 12, 2014 at 2:24 PM, Dawid Loubser dawid.loub...@ibi.co.za
 wrote:

 I had a similar issue with a large number of packages.
 I ended up removing and re-installing my entire Haskell ecosystem, and now
 things work again.

 Normally this should never happen. It's because Haskell is very strict on
 dependencies (despite being lazy on other things).
 In this case the reason was that those packages were added to the repository
 [haskell-core] with initial release number set to 1, although they had been
 in [haskell-happstack] already for some time and their release number was
 higher. I removed those immediately from [haskell-happstack] to avoid
 duplicate work, but they must also be manually removed from local, since
 pacman always keeps the highest version-release.

 In order to avoid this kind of issues in the future we should either have a
 policy to coordinate work between different haskell repositories, or merge
 everything into a unique repository and call it simply [haskell].

Indeed.  This is entirely my fault!

I have not been keeping track of what is available in any other repos
at all.  I was even under the impression that there were no other
maintained repos at the moment.  Clearly I am completely wrong :(

 I note the absence of certain packages like haskell-buildwrapper (which
 EclipseFP tools needs) - and reading the wiki, it seems confusing at this
 time whether the Haskell tinkerer / developer should just be using
 cabal-install to install all required packages (even though I know that
 cabal is not a package management system) or... what?

 Personally I don't like installing things using cabal-install because in my
 opinion the distro package manager should always be in charge.

The same goes for me.  Occasionally I revert to installing a package
for the local user only, but not even then do I use `cabal install` to
do that, I prefer running `./Setup.hs configure,build,install` myself.

I do mean to look into using `cabal` myself at some point, because I
keep on hearing good things about it.  So far every time I've tried it
I've run into something weird, most recently it was trying to install
an older version of a lib than was needed, and I already had the newer
version installed on my system too.  A lot of terrifyingly clever
people swear by it though, so there has to be something I'm missing
out on!

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus
___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Dawid Loubser
I'm afraid that I am not one of those 'terrifyingly clever' people you
speak of, Magnus, but in the past I have had a world of pain trying to
use a mixture of packages between cabal and pacman.

Had a very happy time using just pacman until *haskell-buildwrapper*
disappeared recently, and I could no longer use my favourite Haskell IDE :-(
I don't want to even try installing it using cabal, becuase then I'll be
back in package-dependency hell.

I have to say, I appreciate your efforts into making Haskell easy to use
on Arch so very much - I don't mean to complain at all!

regards,
Dawid


On 12/05/2014 15:47, Magnus Therning wrote:
 On Mon, May 12, 2014 at 3:33 PM, Nicola Squartini tens...@gmail.com wrote:
 On Mon, May 12, 2014 at 2:24 PM, Dawid Loubser dawid.loub...@ibi.co.za
 wrote:
 I had a similar issue with a large number of packages.
 I ended up removing and re-installing my entire Haskell ecosystem, and now
 things work again.

 Normally this should never happen. It's because Haskell is very strict on
 dependencies (despite being lazy on other things).
 In this case the reason was that those packages were added to the repository
 [haskell-core] with initial release number set to 1, although they had been
 in [haskell-happstack] already for some time and their release number was
 higher. I removed those immediately from [haskell-happstack] to avoid
 duplicate work, but they must also be manually removed from local, since
 pacman always keeps the highest version-release.

 In order to avoid this kind of issues in the future we should either have a
 policy to coordinate work between different haskell repositories, or merge
 everything into a unique repository and call it simply [haskell].
 Indeed.  This is entirely my fault!

 I have not been keeping track of what is available in any other repos
 at all.  I was even under the impression that there were no other
 maintained repos at the moment.  Clearly I am completely wrong :(

 I note the absence of certain packages like haskell-buildwrapper (which
 EclipseFP tools needs) - and reading the wiki, it seems confusing at this
 time whether the Haskell tinkerer / developer should just be using
 cabal-install to install all required packages (even though I know that
 cabal is not a package management system) or... what?
 Personally I don't like installing things using cabal-install because in my
 opinion the distro package manager should always be in charge.
 The same goes for me.  Occasionally I revert to installing a package
 for the local user only, but not even then do I use `cabal install` to
 do that, I prefer running `./Setup.hs configure,build,install` myself.

 I do mean to look into using `cabal` myself at some point, because I
 keep on hearing good things about it.  So far every time I've tried it
 I've run into something weird, most recently it was trying to install
 an older version of a lib than was needed, and I already had the newer
 version installed on my system too.  A lot of terrifyingly clever
 people swear by it though, so there has to be something I'm missing
 out on!

 /M


___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [arch-haskell] help upgrading packages

2014-05-12 Thread Magnus Therning
On Mon, May 12, 2014 at 4:02 PM, Dawid Loubser dawid.loub...@ibi.co.za wrote:
 I'm afraid that I am not one of those 'terrifyingly clever' people you speak
 of, Magnus, but in the past I have had a world of pain trying to use a
 mixture of packages between cabal and pacman.

 Had a very happy time using just pacman until haskell-buildwrapper
 disappeared recently, and I could no longer use my favourite Haskell IDE :-(
 I don't want to even try installing it using cabal, becuase then I'll be
 back in package-dependency hell.

 I have to say, I appreciate your efforts into making Haskell easy to use on
 Arch so very much - I don't mean to complain at all!

Create a new issue for it on the github page[1], or even better dig
into `cblrepo`, add it yourself, and send me a pull request ;)

/M

[1]: https://github.com/archhaskell/habs/issues

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus
___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


[arch-haskell] help upgrading packages

2014-05-11 Thread Michael Katelman
I was hoping someone might help me with an issuing I'm having doing a
system upgrade. When I run pacman -Syu, I get:

:: Synchronizing package databases...
haskell-core is up to date
haskell-happstack is up to date
core is up to date
extra is up to date
community is up to date
:: Starting full system upgrade...
warning: haskell-asn1-encoding: local (0.8.1.3-4) is newer than
haskell-core (0.8.1.3-2)
warning: haskell-asn1-parse: local (0.8.1-5) is newer than haskell-core
(0.8.1-2)
warning: haskell-asn1-types: local (0.2.3-3) is newer than haskell-core
(0.2.3-1)
warning: haskell-cipher-aes: local (0.2.7-3) is newer than haskell-core
(0.2.7-1)
warning: haskell-cipher-rc4: local (0.1.4-4) is newer than haskell-core
(0.1.4-1)
warning: haskell-connection: local (0.2.1-3) is newer than haskell-core
(0.2.1-2)
warning: haskell-cprng-aes: local (0.5.2-8) is newer than haskell-core
(0.5.2-1)
warning: haskell-crypto-cipher-types: local (0.0.9-3) is newer than
haskell-core (0.0.9-1)
warning: haskell-crypto-numbers: local (0.2.3-3) is newer than haskell-core
(0.2.3-1)
warning: haskell-crypto-pubkey: local (0.2.4-6) is newer than haskell-core
(0.2.4-1)
warning: haskell-crypto-pubkey-types: local (0.4.2.2-3) is newer than
haskell-core (0.4.2.2-1)
warning: haskell-crypto-random: local (0.0.7-4) is newer than haskell-core
(0.0.7-1)
warning: haskell-http-client-tls: local (0.2.1.1-21) is newer than
haskell-core (0.2.1.1-2)
warning: haskell-http-conduit: local (2.1.2-4) is newer than haskell-core
(2.1.2-2)
warning: haskell-mime-types: local (0.1.0.4-3) is newer than haskell-core
(0.1.0.4-2)
warning: haskell-publicsuffixlist: local (0.1-7) is newer than haskell-core
(0.1-2)
warning: haskell-securemem: local (0.1.3-3) is newer than haskell-core
(0.1.3-1)
warning: haskell-socks: local (0.5.4-10) is newer than haskell-core
(0.5.4-2)
warning: haskell-x509: local (1.4.11-5) is newer than haskell-core
(1.4.11-2)
warning: haskell-x509-store: local (1.4.4-9) is newer than haskell-core
(1.4.4-2)
warning: haskell-x509-validation: local (1.5.0-9) is newer than
haskell-core (1.5.0-2)
resolving dependencies...
looking for inter-conflicts...
error: failed to prepare transaction (could not satisfy dependencies)
:: haskell-connection: requires haskell-network=2.4.2.2-60
:: haskell-connection: requires haskell-tls=1.2.6-5
:: haskell-connection: requires haskell-x509=1.4.11-5
:: haskell-connection: requires haskell-x509-store=1.4.4-9
:: haskell-connection: requires haskell-x509-validation=1.5.0-9
:: haskell-cookie: requires haskell-blaze-builder=0.3.3.2-59
:: haskell-cookie: requires haskell-text=1.1.1.1-1
:: haskell-cprng-aes: requires haskell-cipher-aes=0.2.7-3
:: haskell-cprng-aes: requires haskell-crypto-random=0.0.7-4
:: haskell-http-client-tls: requires haskell-http-client=0.3.2.1-2
:: haskell-http-client-tls: requires haskell-network=2.4.2.2-60
:: haskell-http-client-tls: requires haskell-tls=1.2.6-5
:: haskell-http-conduit: requires haskell-conduit=1.1.1.1-1
:: haskell-http-conduit: requires haskell-http-client=0.3.2.1-2
:: haskell-http-conduit: requires haskell-http-types=0.8.4-4
:: haskell-http-conduit: requires haskell-lifted-base=0.2.2.1-3
:: haskell-http-conduit: requires haskell-monad-control=0.3.2.3-5
:: haskell-http-conduit: requires haskell-resourcet=1.1.2-1
:: haskell-socks: requires haskell-network=2.4.2.2-60
:: haskell-x509-system: requires haskell-x509=1.4.11-5
:: haskell-x509-system: requires haskell-x509-store=1.4.4-9


I really have no idea what to do with this or what would have caused it.
I'm sure it's some important misunderstanding on my part. Any help would be
greatly appreciated.

-Mike
___
arch-haskell mailing list
arch-haskell@haskell.org
http://www.haskell.org/mailman/listinfo/arch-haskell


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-27 Thread Albert Y. C. Lai

On 11-05-26 12:45 PM, Srinivasan Balram wrote:

(ii) Haskell Enterprise Development i.e. how to connect commercial
RDBMS and use Haskell along with SQL effectively


By the time we finish adding that to a future book, enterprise 
programmers will have already moved to the like of NoSQL and MongoDB.


In fact, by the time I finish writing this message.

The desired book is obsolete before its writing begins.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-27 Thread Rick Richardson
We do have working and officially supported (by 10Gen) Haskell drivers for
MongoDB.

Just sayin'   :)

On Fri, May 27, 2011 at 3:45 PM, Albert Y. C. Lai tre...@vex.net wrote:

 On 11-05-26 12:45 PM, Srinivasan Balram wrote:

 (ii) Haskell Enterprise Development i.e. how to connect commercial
 RDBMS and use Haskell along with SQL effectively


 By the time we finish adding that to a future book, enterprise programmers
 will have already moved to the like of NoSQL and MongoDB.

 In fact, by the time I finish writing this message.

 The desired book is obsolete before its writing begins.


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Srinivasan Balram
folks:

I was advised to post this request here. This is about needs of daily-grind 
enterprise development.

Enterprise developers need 3 categories of books in Haskell urgently:

 (i) Haskell (CookBooks / Recipes)
 (ii) Haskell Enterprise Development i.e. how to connect commercial
 RDBMS and use Haskell along with SQL effectively
 (iii) Haskell Web/Network Development

Books by Don Stewart  Miran Lipovaca are excellent for 
beginner/intermediaries. Erik Meijer's tutorial videos were very useful as 
well. But they are not enough.

This may sound boring, but such books are badly needed today. It's hard to 
convince clients/devs to start projects without such resources.

I am trying to push for Enterprise Haskell projects. Would appreciate pointers 
to resources for doing large scale Haskell development

Thank you

-ram


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 9:45 AM, Srinivasan Balram
srinivasan_bal...@marlabs.com wrote:
 folks:
 I was advised to post this request here. This is about needs of daily-grind
 enterprise development.
 Enterprise developers need 3 categories of books in Haskell urgently:
  (i) Haskell (CookBooks / Recipes)

The HaskellWiki has a bit of this CookBook sort of stuff already.  I
haven't read it so I don't know about the quality, but it should be a
good starting point:
http://haskell.org/haskellwiki/Cookbook

And the wikibooks project has some excellent articles about Haskell as well:
http://en.wikibooks.org/wiki/Haskell

  (ii) Haskell Enterprise Development i.e. how to connect commercial
  RDBMS and use Haskell along with SQL effectively

Database connectivity is a weakspot still.  Haskell developers don't
seem to use databases nearly as often as Java developers.  We have
several libraries for this, takusen and hdbc come to mind.  Real-World
Haskell documents using hdbc.

  (iii) Haskell Web/Network Development

This is very broad.  Checkout yesod and snap if you want to generate
content from a Haskell based http server.

I hope that helps,
Jason

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Clint Moore
  While it's not a solution (yet) for a book, would a section or special
section in the wiki be appropriate at least in the beginning?  Our small
company has been collecting cookbook-like recipies and best practices
for a while now but definitely not anything close to as polished or
collated as a book.


On Thu, May 26, 2011 at 04:45:15PM +, Srinivasan Balram wrote:
 folks:
 
 I was advised to post this request here. This is about needs of daily-grind 
 enterprise development.
 
 Enterprise developers need 3 categories of books in Haskell urgently:
 
  (i) Haskell (CookBooks / Recipes)
  (ii) Haskell Enterprise Development i.e. how to connect commercial
  RDBMS and use Haskell along with SQL effectively
  (iii) Haskell Web/Network Development
 
 Books by Don Stewart  Miran Lipovaca are excellent for 
 beginner/intermediaries. Erik Meijer's tutorial videos were very useful as 
 well. But they are not enough.
 
 This may sound boring, but such books are badly needed today. It's hard to 
 convince clients/devs to start projects without such resources.
 
 I am trying to push for Enterprise Haskell projects. Would appreciate 
 pointers to resources for doing large scale Haskell development
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 11:17 AM, Clint Moore cl...@ivy.io wrote:
  While it's not a solution (yet) for a book, would a section or special
 section in the wiki be appropriate at least in the beginning?  Our small
 company has been collecting cookbook-like recipies and best practices
 for a while now but definitely not anything close to as polished or
 collated as a book.

That's exactly what the cookbook part of the wiki is for, put your
stuff there: http://haskell.org/haskellwiki/Cookbook

Jason

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Clint Moore
On Thu, May 26, 2011 at 10:57:42AM -0700, Jason Dagit wrote:
 Database connectivity is a weakspot still.  Haskell developers don't
 seem to use databases nearly as often as Java developers.  We have
 several libraries for this, takusen and hdbc come to mind.  Real-World
 Haskell documents using hdbc.

  For what it's worth, we've had very good luck with Persistent.  Even
though it's not very enterprisey to base a product on an unseasoned
library, it solved so many problems that we just couldn't ignore it.

  Perhaps we should write something in the wiki that goes beyond the
tutorial in the Yesod book.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Michael Snoyman
On Thu, May 26, 2011 at 7:45 PM, Srinivasan Balram
srinivasan_bal...@marlabs.com wrote:
 folks:
 I was advised to post this request here. This is about needs of daily-grind
 enterprise development.
 Enterprise developers need 3 categories of books in Haskell urgently:
  (i) Haskell (CookBooks / Recipes)
  (ii) Haskell Enterprise Development i.e. how to connect commercial
  RDBMS and use Haskell along with SQL effectively
  (iii) Haskell Web/Network Development
 Books by Don Stewart  Miran Lipovaca are excellent for
 beginner/intermediaries. Erik Meijer's tutorial videos were very useful as
 well. But they are not enough.
 This may sound boring, but such books are badly needed today. It's hard to
 convince clients/devs to start projects without such resources.
 I am trying to push for Enterprise Haskell projects. Would appreciate
 pointers to resources for doing large scale Haskell development
 Thank you
 -ram

The Yesod book[1] is being actively worked on, and covers web
development with the Yesod web framework. Though many of the chapters
there should be applicable to other systems, such as the enumerators
chapter.

Michael

[1] http://www.yesodweb.com/book

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Stephen Tetley
Without support for at least extensible records and better GUI
integration, you'd have a hard time convincing me to use Haskell for
enterprise applications (and I use Haskell every day).

It's not that Haskell isn't a fine language, it's just that doesn't
have sufficient advantage on the state-of-practice that would counter
balance its position as a marginal language. There are good reasons
why enterprise development is conservative, state-of-the-art languages
like Haskell or Erlang excel in domains where they can be disruptive.

Best wishes

Stephen

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond ga...@gaius.org.uk wrote:

 On 26 May 2011, at 19:22, Clint Moore wrote:

 On Thu, May 26, 2011 at 10:57:42AM -0700, Jason Dagit wrote:

 Database connectivity is a weakspot still.  Haskell developers don't
 seem to use databases nearly as often as Java developers.  We have
 several libraries for this, takusen and hdbc come to mind.  Real-World
 Haskell documents using hdbc.

  For what it's worth, we've had very good luck with Persistent.  Even
 though it's not very enterprisey to base a product on an unseasoned
 library, it solved so many problems that we just couldn't ignore it.

  Perhaps we should write something in the wiki that goes beyond the
 tutorial in the Yesod book.



 Over in OCaml-land, I have taken it upon myself to address this:
 http://gaiustech.github.com/ociml/

Takusen already supports Oracle (and other rdbms) in a resource
precise and good performance way, if that's what you're talking about
implementing:
http://projects.haskell.org/takusen/

Jason

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Gaius Hammond


On 26 May 2011, at 21:34, Jason Dagit wrote:

On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond ga...@gaius.org.uk  
wrote:



Over in OCaml-land, I have taken it upon myself to address this:
http://gaiustech.github.com/ociml/


Takusen already supports Oracle (and other rdbms) in a resource
precise and good performance way, if that's what you're talking about
implementing:
http://projects.haskell.org/takusen/




Ah, interesting - I was only aware of HDBC and HSQL. Which in turn  
begs the question, why isn't this better known among (us) Enterprise  
dev types?




Cheers,



G




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 1:43 PM, Gaius Hammond ga...@gaius.org.uk wrote:

 On 26 May 2011, at 21:34, Jason Dagit wrote:

 On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond ga...@gaius.org.uk wrote:


 Over in OCaml-land, I have taken it upon myself to address this:
 http://gaiustech.github.com/ociml/

 Takusen already supports Oracle (and other rdbms) in a resource
 precise and good performance way, if that's what you're talking about
 implementing:
 http://projects.haskell.org/takusen/



 Ah, interesting - I was only aware of HDBC and HSQL. Which in turn begs the
 question, why isn't this better known among (us) Enterprise dev types?

I'm not certain, but I think the biggest problems getting in the way
of Takusen's greater adoption are:
  * It requires a deeper understanding of Haskell than HDBC due to use
of functional dependencies, rank-2 types, and left-fold enumerators.
  * Less documentation than its competitors
  * The name is good (it's the japanese word for oracle), but doesn't
evoke that's clearly a db library in most english speakers.

As the current maintainer (and I've been a really lazy maintainer,
still hoping to find a proper long term maintainer), I'm interested in
any feedback about Takusen.  Things I would like to eventually
implement:
  * HDBC compatibility layer to make it easier to transition from HDBC
to Takusen
  * Replace the left-fold enumerator code with a proper iteratee
library (Takusen is by Oleg but predates his work that generalized the
approach).

Jason

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Help

2011-02-11 Thread Patrick M
I'm
 writting a function that will remove tautologies from a fomula.The 
basic idea is that if in a clause, a literal and its negation are found,
 it means that the clause will be true, regardless of the value finally 
assigned to that propositional variable.My appoach is to create a 
function that will remove this but for a clause and map it to the 
fomula.Of course I have to remove duplicates at the beginning.

    module Algorithm where

    import System.Random
    import Data.Maybe
    import Data.List

    type Atom = String
    type Literal = (Bool,Atom)
    type Clause = [Literal]
    type Formula = [Clause]
    type Model = [(Atom, Bool)]
    type Node = (Formula, ([Atom],
 Model))
    removeTautologies :: Formula - Formula
    removeTautologies = map tC.map head.group.sort
  where rt ((vx, x) : (vy, y) : clauses) | x == y = rt rest
  | otherwise = (vx, x) : rt ((vy, y) : 
clauses)
Now
 I have problems  when I try to give it a formula (for example (A v B v 
-A) ^ (B v C v A)).Considering that example the first clause contains 
the literals A and -A. This means that the clause will always be true, 
in which case it can be simplify the whole set to simply (B v C v A) . 
But I get the following

    Loading package old-locale-1.0.0.2 ... linking ... done.
    Loading
 package time-1.1.4 ... linking ... done.
    Loading package random-1.0.0.2 ... linking ... done.
    [[(True,A),(True,B)*** Exception: Assignment.hs:(165,11)-(166,83): 
Non-exhaustive patterns in function rt

What should I do?


  ___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Help

2011-02-11 Thread PatrickM

I'm writting a function that will remove tautologies from a fomula.The basic
idea is that if in a clause, a literal and its negation are found, it means
that the clause will be true, regardless of the value finally assigned to
that propositional variable.My appoach is to create a function that will
remove this but for a clause and map it to the fomula.Of course I have to
remove duplicates at the beginning.

module Algorithm where

import System.Random
import Data.Maybe
import Data.List

type Atom = String
type Literal = (Bool,Atom)
type Clause = [Literal]
type Formula = [Clause]
type Model = [(Atom, Bool)]
type Node = (Formula, ([Atom], Model))
removeTautologies :: Formula - Formula
removeTautologies = map tC.map head.group.sort
  where rt ((vx, x) : (vy, y) : clauses) | x == y = rt rest
  | otherwise = (vx, x) : rt ((vy,
y) : clauses)
Now I have problems  when I try to give it a formula (for example (A v B v
-A) ^ (B v C v A)).Considering that example the first clause contains the
literals A and -A. This means that the clause will always be true, in which
case it can be simplify the whole set to simply (B v C v A) . But I get the
following

Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package time-1.1.4 ... linking ... done.
Loading package random-1.0.0.2 ... linking ... done.
[[(True,A),(True,B)*** Exception: Assignment.hs:(165,11)-(166,83):
Non-exhaustive patterns in function rt

What should I do?
-- 
View this message in context: 
http://haskell.1045720.n5.nabble.com/Haskell-Help-tp3381647p3381647.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Help

2011-02-11 Thread Daniel Fischer
On Friday 11 February 2011 18:25:24, PatrickM wrote:
 I'm writting a function that will remove tautologies from a fomula.The
 basic idea is that if in a clause, a literal and its negation are found,
 it means that the clause will be true, regardless of the value finally
 assigned to that propositional variable.My appoach is to create a
 function that will remove this but for a clause and map it to the
 fomula.Of course I have to remove duplicates at the beginning.

Tip: write a function

isTautology :: Clause - Bool

for that, the function partition from Data.List might be useful.
Then removeTautologies becomes a simple filter.


 module Algorithm where

 import System.Random
 import Data.Maybe
 import Data.List

 type Atom = String
 type Literal = (Bool,Atom)
 type Clause = [Literal]
 type Formula = [Clause]
 type Model = [(Atom, Bool)]
 type Node = (Formula, ([Atom], Model))
 removeTautologies :: Formula - Formula
 removeTautologies = map tC.map head.group.sort
   where rt ((vx, x) : (vy, y) : clauses) | x == y = rt rest

   | otherwise = (vx, x) : rt
   | ((vy,

 y) : clauses)
 Now I have problems  when I try to give it a formula (for example (A v B
 v -A) ^ (B v C v A)).Considering that example the first clause contains
 the literals A and -A. This means that the clause will always be true,
 in which case it can be simplify the whole set to simply (B v C v A) .
 But I get the following

 Loading package old-locale-1.0.0.2 ... linking ... done.
 Loading package time-1.1.4 ... linking ... done.
 Loading package random-1.0.0.2 ... linking ... done.
 [[(True,A),(True,B)*** Exception:
 Assignment.hs:(165,11)-(166,83): Non-exhaustive patterns in function rt

 What should I do?

You have to treat the cases of lists with zero or one entries in rt.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] Help-me read file

2010-10-18 Thread Gilmara Pompelli
Hello

I have a file with 100 lists, with 100 ints.

I have to read the file and apply the map and sort functions on lists.

II did it to read file:

learquivo :: FilePath - IO ([[Int]])
learquivo s = do
           conteudo - readFile s
           return (read conteudo)

But now applying the sort, the error appears:


interactive:1:5:
   Couldn't match expected type `[a]'
          against inferred type `IO [[Int]]'

how can I fix?

Thanks
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help-me read file

2010-10-18 Thread Henning Thielemann


On Mon, 18 Oct 2010, Gilmara Pompelli wrote:


Hello

I have a file with 100 lists, with 100 ints.

I have to read the file and apply the map and sort functions on lists.

II did it to read file:

learquivo :: FilePath - IO ([[Int]])
learquivo s = do
           conteudo - readFile s
           return (read conteudo)

But now applying the sort, the error appears:


Where do you apply 'sort' ? You mean

  sort learquivo

?

It must be

  fmap sort learquivo

.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help-me read file

2010-10-18 Thread kahl
  I have a file with 100 lists, with 100 ints.
  
  I have to read the file and apply the map and sort functions on lists.
  
  II did it to read file:
  
  learquivo :: FilePath - IO ([[Int]])
  learquivo s = do
             conteudo - readFile s
             return (read conteudo)
  
  But now applying the sort, the error appears:
  
  
  interactive:1:5:
     Couldn't match expected type `[a]'
            against inferred type `IO [[Int]]'
  
  how can I fix?

You did not even say how you produced that error.


Assuming you are in GHCi, you want to do:


m - learquivo miarquivo

:t m


(Think of the interactive GHCi prompt as inside a big ``do''.)



Hope this helps!

Wolfram
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Help with cabal and windows

2009-05-30 Thread newuser21

Hi, I am new to haskell.
I have an programm whitch i want to compile for windows .It has cabal .I
installed haskellplatform for windows, and  runhaskell setup.lhs configure
runs fine.BUT when runhaskell setup.lhs build, then errors:
Could not find module `Data.Generics':
  it is a member of the hidden package `base-3.0.3.1'
  it is a member of the hidden package `syb'
WHY? syb is in the haskellplatform path?? I think it has  something to do
with paths?
Oh and on linux no problems. All worked fine compiles with no error.But the
same happends as I installed haskellplatform under wine and tryied to build
the program.

Thanks newuser 
-- 
View this message in context: 
http://www.nabble.com/Help-with-cabal-and-windows-tp23790447p23790447.html
Sent from the Haskell - Haskell mailing list archive at Nabble.com.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help with cabal and windows

2009-05-30 Thread Duncan Coutts
On Sat, 2009-05-30 at 09:06 -0700, newuser21 wrote:
 Hi, I am new to haskell.

BTW, in future it's better to ask these kinds of questions on the
haskell-cafe mailing list. These days the main haskell mailing list is
mostly for announcements etc.

 I have an programm whitch i want to compile for windows .It has cabal .I
 installed haskellplatform for windows, and  runhaskell setup.lhs configure
 runs fine.BUT when runhaskell setup.lhs build, then errors:
 Could not find module `Data.Generics':
   it is a member of the hidden package `base-3.0.3.1'
   it is a member of the hidden package `syb'
 WHY? syb is in the haskellplatform path?? I think it has  something to do
 with paths?

Quick solution:

Use this command instead:

  cabal configure
  cabal build

Alternatively, edit the package's .cabal file; find the bit that says
something like:

  build-depends: base

change it to say:

  build-depends: base  4
or
  build-depends: base = 4, syb


Here's what is actually going on:

When base 4 was released, the Data.Generics module was moved from being
in the base package to being in a separate package, syb. So that means
that if your package needs Data.Generics then you have a choice, you can
have it depend on base 3, or you can have it depend on base 4 and syb.

However currently the package just says that it needs base and does
not say if it needs version 3 or 4. But it's important to say because if
we just pick base 4 without also picking syb then it will not work. What
it likely going on is that the package you're looking at has not been
modified to take account of the change in base 4.

runhaskell setup.lhs configure always just picks the highest version
available, in this case 4. That's why it fails.

cabal configure uses a slightly smarter algorithm and in this case
will pick base 3 and so it'll work. However it is just making guesses to
make up for the lack of a correct specification in the .cabal file. This
backwards compatibility shim will not work for ever.

The specific error message is sadly a little confusing. It says the
other packages are hidden but that's only because runhaskell setup.lhs
build actually hides all packages other than the ones listed in
the .cabal file.

 Oh and on linux no problems. All worked fine compiles with no error.
 But the same happends as I installed haskellplatform under wine and
 tryied to build the program.

It's not actually a windows-specific problem. Perhaps on Linux you were
using a different version of ghc. It would have worked ok with ghc-6.8
which only comes with base 3. Or if you had used cabal configure then
that uses a smarter way of picking versions and would also have picked
version 3.

Duncan

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Help : data concurrent packages

2009-01-13 Thread bft
Hi !
Can someone tell me where to download the *data* and *concurrent *packages.

I need them to build FranTk1.1 package (
http://www.dcs.gla.ac.uk/~meurig/FranTk/news.html)

Thanks in advance!
BFT

frantk.conf file :
Package
   {name = FranTk,
import_dirs =
[/local/www.people/personal/meurig/haskell/built/frantk/imports],
source_dirs = [],
library_dirs =
[/local/www.people/personal/meurig/haskell/built/frantk],
hs_libraries = [HSFranTk],
extra_libraries = [tcl8.3,tk8.3],
include_dirs = [],
c_includes = [],
*package_deps = [ concurrent, data ],*
extra_ghc_opts = [ -fvia-C, -fallow-overlapping-instances,
-fallow-undecidable-instances ],
extra_cc_opts = [],
extra_ld_opts = [-lncurses]
}
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help : data concurrent packages

2009-01-13 Thread Thorkil Naur
Hello,

On Tuesday 13 January 2009 18:26, bft wrote:
 Hi !
 Can someone tell me where to download the *data* and *concurrent *packages.

I recall data and concurrent packages from some years back, but I would assume 
that they are merged into the base package nowadays where GHC-6.10.1 is the 
latest release of GHC. I suggest that you just remove these package 
dependencies (in case they happen to bother, somehow) and, if any name turns 
out to be undefined, try http://haskell.org/hoogle/ to search for it. 
Packages are usually located via 
http://hackage.haskell.org/packages/hackage.html .

 ...

Best regards
Thorkil
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Help : A problem with IO

2008-11-26 Thread abdullah abdul Khadir
Hi,



getMyLine :: IO [Char]
getMyLine =  do
c - getChar
if(c == '\n')
then return 
elsecs - getMyLine
return [c]
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] help needed to test new GLFW package

2007-12-20 Thread Paul L
With the new Cabal 1.2, it's now possible to make platform dependent
C code compilation. So I've made available new version of GLFW that
follows standard Cabal installation steps, it's at:

  http://www.cs.yale.edu/homes/hl293/download/GLFW-0.2.tar.gz

Note that this is VERY experimental. Help is needed to test the
package on different combinations of GHC + OS platforms.

I've already tested it on Linux (i386 32bit) + GHC 6.8.2/6.6.1,
Windows XP and OS X 10.4 (Intel) + GHC 6.6 (with Cabal 1.2.2). I'll
appreciate feedbacks from GHC 6.8/6.6 on Linux (IA64), Windows Vista,
and OS X 10.5 (intel) or OS X (ppc).

If no major installation problem remains, I'm going to put it up on hackageDB.
Thanks!

-- 
Regards,
Paul Liu

Yale Haskell Group
http://www.haskell.org/yale
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] help with IOArray

2007-08-19 Thread robert bauer
I have an IOArray, but it doesn't work the way I expected it to.

I defined

newMem s = newIOArray (0, size-1) 0

and then

x = newMem 30

then

do {
   y - x
 ; v - readIOArray y 2
 ; print v
 ; writeIOArray y 2 20
 ; v - readIOArray y 2
 ; print v
}

this resulted in 0, 2  as expected.

however, then

do {
 y - x
 ; v - readIOArray y 20
 ; print v
}

results in 0

I thought the IOArray was basically a static structure?

Thanks
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help with IOArray

2007-08-19 Thread Bertram Felgenhauer
robert bauer wrote:
 I have an IOArray, but it doesn't work the way I expected it to.
 
 I defined
 
 newMem s = newIOArray (0, size-1) 0
 
 and then
 
 x = newMem 30
 
 then
 
 do {
y - x
  ; v - readIOArray y 2
  ; print v
  ; writeIOArray y 2 20
  ; v - readIOArray y 2
  ; print v
 }
 
 this resulted in 0, 2  as expected.
 
 however, then
 
 do {
  y - x
  ; v - readIOArray y 20
  ; print v
 }
 
 results in 0
 
 I thought the IOArray was basically a static structure?

yes it is. However, 'x' is not an IOArray. Its type is (after
defaulting)

  x :: IO (IOArray Int Int)

It represents an IO action that constructs a *new* array. do {

so
 do {
  y - x
  ; v - readIOArray y 20
  ; print v
 }

constrcts a new array and finds its 20th element, which was
initialized to 0.

The problem you have is dealing with global variables in Haskell.
There are two major approaches.

a) Construct the variable once and pass it explicitely as an argument to
   all functions. (In other words, don't use global variables at all.)

main = do {
  mem - newMem
  func1 mem
  func2 mem
}

   This is simple, easy to understand, but it doesn't scale well.

   To make it scale better you can define a data type for the
   global state.

data GlobalState = GS { mem :: IOArray Int Int }

   This record can then easily be extended with new fields as they
   come up.

   Finally you can get rid of the explicit 'mem' (or 'state') arguments
   by using a state monad transformer (StateT).

b) Use actual global variables. See

   http://haskell.org/haskellwiki/Top_level_mutable_state

   for further information.

http://haskell.org/haskellwiki/Global_variables  is also interesting.

HTH,

Bertram
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help with IOArray

2007-08-19 Thread Bulat Ziganshin
Hello robert,

Sunday, August 19, 2007, 6:52:59 PM, you wrote:

 I defined
 newMem s = newIOArray (0, size-1) 0
 and then
 x = newMem 30

i recommend you to read http://haskell.org/haskellwiki/IO_inside

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] help -- need a random number

2007-04-26 Thread robert bauer
Hi,

I need some random numbers.  The documentation identifies StdGen, but I can't 
figure out how to invoke it.  The documentation is great
in every way, except an actual example that I can essentially cut and paste.

Thanks

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help -- need a random number

2007-04-26 Thread Johannes Waldmann


I need some random numbers. 


in the IO Monad, hiding the use of a generator

do x - randomRIO (0, 1 :: Double) ; print x

you can also make the state explicit:

do g0 - getStdGen ; let { ( x, g1 ) = randomR ( 0, 1::Double) g0 } ;
   print x

a RandomGen is actually the state object for the generator,
much like  http://java.sun.com/javase/6/docs/api/java/util/Random.html

best regards, J.W.


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help -- need a random number

2007-04-26 Thread Marc A. Ziegert
module Dice where

import System.Random
import System.IO.Unsafe (unsafePerformIO,unsafeInterleaveIO)
import Data.List (unfoldr)

dice4,dice6,dice8,dice10,dice12,dice20,dice666 :: [Int]
dice4 = randomRs (1,4) (read foo::StdGen)
dice6 = randomRs (1,6) (mkStdGen 5)
dice8 = randomRs (1,8) (unsafePerformIO newStdGen)
dice10 = unfoldr (Just . randomR (1,10)) (read 42::StdGen)
dice12 = fmap ((+1).(mod `flip` 12)) $ randoms (read bar::StdGen)
dice20 = [succ $ x `mod` 20|x-unfoldr (Just . random) (mkStdGen 23)]
dice666 = unfoldr (\io_a - Just . unsafePerformIO $ fmap ((,)`flip` io_a) 
io_a) $ randomRIO (1,666)




Am Donnerstag, 26. April 2007 18:58 schrieb robert bauer:
 Hi,
 
 I need some random numbers.  The documentation identifies StdGen, but I can't 
 figure out how to invoke it.  The documentation is great
 in every way, except an actual example that I can essentially cut and paste.
 
 Thanks
 
 ___
 Haskell mailing list
 Haskell@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell
 


pgprpEHe8HeeI.pgp
Description: PGP signature
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help -- need a random number

2007-04-26 Thread Johannes Waldmann



import System.IO.Unsafe (unsafePerformIO,unsafeInterleaveIO)


Whoa! I'd be very cautious recommending these for newbies ...
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help -- need a random number

2007-04-26 Thread Marc A. Ziegert
that is exact the way, how i had learned about the state monads like IO and 
Maybe.
that was even before i understood the [] monad, folding and using Random; i 
don't remember when that was... ghc-5.xx age.

in my opinion, unsafePerformIO is a good learning tool, as soon as you use it 
tricky to analyze and discover new worlds you have never been before.
like this:

blah = unsafePerformIO $ do
putStrLn I'm here: blah!
return blub

this way, it may be even more important than undefined:

undef s = unsafePerformIO $ do
putStrLn whops, this shouldn't happen
putStrLn s
return undefined


well, this is my unpure way of learning to think in new languages.
i used ways like this in c++ to analyze OOP and to discover the world before 
and after int main().

greetings
- marc

Am Donnerstag, 26. April 2007 20:15 schrieb Johannes Waldmann:
 
  import System.IO.Unsafe (unsafePerformIO,unsafeInterleaveIO)
 
 Whoa! I'd be very cautious recommending these for newbies ...
 ___
 Haskell mailing list
 Haskell@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell
 


pgplUz9AtQiK4.pgp
Description: PGP signature
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: BUG in HAskell! Help! Bad interface file: IO.hi

2006-12-15 Thread Lemmih

On 12/9/06, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

   ___ ___ _
   / _ \ /\  /\/ __(_)
  / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.

interactive:1:84:
 Bad interface file: IO.hi
 IO.hi: openBinaryFile: does not exist (No such file or directory)
ghc-6.6: panic! (the 'impossible' happened)
   (GHC version 6.6 for i386-unknown-solaris2):
 interactiveUI:flush

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

z03-uname -a
SunOS z03 5.10 Generic_118855-19 i86pc i386 i86pc
z03-cat/etc/motd
bash: cat/etc/motd: No such file or directory
z03-gcc -v
Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: ../gcc-4.0.3/configure --prefix=/usr/local/lang
-program-suffix=_4.0.3 --enable-64bit --with-gnu-as
--with-as=/usr/local/bin/gnu-as --with-ld=/usr/ccs/bin/ld
--enable-version-specific-runtime-libs --enable-languages=c :
(reconfigured) ../gcc-4.0.3/configure --prefix=/usr/local/lang
-program-suffix=_4.0.3 --enable-64bit --with-gnu-as
--with-as=/usr/local/bin/gnu-as --with-ld=/usr/ccs/bin/ld
--enable-version-specific-runtime-libs --enable-languages=c,c++
Thread model: posix
gcc version 4.0.3


How did you install GHC?

--
Cheers,
 Lemmih
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


BUG in HAskell! Help! Bad interface file: IO.hi

2006-12-12 Thread fidan

  ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.

interactive:1:84:
Bad interface file: IO.hi
IO.hi: openBinaryFile: does not exist (No such file or directory)
ghc-6.6: panic! (the 'impossible' happened)
  (GHC version 6.6 for i386-unknown-solaris2):
interactiveUI:flush

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

z03-uname -a
SunOS z03 5.10 Generic_118855-19 i86pc i386 i86pc
z03-cat/etc/motd
bash: cat/etc/motd: No such file or directory
z03-gcc -v
Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: ../gcc-4.0.3/configure --prefix=/usr/local/lang  
-program-suffix=_4.0.3 --enable-64bit --with-gnu-as  
--with-as=/usr/local/bin/gnu-as --with-ld=/usr/ccs/bin/ld  
--enable-version-specific-runtime-libs --enable-languages=c :  
(reconfigured) ../gcc-4.0.3/configure --prefix=/usr/local/lang  
-program-suffix=_4.0.3 --enable-64bit --with-gnu-as  
--with-as=/usr/local/bin/gnu-as --with-ld=/usr/ccs/bin/ld  
--enable-version-specific-runtime-libs --enable-languages=c,c++

Thread model: posix
gcc version 4.0.3


___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: BUG in HAskell! Help! Bad interface file: IO.hi

2006-12-12 Thread Christian Maeder
How did you call ghci? Maybe some *.hi files build on another platform
were lying around.

Cheers Christian

Loading IO works for me (on the same machine):

Loading package base ... linking ... done.
Prelude :m IO
Prelude IO

[EMAIL PROTECTED] schrieb:
   ___ ___ _
   / _ \ /\  /\/ __(_)
  / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for Haskell 98.
 / /_\\/ __  / /___| |  http://www.haskell.org/ghc/
 \/\/ /_/\/|_|  Type :? for help.
 
 Loading package base ... linking ... done.
 
 interactive:1:84:
 Bad interface file: IO.hi
 IO.hi: openBinaryFile: does not exist (No such file or directory)
 ghc-6.6: panic! (the 'impossible' happened)
   (GHC version 6.6 for i386-unknown-solaris2):
 interactiveUI:flush
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-04 Thread Bjorn Bringert

On 2 dec 2006, at 22.13, Cat Dancer wrote:


I'd like to write a server accepting incoming network connections that
can be gracefully shutdown.

When the server is asked to shutdown, it should stop accepting new
connections, finish processing any current connections, and then
terminate.

Clients can retry if they attempt to make a connection and the
connection is refused.  This allows the server to restart seamlessly:
any existing connections are not interrupted, and clients will see at
most a pause while the server restarts.

I am using the model from Simon Marlow's Haskell Web Server (as
updated by Björn Bringert and available at
http://www.cs.chalmers.se/~bringert/darcs/hws/): spawning a
lightweight Haskell child thread for each client connection.
...


I'd just like to add that the main repository for the conservatively  
updated HWS is http://darcs.haskell.org/hws/


There is also a more aggressively updated version at http:// 
www.cs.chalmers.se/~bringert/darcs/hws-cgi/
It supports CGI programs, has a module system for extensibility (no  
dynamic module loading though), more flexible logging, support for  
listening on multiple sockets, and many other changes.


Contributions to either of these are very welcome.

/Björn___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-03 Thread Chris Kuklewicz
Cat Dancer wrote:
  I'd certainly be most happy not to use asynchronous exceptions as the
  signalling mechanism, but how would you break out of the accept,
  except by receiving an asynchronous exception?

 Short Version: You trigger a graceful exit using a TVar...
 ...and then you use killThread to break out of accept.
 
 Oh, OK, you're still using an asynchronous exception to break out of
 the accept (killThread throws a ThreadKilled asynchronous exception to
 the thread), but you're using STM to *signal* the graceful exit
 instead of using the asynchronous exception as the signalling
 mechanism.  Nice.
 
 Thanks.  My ghc 6.6 (needed for newTVarIO) installation is broken for
 some reason, so I'll need to fix that tomorrow and then I'll be able
 to try your code.

Since newTVarIO is not in unsafePerformIO, you can replace it with
atomically (newTVar)

 
  (mv,tid) - fork (forever (accept socket = syncTMVar chan))
 
 It looks like to me you could get a connection from accept but then
 get a ThreadKilled exception before the syncTMVar chan executes, and
 then the connection would be left open and hanging until it was
 eventually garbage collected?

Sigh.  I missed that one.  Not bad to fix, just use block and
split syncTMVar, putting the unblocked empty check before the accept.
I also switched to using cond, a kind of flipped if.  The new code:

cond true false test = if test then true else false

acceptUntil socket receiver childrenList checker = do
  chan - newEmptyTMVarIO
  (mv,tid) - fork . block . forever $ do
unblock . atomically $
  isEmptyTMVar chan = cond (return ()) retry
client - accept socket
atomically (putTMVar chan client)
  let loop = do
result - atomically (fmap Left checker `orElse` fmap Right (takeTMVar 
chan))
case result of
  Left _ - return ()
  Right client - spawn client  loop
  spawn client@(handle,_,_) = do
cInfo - fork (finally (receiver client) (hClose handle))
modifyMVar_ childrenList (return . (cInfo:))
  end = do
killThread tid
readMVar mv
maybeClient - atomically (tryTakeTMVar chan)
maybe (return ()) spawn maybeClient
  finally (handle (\e - throwTo tid e  throw e) loop) end

The new code makes sure chan is empty, and so we are sure the putTMVar chan 
will never
have to wait so it will never unblock (I just wrote and ran short test to 
confirm this).
I think this is fixed now.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-03 Thread Chris Kuklewicz
I realized there is another problem, since my code holds onto the ThreadId's 
the thread
data structures may or may not be getting garbage collected and for a long 
running
server the list of children grows without bound.

So I changed it to periodically clean out the finished child threads from the 
list
of children.  A simple counter IORef is used to avoid doing the cleanup on each
new child.

There are also a couple of other small style changes.

 {-
 
 The main accepting thread spawns this a slave thread to run accept and
 stuffs the result into a TMVar.  The main loop then atomically checks
 the TVar used for graceful shutdown and the TMVar.  These two checks
 are combined by `orElse` which gives the semantics one wants: on each
 loop either the TVar has been set to True or the the slave thread has
 accepted a client into the TMVar.
 
 There is still the possibility that a busy server could accept a
 connection from the last client and put it in the TMVar where the main
 loop will miss it when it exits.  This is handled by the finally
 action which waits for the slave thread to be well and truly dead and
 then looks for that last client in the TMVar.
 
 The list of child threads is cleaned periodically (currently every
 10th child), which allows the garbage collected to remove the dead
 threads' structures.
 
 -}
 
 -- Example using STM and orElse to compose a solution
 import Control.Monad
 import Control.Concurrent
 import Control.Exception
 import Control.Concurrent.STM
 import Data.IORef
 import Network
 import System.IO
 
 forever x = x  forever x
 
 runExampleFor socket seconds = do
   tv - newTVarIO False   -- Set to True to indicate graceful exit 
 requested
   sInfo - startServer socket tv
   threadDelay (1000*1000*seconds)
   shutdownServer tv sInfo
 
 startServer socket tv = do
   childrenList - newMVar []
   tInfo - fork (acceptUntil socket exampleReceiver childrenList 
 (retry'until'true tv))
   return (tInfo,childrenList)
 
 shutdownServer tv ((acceptLoopDone,_),childrenList) = do
   atomically (writeTVar tv True)
   readMVar acceptLoopDone
   withMVar childrenList (mapM_ (readMVar . fst))
 
 -- Capture idiom of notifying a new MVar when a thread is finished
 fork todo = do
   doneMVar - newEmptyMVar
   tid - forkIO $ finally todo (putMVar doneMVar ())
   return (doneMVar,tid)
 
 cond true false test = if test then true else false
 
 -- This is an asychronous exception safe way to use accept to get one
 -- client at a time and pass them to the parent thread via a TMVar.
 acceptInto socket chan =  block . forever $ do
   unblock . atomically $
 isEmptyTMVar chan = cond (return ()) retry
   client - accept socket
   atomically (putTMVar chan client)
 
 -- This demonstrates how to use acceptInto to spawn client thread
 -- running receiver.  It ends when checker commits instead of using
 -- retry.
 acceptUntil socket receiver childrenList checker = do
   counter - newIORef (0::Int) -- who cares if it rolls over?
   chan - atomically (newEmptyTMVar)
   (mv,tid) - fork (acceptInto socket chan)
   let loop = atomically (fmap Left checker `orElse` fmap Right (takeTMVar 
 chan))
  = either (const (return ()))(\client - spawn client  
 loop)
   spawn client@(handle,_,_) = do
 cInfo - fork (finally (receiver client) (hClose handle))
 count - readIORef counter
 writeIORef counter $! (succ count)
 modifyMVar_ childrenList $ \kids - fmap (cInfo:) $
   if count `mod` 10 == 0  -- 10 is arbitrary frequency for cleaning 
 list
 then return kids
 else filterM (isEmptyMVar . fst) kids
   end = do
 killThread tid
 readMVar mv
 atomically (tryTakeTMVar chan) = maybe (return ()) spawn
   finally (handle (\e - throwTo tid e  throw e) loop) end
 
 exampleReceiver (handle,_,_) = do
   hPutStrLn handle Hello.
   hPutStrLn handle Goodbye.
 
 retry'until'true tv = (readTVar tv = cond (return ()) retry)

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Help needed interrupting accepting a network connection

2006-12-02 Thread Cat Dancer

I'd like to write a server accepting incoming network connections that
can be gracefully shutdown.

When the server is asked to shutdown, it should stop accepting new
connections, finish processing any current connections, and then
terminate.

Clients can retry if they attempt to make a connection and the
connection is refused.  This allows the server to restart seamlessly:
any existing connections are not interrupted, and clients will see at
most a pause while the server restarts.

I am using the model from Simon Marlow's Haskell Web Server (as
updated by Björn Bringert and available at
http://www.cs.chalmers.se/~bringert/darcs/hws/): spawning a
lightweight Haskell child thread for each client connection.

In Control.Exception, I see that operations such as accept are
interruptible by exceptions thrown to the thread, so I can interrupt
an accept with a dynamic exception.


-- create a datatype to use to interrupt the accept
data ExitGracefully = ExitGracefully deriving Typeable


I want to control when I'm paying attention to the ExitGracefully
exception.  I don't want to get the exception when I'm in the middle
of updating a data structure, just in a few controlled points such as
when I'm in an accept.  Reading further in Control.Exception, I see
that I can use block to put off receiving the exception generally,
but accept is an interruptible operation so I don't need to do
anything more to get the exception inside of the accept.


block (
 ...
 result - catchDyn
 (do (clientSocket, addr) - accept sock
 return $ Just clientSocket)
 (\ (e :: ExitGracefully) - return Nothing)


Typing the exception e as an ExitGracefully tells catchDyn that I
only need to catch exceptions of that type.  If the thread has been
thrown a ExitGracefully, result will be Nothing, but if accept
returned with a client connection, result will be Just the
clientSocket.


 case result of

   Nothing - do { putStrLn accept loop exiting;
   putMVar acceptLoopDone ()
 }

   Just clientSocket -


So far so good.

I also want to keep track of when the threads spawned to handle the
client connections are finished, so I use the code from the
Terminating the program section of the Control.Concurrent
documentation to keep a list of MVar's indicating when the child
threads are done:


childDone - newEmptyMVar
childDoneList - takeMVar childrenDone
putMVar childrenDone (childDone : childDoneList)


then I fork a child thread to handle the connection:


clientHandle - socketToHandle clientSocket ReadWriteMode
forkIO $ handleConnection childDone clientHandle


handleConnection runs inside the child thread, communicating with
the client.  When done, it closes the clientHandle, and does an
putMVar childDone () to say that it done.

Except that, whoops, the takeMVar in the accept thread code which updates the
childrenDone MVar is also interruptible.  So now I'm getting an
interruption right where I don't want it, when I'm updating my data
structure.

Only the accept thread is thrown the ExitGracefully exception, so one
thought I had was that I could move those three lines which update the
childrenDone MVar into the child thread.  But this introduces a race
condition: as the server was shutting down, it could look at the
childrenDone list and see that it was empty, before the child thread
had a chance to start running and update the data structure to say
that there was another child that needed to be waited for.

Or, updating the childrenDone MVar could be done in its own thread,
which again would protect it from the ExitGracefully exception...
except that how would the accept thread wait for that thread... except
by using an MVar?  Oops, again.

Any ideas?

For reference sake here's the complete implementation.  (This code is
in the public domain... in case it would be useful to anyone else).

Thank you,

Cat



-- A ConnectionHandler is a function which handles an incoming
-- client connection.  The handler is run in its own thread, and is
-- passed a handle to the client socket.  The handler does whatever
-- communication it wants to do with the client, and when it returns,
-- the client socket handle is closed and the thread terminates.
-- A list of active handlers is kept, and the client connection is
-- also marked as finished when the handler returns.

type ConnectionHandler = Handle - IO ()


example_connection_handler :: ConnectionHandler

example_connection_handler handle = do
  hPutStrLn handle Hello.
  hPutStrLn handle Goodbye.


type ChildrenDone = MVar [MVar ()]

data ExitGracefully = ExitGracefully deriving Typeable


waitForChildren :: ChildrenDone - IO ()

waitForChildren childrenDone = do
  cs - takeMVar childrenDone
  case cs of
[]   - return ()
m:ms - do
  putMVar childrenDone ms
  takeMVar m
  waitForChildren childrenDone


shutdownServer :: MVar () - ChildrenDone - ThreadId 

Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-02 Thread Chris Kuklewicz
Hi, I have taken a crack at this.  The best thing would be not to use the
asynchronous exceptions to signal the thread that calls accept.  And use STM
more, since the exception semantics are much easier to get right.

But a few minor changes gets closer to what you want.  First, the main problem
you claim to run into is

 Except that, whoops, the takeMVar in the accept thread code which updates 
 the
 childrenDone MVar is also interruptible.  So now I'm getting an
 interruption right where I don't want it, when I'm updating my data
 structure. 

Short version: There is no problem because it will not become interruptible.
Long version:  The takeMVar unblocks exceptions only if it must
stop and wait for the MVar.  The MVar is only taken by this command/thread and
during graceful shutdown after this thread is dead.  So this MVar should never
be in contention (and in theory does not *need* to be a locked MVar, and an
IORef would do).  See http://citeseer.ist.psu.edu/415348.html for why I think
takeMVar only allow exceptions if the MVar is unavailable.

The biggest change is ensuring the accepting thread puts to acceptLoopDone by
using finally.  Many things might kill that thread; it is best to ensure it lets
the main thread know that it is dead.

More subtlety, I added unblock (return ()) before accept.  This makes it look
for the asynchronous exception even when an incoming connection would be
immediately available. Otherwise a busy server would never notice the exception!

As a style point: there is an ugly moment between takeMVar and putMVar in which
you state is  inconsistent (being inside block makes it safe though).  So I
changed this to modifyMVar_ which is better practice.

 import Control.Concurrent
 import Control.Concurrent.MVar
 import Control.Exception as Exception
 import Network.Socket
 import Data.Typeable
 import System.IO

 -- A ConnectionHandler is a function which handles an incoming
 -- client connection.  The handler is run in its own thread, and is
 -- passed a handle to the client socket.  The handler does whatever
 -- communication it wants to do with the client, and when it returns,
 -- the client socket handle is closed and the thread terminates.
 -- A list of active handlers is kept, and the client connection is
 -- also marked as finished when the handler returns.

 type ConnectionHandler = Handle - IO ()

 example_connection_handler :: ConnectionHandler

 example_connection_handler handle = do
   hPutStrLn handle Hello.
   hPutStrLn handle Goodbye.


 type ChildrenDone = MVar [MVar ()]

 data ExitGracefully = ExitGracefully deriving Typeable


 waitForChildren :: ChildrenDone - IO ()

 waitForChildren childrenDone = do
   cs - takeMVar childrenDone
   mapM_ takeMVar cs

 shutdownServer :: MVar () - ChildrenDone - ThreadId - IO ()

 shutdownServer acceptLoopDone childrenDone acceptThreadId = do
   throwDynTo acceptThreadId ExitGracefully
   takeMVar acceptLoopDone
   -- There can be no more changes to childrenDone
   waitForChildren childrenDone
   return ()

 acceptConnections :: MVar () - ChildrenDone - ConnectionHandler - Socket 
 - IO ()

 acceptConnections acceptLoopDone childrenDone connectionHandler sock =
   finially (acceptConnections' acceptLoopDone childrenDone connectionHandler 
 sock)
(putStrLn accept loop exiting  putMVar acceptLoopDone () ) -- 
 run last

 -- This only looks for exceptions when accept sock is executed
 acceptConnections' acceptLoopDone childrenDone connectionHandler sock = block 
 loop
   where loop = do
   unblock (return ()) -- safe point to be interrupted, so unblock
   (clientSocket, addr) - accept sock  -- may or may not unblock and 
 wait
   clientHandle - socketToHandle clientSocket ReadWriteMode
   childDone - newEmptyMVar
   forkIO $ handleConnection childDone connectionHandler clientHandle
   modifyMVar_ childrenDone (return . (childDone:))  -- non-blocking 
 atomic change to MVar
   loop

 handleConnection childDone connectionHandler clientHandle = do
   Exception.catch
 (finially (connectionHandler clientHandle)
   (hClose clientHandle  putMVar childDone () )

 -- TODO we'll want to do something better when
 -- connectionHandler throws an exception, but
 -- for now we'll at least display the exception.
 (\e - do { putStrLn $ show e; return () })

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-02 Thread Cat Dancer

On 12/2/06, Chris Kuklewicz [EMAIL PROTECTED] wrote:

Hi, I have taken a crack at this.  The best thing would be not to use the
asynchronous exceptions to signal the thread that calls accept.


I'd certainly be most happy not to use asynchronous exceptions as the
signalling mechanism, but how would you break out of the accept,
except by receiving an asynchronous exception?


But a few minor changes gets closer to what you want.  First, the main problem
you claim to run into is

 Except that, whoops, the takeMVar in the accept thread code which updates 
the
 childrenDone MVar is also interruptible.  So now I'm getting an
 interruption right where I don't want it, when I'm updating my data
 structure.

Short version: There is no problem because it will not become interruptible.
Long version:  The takeMVar unblocks exceptions only if it must
stop and wait for the MVar.  The MVar is only taken by this command/thread and
during graceful shutdown after this thread is dead.  So this MVar should never
be in contention (and in theory does not *need* to be a locked MVar, and an
IORef would do).


Gosh, I think you're right.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help needed interrupting accepting a network connection

2006-12-02 Thread Chris Kuklewicz
Cat Dancer wrote:
 On 12/2/06, Chris Kuklewicz [EMAIL PROTECTED] wrote:
 Hi, I have taken a crack at this.  The best thing would be not to use the
 asynchronous exceptions to signal the thread that calls accept.
 
 I'd certainly be most happy not to use asynchronous exceptions as the
 signalling mechanism, but how would you break out of the accept,
 except by receiving an asynchronous exception?
 

Short Version: You trigger a graceful exit using a TVar...
...and then you use killThread to break out of accept.

Long Version:

{-

The main accepting thread spawns this a slave thread to run accept and
stuffs the result into a TMVar.  The main loop then atomically checks
the TVar used for graceful shutdown and the TMVar.  These two checks
are combined by `orElse` which gives the semantics one wants: on each
loop either the TVar has been set to True or the the slave thread has
accepted a client into the TMVar.

There is still the possibility that a busy server could accept a
connection from the last client and put it in the TMVar where the main
loop will miss it when it exits.  This is handled by the finally
action which waits for the slave thread to be well and truly dead and
then looks for that last client in the TMVar.

No uses of block or unblock are required.

-}

-- Example using STM and orElse to compose a solution
import Control.Concurrent
import Control.Exception
import Control.Concurrent.STM
import Network
import System.IO

runExampleFor socket seconds = do
  tv - newTVarIO False   -- Set to True to indicate graceful exit 
requested
  sInfo - startServer socket tv
  threadDelay (1000*1000*seconds)
  shutdownServer tv sInfo

startServer socket tv = do
  childrenList - newMVar []
  tInfo - fork (acceptUntil socket exampleReceiver childrenList 
(retry'until'true tv))
  return (tInfo,childrenList)

-- Capture idiom of notifying a new MVar when a thread is finished
fork todo = do
  doneMVar - newEmptyMVar
  tid - forkIO $ finally todo (putMVar doneMVar ())
  return (doneMVar,tid)

acceptUntil socket receiver childrenList checker = do
  chan - newEmptyTMVarIO
  (mv,tid) - fork (forever (accept socket = syncTMVar chan))
  let loop = do
result - atomically (fmap Left checker `orElse` fmap Right (takeTMVar 
chan))
case result of
  Left _ - return ()
  Right client - spawn client  loop
  spawn client@(handle,_,_) = do
cInfo - fork (finally (receiver client) (hClose handle))
modifyMVar_ childrenList (return . (cInfo:))
  end = do
killThread tid
takeMVar mv
maybeClient - atomically (tryTakeTMVar chan)
maybe (return ()) spawn maybeClient
  finally (handle (\e - throwTo tid e  throw e) loop) end

forever x = x  forever x

-- Pass item to another thread and wait for pickup
syncTMVar tmv item = do
  atomically (putTMVar tmv item)
  atomically (do empty - isEmptyTMVar tmv
 if empty then return () else retry)

retry'until'true tv = do
  val - readTVar tv
  if val then return ()
 else retry

exampleReceiver (handle,_,_) = do
  hPutStrLn handle Hello.
  hPutStrLn handle Goodbye.

shutdownServer tv ((acceptLoopDone,_),childrenList) = do
  atomically (writeTVar tv True)
  readMVar acceptLoopDone
  withMVar childrenList (mapM_ (readMVar . fst))
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] help with happy/alex

2006-11-22 Thread robert bauer
Hi,

I have a .y and .x file.  The alex -g _.x gives me a .hs file and happy -g -a 
-c _.y gives me a .hs file.
I then use ghc -c alex.hs to get a a .o and a .hi file.  This works great.
Unfortunately
ghc -c happy.y doesn't work -- it says that it the module name for the lexer 
doesn't match.  I've attached the
.y and .x files.

Also,  I cannot figure out what I need to do in the parser to call the lexer 
and I don't know how to kick start the
parser -- I have no clue what to put in third, main.hs, module.

Any help would be appreciated.



TVScriptParser.y
Description: Binary data


TVScriptLexer.x
Description: Binary data
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] Re: MUA written in Haskell, and MTA in Haskell help?

2006-03-08 Thread Shae Matijs Erisson
Nils Anders Danielsson [EMAIL PROTECTED] writes:

 I had the same thought yesterday, after an Emacs-Lisp session in which
 I was trying to get Gnus to do exactly what I wanted it to...

Yeah, same here. I use Gnus and it's nice, but occasionally I want to erase it
from the timestream.

 Out of curiosity, how much work would it take to write an easily
 configurable, decent MUA in Haskell? I don't know too much about MUAs,
 but I have a feeling that we already have quite a few libraries that
 are needed for the job: UIs (including HTML rendering...), plugins,
 various protocols, encryption...

It wouldn't be too hard. I'd suggest you start with Tuomo Valkonen's Riot[1]
and go for something like mutt.
I'm sure you could steal lots of useful code from Peter Simons' Postmaster[2].

Speaking of which, I've tried to use Postmaster for my own personal domain,
ScannedInAvian.com, but I've had various difficulties. Is anyone else using it
for their domain? I'd like to find anti-spam features that match those of
postfix, like greylisting, dns name checks, etc.

[1] http://modeemi.fi/~tuomov/riot/
[2] http://postmaster.cryp.to/
-- 
I've tried to teach people autodidactism,| ScannedInAvian.com
but it seems they always have to learn it for themselves.| Shae Matijs Erisson

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: MUA written in Haskell, and MTA in Haskell help?

2006-03-08 Thread Donald Bruce Stewart
shae:
 Nils Anders Danielsson [EMAIL PROTECTED] writes:
 
  I had the same thought yesterday, after an Emacs-Lisp session in which
  I was trying to get Gnus to do exactly what I wanted it to...
 
 Yeah, same here. I use Gnus and it's nice, but occasionally I want to erase it
 from the timestream.
 
  Out of curiosity, how much work would it take to write an easily
  configurable, decent MUA in Haskell? I don't know too much about MUAs,
  but I have a feeling that we already have quite a few libraries that
  are needed for the job: UIs (including HTML rendering...), plugins,
  various protocols, encryption...
 
 It wouldn't be too hard. I'd suggest you start with Tuomo Valkonen's Riot[1]
 and go for something like mutt.
 I'm sure you could steal lots of useful code from Peter Simons' Postmaster[2].

Interestingly -- some may not know this -- I originally wrote hs-plugins
to provide Haskell configuration and extension to a planned mutt-like
MUA in Haskell :)

If I was actually going to write one now, I'd start with hmp3 for the
fast, portable curses ui and keystroke handling, and steal the mbox
parsing code from riot. You'd have something working in a day or two,
I'd reckon -- all the code is out there, it just needs to be assembled.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Matthew Walton
pablo daniel rey wrote:
hello
i'm new to haskell so i'm sorry if this is a stupid question, but i'm having 
problems with some basic code.
the code :
data Maybe Dir = Just Dir | Nothing
data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB
flow = [(Horizontal, Left, Left),
 (Horizontal, Right, Right),
 (Vertical, Down, Down),
 (Vertical, Up, Up),  etc ]
fst :: (a,b,c) - a
fst (x,y,z) = x
scnd :: (a,b,c) - b
scnd (x,y,z) = y
third :: (a,b,c) - c
third (x,y,z) = z
element :: [(Piece, Dir, Dir)] - Maybe Dir
element [] = Nothing
element xs = Just (third (head xs))
chgDir :: Piece - Dir - Maybe Dir
chgDir p d = element (filter (\x - p == (fst x)) (filter (\x - d == (scnd x)) 
flow))
the error i get :
Instances of (Eq Dir, Eq Piece) required for definition of chgDir
Because you're using the function (==) to compare two things of type 
Piece, Haskell needs to know how to compare them. This information isn't 
provided by your type definitions.

(==) works on types which are members of the Eq typeclass. You can 
define this instance manually, or, since your type is nice and simple, 
you can get Haskell to derive it for you.

data Piece = Vertical | Horizontal | CodeA | CodeB
 deriving Eq
similarly
data Dir = Left | Right | Up | Down
   deriving Eq
this should sort that problem out.
Incidentally, you don't need to define 'Maybe Dir'. The Maybe type is 
built in as 'Maybe a', where 'a' is a parameter which can be any type 
(such as Dir). Your functions should work unchanged if you take out your 
definition of 'Maybe Dir'.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Malcolm Wallace
Matthew Walton [EMAIL PROTECTED] writes:

 (==) works on types which are members of the Eq typeclass. You can 
 define this instance manually, or, since your type is nice and simple, 
 ^^
 you can get Haskell to derive it for you.

Just a comment, since a couple of people have made similar statements.
Haskell will derive Eq for arbitrarily complex types - there is no
restriction to simple types, whatever they might be.  It will
always give you the obvious structural equality.  There /are/
occasions when structural equality is not quite what you want, but
that decision is entirely orthogonal to whether the type definition
is simple or complex.

Regards,
Malcolm
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] help with some basic code that doesn't work

2005-02-08 Thread Karl Hasselström
On 2005-02-07 20:36:55 +, pablo daniel rey wrote:

 data Dir = Left | Right | Up | Down
 data Piece = Vertical | Horizontal | CodeA | CodeB

 the error i get :

 Instances of (Eq Dir, Eq Piece) required for definition of chgDir

You try to compare Dir and Piece values without having told Haskell
how the comparison should work. Haskell doesn't provide a default
comparison funcition even for the really obvious cases like this,
unless you tell it to using the deriving keyword:

data Bool = False | True deriving (Eq,Ord,Show,Read)

In your case, all you need is Eq, so you can skip the parentheses.

-- 
Karl Hasselström, [EMAIL PROTECTED]
  www.treskal.com/kalle
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] help with some basic code that doesn't work

2005-02-07 Thread pablo daniel rey
hello
i'm new to haskell so i'm sorry if this is a stupid question, but i'm having 
problems with some basic code.
the code :

data Maybe Dir = Just Dir | Nothing
data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB

flow = [(Horizontal, Left, Left),
     (Horizontal, Right, Right),
     (Vertical, Down, Down),
     (Vertical, Up, Up),  etc ]


fst :: (a,b,c) - a
fst (x,y,z) = x

scnd :: (a,b,c) - b
scnd (x,y,z) = y

third :: (a,b,c) - c
third (x,y,z) = z

element :: [(Piece, Dir, Dir)] - Maybe Dir
element [] = Nothing
element xs = Just (third (head xs))

chgDir :: Piece - Dir - Maybe Dir
chgDir p d = element (filter (\x - p == (fst x)) (filter (\x - d == (scnd x)) 
flow))


the error i get :

Instances of (Eq Dir, Eq Piece) required for definition of chgDir

i don't know what's happening.
help!!!
thanks in advance
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] Re: [Haskell] help with some basic code that doesn't work

2005-02-07 Thread Cale Gibbard
Delete

data Maybe Dir = Just Dir | Nothing

as it is unnecessary Maybe a is defined already for any type a
(and doesn't make sense, Dir occuring before the = sign would indicate
that it is a type variable, but it is uppercase), and also change

data Dir = Left | Right | Up | Down
data Piece = Vertical | Horizontal | CodeA | CodeB

to

data Dir = Left | Right | Up | Down deriving Eq
data Piece = Vertical | Horizontal | CodeA | CodeB deriving Eq

Equality isn't defined by default on user-defined datatypes, so that
you can add your own definition. In this case your type is pretty
simple, so you can use the derived instance of Eq, so that (==) and
(/=) get defined for Dir and Piece.

You should also add the line
import Prelude hiding (Left, Right)
as these are the names of the data constructors for the Either type,
and you will get ambiguity errors if you don't rename them or hide the
ones in the Prelude.

Lastly, you should probably rename your 'fst' to 'frst' or some such,
so that it doesn't overlap with the Prelude function of the same name.

hope this helps,
 - Cale


On Mon, 7 Feb 2005 20:36:55 +, pablo daniel rey
[EMAIL PROTECTED] wrote:
 hello
 i'm new to haskell so i'm sorry if this is a stupid question, but i'm having 
 problems with some basic code.
 the code :

 data Maybe Dir = Just Dir | Nothing
 data Dir = Left | Right | Up | Down
 data Piece = Vertical | Horizontal | CodeA | CodeB

 flow = [(Horizontal, Left, Left),
  (Horizontal, Right, Right),
  (Vertical, Down, Down),
  (Vertical, Up, Up),  etc ]

 fst :: (a,b,c) - a
 fst (x,y,z) = x

 scnd :: (a,b,c) - b
 scnd (x,y,z) = y

 third :: (a,b,c) - c
 third (x,y,z) = z

 element :: [(Piece, Dir, Dir)] - Maybe Dir
 element [] = Nothing
 element xs = Just (third (head xs))

 chgDir :: Piece - Dir - Maybe Dir
 chgDir p d = element (filter (\x - p == (fst x)) (filter (\x - d == (scnd 
 x)) flow))

 the error i get :

 Instances of (Eq Dir, Eq Piece) required for definition of chgDir

 i don't know what's happening.
 help!!!
 thanks in advance
 ___
 Haskell mailing list
 Haskell@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] Help on Arrows

2005-01-15 Thread Georg Martius
Hi folks,
I would like to use Arrows, but I just can't figure out how to actually use 
them.
I looked at various documentations including the API doc [1], the Wiki [2], 
[3], and some random pages on the net but didn't find a single simple example 
that tells me how to apply an Arrow to a value.
Assume I have the extremly simple arrow such as:
MyAdd1A :: (Arrow a, Num b) = a b b
MyAdd1A = arr (\ x - x + 1 )
I am probably totally wrong, buy I look for something like evaluateArrow with the type:
evaluateArrow :: (Arrow a) = a b c - b - c
to use it like:
main = do let x = evaluateArrow $ MyAdd1A 1
  print x
Please enlighten me!
 Georg
[1] 
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control.Arrow.html#2
[2] http://haskell.org/hawiki/UnderstandingArrows
[3] http://www.haskell.org/arrows/
--
 Georg Martius,  Tel: (+49 34297) 89434 
--- http://www.flexman.homeip.net -
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help on Arrows

2005-01-15 Thread David Menendez
Georg Martius writes:

 Hi folks,
 
 I would like to use Arrows, but I just can't figure out how to
 actually use them. I looked at various documentations including the
 API doc [1], the Wiki [2], [3], and some random pages on the net but
 didn't find a single simple example that tells me how to apply an
 Arrow to a value.

It depends on the type of the arrow. Arrows of type (-) can be applied
directly, because they're just plain functions. Arrows of type 'Kleisli
m' can be applied using a simple 'runKleisli' function.

runKleisli :: Kleisli m a b - a - m b
runKleisli (Kleisli f) = f

(I'm not sure why this isn't in Control.Arrow in the first place.)

Using your example arrow, we can use ($) and 'runKleisli' to coerce it
into functions of various types.

myAdd1A :: (Arrow a, Num b) = a b b
myAdd1A = arr (\x - x + 1)

($) myAdd1A :: Num b = b - b

runKleisli myAdd1A :: (Monad m, Num b) = b - m b

More interesting arrows, like the signal processors in Yampa [4], may
not have a meaningful concept of application.

[4] http://www.haskell.org/yampa/
-- 
David Menendez [EMAIL PROTECTED] http://www.eyrie.org/~zednenem/
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-30 Thread MR K P SCHUPKE
 Then we get the problem when we use difST in distString.

I no such problem.

The Glorious Glasgow Haskell Compilation System, version 6.3

ghc -H32m -Wall -O2 -fvia-C -optc-O2 -optc-march=pentium3 -optc-mfpmath=sse 
-fexcess-precision -fliberate-case-threshold100 -funbox-strict-fields -threaded  -c 
Diff.hs -i../.. -syslib net +RTS -K1

Diff.hs:
Warning: Module `Data.Array.MArray' is imported, but nothing from it is used
 (except perhaps instances visible in `Data.Array.MArray')

Diff.hs:159:13: Warning: Defined but not used: br

...??...

Of course the obvious way to have somewhere to put the class is
to turn the let into a function:

for example like:

distString :: String - String - Int
distString s0 s1 = f (runST (difST s0 s1))

f :: IArray a Int = a (Int,Int) Int - Int
f a = a!(1,1)

... or a non polymorphic version:

f :: UArray (Int,Int) Int - Int
f a = a!(1,1)

Keean.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-30 Thread Duncan Coutts
On Wed, 2004-06-30 at 12:00, MR K P SCHUPKE wrote:
 Ahh.. I see whats happening:
 
 MArray (STUArray s) a (ST s) = String - String - ST s (UArray (Int,Int) a)
 
 IArray UArray a = String - String - a
 
 nothing here is specifying a... you cannot leave a polymorphic in this case.
 
 You need to supply the constraint MArray (STUArray s) a (ST s) to distString
 but s is not in context...

Right, because the return type of distString Int is an instance of
MArray. But if we try to make 'a' polymorphic then we can't specify the
constraint because it involves 's'.

So the obvious follow-on question, is is there any intermediate point
where 's' is in scope where we can supply a type annotation to supply
the context or is it simply impossible?

To restate the question for Haskell-Cafe readers:
Is it possible to return an arbitrary unboxed array that was
constructed in the ST monad (as an STUArray)?

The issue is that you end up with a MArray class constraint that
involves the state thread's 's' parameter, but this type
variable gets 'hidden' by runST which universally quantifies
over it.runST :: forall a. (forall s. ST s a) - a

Duncan

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] Help in understanding a type error involving forall and class constraints

2004-06-29 Thread Duncan Coutts
Here's a small bit of code that involves some fairly hairy class
overloadings (ghc's mutable unboxed array classes)

The code builds an array in the ST monad by creating a mutable array
then assigning to each element and finally freezing the array and
returning an immutable array.

Firstly the bit that does most of the work (in the ST monad). We have a
MArray class constraint because we're working generically on any mutable
unboxed array. Its not completely generic however since we know we're
working in the ST monad with unboxed ST arrays 'STUArray'.

buildUArray' :: (Ix i, MArray (STUArray s) a (ST s)) =
(i,i) - (i - a) - ST s (STUArray s i a)
buildUArray' bounds f = do
  arr - newArray_ bounds
  mapM_ (\i - writeArray arr i (f i)) (range bounds)
  return arr

Now the wrapper which freezes the mutable array and gives us back an
immutable array (still in the ST monad). We gain an extra IArray class
constraint.

buildUArray :: (MArray (STUArray s) a (ST s), Ix i, IArray UArray a) =
   (i, i) - (i - a) - ST s (UArray i a)
buildUArray bounds f = do arr - buildUArray' bounds f
  unsafeFreeze arr

This all typechecks fine. Now lastly we want to run this state thread
monad to get the resultant 'UArray i a'

foo :: (MArray (STUArray s) a (ST s), Ix i, IArray UArray a) =
   (i, i) - (i - a) - UArray i a
foo bounds f = runST (buildUArray bounds f)

At first this seems like it ought to be the right type (it does discard
the 's' type), but ghc complains:

No instance for (MArray (STUArray s) a (ST s))
  arising from use of `buildUArray' at BuildArray.hs:25:22-32
Probable fix:
  Add (MArray (STUArray s) a (ST s)) to the expected type of an expression
  Or add an instance declaration for (MArray (STUArray s) a (ST s))
In the first argument of `runST', namely `(buildUArray bounds f)'
In the definition of `foo': foo bounds f = runST (buildUArray bounds f)

I get the same error if I leave off the type signature for 'foo'. The
error message suggests I add a class constraint that I've already added.
I suspect there's a name clash and the 's' it means is not the same as
the 's' that I've already got.

Anyone have an idea what's wrong? My guess is that it's related to the
nested forall type of runST. We need to express a class constraint on a
type that is universally quantified but that doesn't escape to the top
level of the functions type. If this is the case, it doesn't do any good
to add the 'MArray (STUArray s) a (ST s)' constraint because 's' does
not exist at this level of type scope (it just introduces a shadowing). 
So how would I write a constraint that involves 's'?

Duncan


Ps. similar code that uses normal (not unboxed) arrays works fine, but
is has less complicated class constraints:

buildArray :: Ix i = (i,i) - (i - a) - Array i a
buildArray bounds f = runST (do arr - buildArray' bounds f
unsafeFreeze arr)
  where buildArray' :: Ix i = (i,i) - (i - a) - ST s (STArray s i a)
buildArray' bounds f = do
  arr - newArray_ bounds
  mapM_ (\i - writeArray arr i (f i)) (range bounds)
  return arr

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-29 Thread MR K P SCHUPKE
Erm, something I remember about needing MArrays... Here's something
which does the same thing (cooks and MArray then freezes it - also using
STUArray... The neat thing is MArray is a class, so you can swap between
STUArray and STArray implementations without changing code.

This is the classic dynamic programming version of string difference:

distString :: String - String - Int
distString s0 s1 = runST (difST s0 s1)

difST :: MArray (STUArray s) Int (ST s) = String - String - ST s Int
difST s0 s1 = do
   b@(_,br) - return $ (\x1 y1 - ((0,0),(x1,y1))) (length s0) (length s1)
   d - newArray b 0 :: ST s (STUArray s (Int,Int) Int)
   mdiff d s0 s1
   readArray d br

mMin :: Int - Int - Int - Int
mMin i j k = min (min i j) k

costDelete :: Char - Int
costDelete _ = 1

costInsert :: Char - Int
costInsert _ = 1

costReplace :: Char - Char - Int
costReplace _ _  = 1

mdiff :: MArray a Int m = a (Int,Int) Int - String - String - m ()
mdiff (d :: a e i) s0 s1 = do
   writeArray d (0,0) 0
   foreach 1 s0 $ \x a - do
  dx - readArray d (x-1,0)
  writeArray d (x,0) (dx+costDelete a)
   foreach 1 s1 $ \y b - do
  dy - readArray d (0,y-1)
  writeArray d (0,y) (dy+costInsert b)
   foreach 1 s0 $ \x a - do
  foreach 1 s1 $ \y b - do
 dx - readArray d (x-1,y)
 dy - readArray d (x,y-1)
 dxy - readArray d (x-1,y-1)
 writeArray d (x,y) $ mMin (dx+costDelete a) (dy+costInsert b)
(if a==b then dxy else dxy+costReplace a b)
   where

   foreach :: MArray a Int m = Int - String - (Int - Char - m ()) - m ()
   foreach _ [] _ = return ()
   foreach i (c0:cs) f = do
  f i c0
  foreach (i+1) cs f




Keean.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-29 Thread Duncan Coutts
On Tue, 2004-06-29 at 18:42, MR K P SCHUPKE wrote:
 Erm, something I remember about needing MArrays... Here's something
 which does the same thing (cooks and MArray then freezes it - also using
 STUArray... The neat thing is MArray is a class, so you can swap between
 STUArray and STArray implementations without changing code.

I tried generalising the type to not mention which of STUArray and
STArray I'm using. Letting ghc infer the type gives this type,
unfortunately annotating the function with this type gives a type
error!!  Compiler/typechecker bug perhaps?

buildUArray bounds f = do arr - buildUArray' bounds f
  unsafeFreeze arr

ghc infers this type:
buildUArray :: forall a i b s array.
   (MArray (array s) a (ST s), Ix i, IArray b a) =
   (i, i) - (i - a) - ST s (b i a)

however if one add this annotation I get the same error message I got
originally:

 Could not deduce (MArray (array1 s) a (ST s))
from the context (MArray (array s) a (ST s), Ix i, IArray b a)
  arising from use of `unsafeFreeze' at BuildArray.hs:25
Probable fix:
Add (MArray (array1 s) a (ST s))
to the type signature(s) for `buildUArray'
Or add an instance declaration for (MArray (array1 s) a (ST s))
In the result of a 'do' expression: unsafeFreeze arr
In the definition of `buildUArray':
buildUArray bounds f
  = do
  arr - buildUArray' bounds f
  unsafeFreeze arr

 This is the classic dynamic programming version of string difference:

[snip]

The difference with your example cod is that I return the array itself
rather than a value calculated using the array. With your code, as soon
as we try to return the array too, I run into the same problem.

Duncan

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-29 Thread MR K P SCHUPKE
Try this:

distString :: String - String - Int
distString s0 s1 = let a = runST (difST s0 s1)
   in a!(1,1)

difST :: MArray (STUArray s) Int (ST s) = String - String - ST s (UArray (Int,Int) 
Int)
difST s0 s1 = do
   b@(_,br) - return $ (\x1 y1 - ((0,0),(x1,y1))) (length s0) (length s1)
   d - newArray b 0 :: ST s (STUArray s (Int,Int) Int)
   mdiff d s0 s1
   -- readArray d br
   unsafeFreeze d


Keean.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


RE: Haskell help!

2003-03-26 Thread Weix, Rachel Lynn
Title: Re: Haskell help!







P.S. The example given is for the set of sequences/strings 
(The,Masters)

  -Original Message- From: Weix, Rachel 
  Lynn Sent: Wed 3/26/2003 4:30 PM To: [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] Subject: RE: Haskell 
  help!
  Currently I'm having problems with type checking due to Haskell being a 
  strongly typed language. In order to return all optimal solutions, my 
  professor suggested I create a list of tuples if they all have the same score, 
  as indicated in my new maxSeq method (see attachment). However, this 
  means that the maxSeq method would returntype [[(Char,Char)]]. 
  Since maxSeq and getSeq must return the same type, I end up changing all my 
  signatures and end up with lots of problems. In my caseX methods, I 
  can't append [(Char)] to [[(Char,Char)]], and it also messes up trying to get 
  my score of each tuple, etc. I've been trying to solve the problem in 
  Scheme first but even then I'm having problems, and Scheme is only loosely 
  typed. Any suggestions? The format should be something like the 
  following (partial example):
  
  [ [(-,M)] [(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)] 
  [(-,s)(h,t)(e,e)(-,r)(-,s)]]].
  
  Once I get back my list, I need to pair everything up in order to return 
  a list of optimal solutions. Taking the previous example, it would be 
  the following when paired up correctly:
  
  [ [(-,M)(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)], 
  [(-,M)(T,a)(-,s)(h,t)(e,e)(-,r)(-,s)] ]
  
  From there, I find which sequence has the maximum score. I then 
  walk through the list again, making a list of all the sequences that have that 
  score. These two steps seem fairly trivial, it's all the above stuff 
  which I'm struggling on.
  
  Rachel
  
  -Original Message- From: Marc Ziegert 
  [mailto:[EMAIL PROTECTED] Sent: Tue 3/25/2003 3:13 PM To: 
  Weix, Rachel Lynn Cc: Subject: Re: Haskell 
  help!
  
maxSeq had one mistake: || instead of i 
will think about the problem itself, before rewriting all.this is 
the file a little bit more in haskell style.Am Dienstag, 25. 
Mrz 2003 20:16 schrieben Sie: I found my two mistakes, plus I fixed 
the method my Professor said was incorrect. Now I just have to 
be able to find ALL optimal solutions, instead of just one. 
Hooray! 
Rachel




Re: Haskell help!

2003-03-26 Thread Marc Ziegert
done.
- marc


Am Mittwoch, 26. Mrz 2003 23:32 schrieb Weix, Rachel Lynn:
 P.S.  The example given is for the set of sequences/strings (The,Masters)

   -Original Message-
   From: Weix, Rachel Lynn
   Sent: Wed 3/26/2003 4:30 PM
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Subject: RE: Haskell help!


   Currently I'm having problems with type checking due to Haskell being a
 strongly typed language.  In order to return all optimal solutions, my
 professor suggested I create a list of tuples if they all have the same
 score, as indicated in my new maxSeq method (see attachment).  However,
 this means that the maxSeq method would return type [[(Char,Char)]].  Since
 maxSeq and getSeq must return the same type, I end up changing all my
 signatures and end up with lots of problems.  In my caseX methods, I can't
 append [(Char)] to [[(Char,Char)]], and it also messes up trying to get my
 score of each tuple, etc.  I've been trying to solve the problem in Scheme
 first but even then I'm having problems, and Scheme is only loosely typed. 
 Any suggestions?  The format should be something like the following
 (partial example):

   [ [(-,M)] [(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)] [(-,s)(h,t)(e,e)(-,r)(-,s)]]].

   Once I get back my list, I need to pair everything up in order to return a
 list of optimal solutions.  Taking the previous example, it would be the
 following when paired up correctly:

   [ [(-,M)(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)],
 [(-,M)(T,a)(-,s)(h,t)(e,e)(-,r)(-,s)] ]

   From there, I find which sequence has the maximum score.  I then walk
 through the list again, making a list of all the sequences that have that
 score.  These two steps seem fairly trivial, it's all the above stuff which
 I'm struggling on.

   Rachel

   -Original Message-
   From: Marc Ziegert [mailto:[EMAIL PROTECTED]
   Sent: Tue 3/25/2003 3:13 PM
   To: Weix, Rachel Lynn
   Cc:
   Subject: Re: Haskell help!



   maxSeq had one mistake: || instead of 

   i will think about the problem itself, before rewriting all.

   this is the file a little bit more in haskell style.

   Am Dienstag, 25. Mrz 2003 20:16 schrieben Sie:
I found my two mistakes, plus I fixed the method my Professor said 
 was
incorrect.  Now I just have to be able to find ALL optimal solutions,
instead of just one.  Hooray!
   
Rachel
module Main where

type VSeqs = (Integer,[(String,String)]) -- valued sequences


type VS_matrix = [[VSeqs]]


emptyVS :: VSeqs
emptyVS = (0,[(,)])

rightmostCol :: String - [VSeqs]
rightmostCol  = [emptyVS]
rightmostCol (c:cs) = (v-1,[('~':s1,c:s2)]) : above
  where above((v,(s1,s2):_):_) = rightmostCol cs


nextCol :: Char - String - [VSeqs] - [VSeqs]
nextCol c  ((v,(s1,s2):_):_) = (v-1,(c:s1,'~':s2):[]):[]
nextCol c str2 (vs:vsr) = makeEntry c str2 (head above) vs (head vsr) : above
  where above = nextCol c (tail str2) vsr


makeEntry :: Char- String - VSeqs - VSeqs - VSeqs - VSeqs
makeEntry c str2(h:_) above(va,sa) right(vr,sr) aboveright(vd,sd) = maxEntry fa fr 
fd
where fa = 
(va-1, append '~' h  sa )
  fr = 
(vr-1, append  c '~' sr )
  fd = 
(vd+v, append  c  h  sd )
  v = if 
c==h then 1 else -1
  append l 
r tups = [ (l:ls,r:rs) | (ls,rs)-tups ]

maxEntry :: VSeqs - VSeqs - VSeqs - VSeqs
maxEntry a(va,_) b(vb,_) c(vc,_) = if vavb then if vavc then a
 else c
   else if vbvc then b
 else c
  
  
fillmatrix :: String - String - VS_matrix
fillmatrix str1 str2 = scanr xcc (rightmostCol str2) str1
   where xcc :: Char - [VSeqs] - [VSeqs]
 xcc x s = nextCol x str2 s


findBestSeqs :: String - String - VSeqs
findBestSeqs str1 str2 = head $ head $ fillmatrix str1 str2




main :: IO ()
main = do putStr \icecream\ \scheme\  : 
  putStrLn $ show $ findBestSeqs   icecream   scheme
  putStr \hate\ \hatter\  : 
  putStrLn $ show $ findBestSeqs   hate   hatter
  putStr \scheme\   \saturn\  : 
  putStrLn $ show $ findBestSeqs   scheme saturn
  putStr \saturn\   \scheme\  : 
  putStrLn $ show

Re: Haskell help!

2003-03-25 Thread Marc Ziegert
looks like a genetic algorithm, i've programmed years ago. :)

i need the sourcecode to solve the problem.
it seems that you zip the two strings together:

unzip $ zip abcde 123
-
unzip [('a','1'),('b','2'),('c','3')]
-
(abc,123)

i've no idea why you got saaturn.

- marc




Am Dienstag, 25. März 2003 01:32 schrieb Weix, Rachel Lynn:
 Hi,

 I'm a college student trying to write a Haskell program, and I'm having
 some problems getting the correct output.  I need to write a program
 which will return a set of optimally aligned sequences, with optimal
 being defined as such: mismatch or space (represented by a -) = -1;
 else 1 for every pair (see below for what a pair is)

 An example set of sequences with an alignment of -3 is as follows:

 sc-h-e-me
 icecream-

 (s,i) are a pair, (c, c), etc.

 For right now, I'm only returning a potential solution (vs. a set of
 solutions), and I'm having problems with any set of sequences that
 aren't the same length.  My results are listed below.  I don't want to
 include the code for now since it's about a page long (printed out) but
 was hoping maybe someone had an idea as to why I'm getting such odd
 results?  If code will help, I can exchange back and forth with whoever
 thinks they might be able to help me out.  Your help is much
 appreciated!

 Rachel


 -- Each word/sequence you see has been predefined in my Haskell code
 -- This first example appears to work just fine

 Main printSeq icecream scheme

 (icecream, scheme--)



 Main printSeq hate hatter

 (hat-e, hatte)



 Main printSeq scheme saturn

 (scheme, saatur)



 Main printSeq saturn scheme

 (saaturn, scheme-)



 Main printSeq saturn hatter

 (saaturn, hatter-)



 Main printSeq hatter saturn

 (hatter, saatur)



 Main printSeq mad saturn

 (mad, saa)



 Main printSeq hate hatter

 (hat-e, hatte)



 Main printSeq snowball icecream

 (snowb-all, icecream-)



 Main printSeq mad computer

 (--mad, compu)



 Main printSeq mad snowball

 (mad, sno)

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Haskell help!

2003-03-25 Thread Iavor S. Diatchki
hi,

i think you might find the following paper relevant:
Algebrainc Dynamic Prorgamming
by Robert Gigerich and Carsten Meyer
http://link.springer-ny.com/link/service/series/0558/papers/2422/24220349.pdf
bye
iavor
Weix, Rachel Lynn wrote:
Hi,
 
I'm a college student trying to write a Haskell program, and I'm having
some problems getting the correct output.  I need to write a program
which will return a set of optimally aligned sequences, with optimal
being defined as such: mismatch or space (represented by a -) = -1;
else 1 for every pair (see below for what a pair is)
 
An example set of sequences with an alignment of -3 is as follows:
 
sc-h-e-me
icecream-
 
(s,i) are a pair, (c, c), etc.
 
For right now, I'm only returning a potential solution (vs. a set of
solutions), and I'm having problems with any set of sequences that
aren't the same length.  My results are listed below.  I don't want to
include the code for now since it's about a page long (printed out) but
was hoping maybe someone had an idea as to why I'm getting such odd
results?  If code will help, I can exchange back and forth with whoever
thinks they might be able to help me out.  Your help is much
appreciated!
 
Rachel
 
 
-- Each word/sequence you see has been predefined in my Haskell code
-- This first example appears to work just fine
 
Main printSeq icecream scheme

(icecream, scheme--)

 

Main printSeq hate hatter

(hat-e, hatte)



Main printSeq scheme saturn

(scheme, saatur)



Main printSeq saturn scheme

(saaturn, scheme-)



Main printSeq saturn hatter

(saaturn, hatter-)



Main printSeq hatter saturn

(hatter, saatur)



Main printSeq mad saturn

(mad, saa)



Main printSeq hate hatter

(hat-e, hatte)



Main printSeq snowball icecream

(snowb-all, icecream-)



Main printSeq mad computer

(--mad, compu)

 

Main printSeq mad snowball

(mad, sno)




--
==
| Iavor S. Diatchki, Ph.D. student   |
| Department of Computer Science and Engineering |
| School of OGI at OHSU  |
| http://www.cse.ogi.edu/~diatchki   |
==
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Haskell help!

2003-03-25 Thread Iavor S. Diatchki
hi,

the paper i posted uses Haskell, no mutation or looping. it also uses 
Haskell's lazyness in a neat way.

bye
iavor
Weix, Rachel Lynn wrote:
I have since been able to figure out my problems - the algorithm for one of my methods was wrong and I found two typos so to speak.  I now need to figure out how to return all optimal solutions, and I have an idea as to how to start.  If I have any more problems I may send out another email.
 
Rachel
P.S.  I need  to solve the problem using functional programming, thus I cannot use looping structures or mutation.


--
==
| Iavor S. Diatchki, Ph.D. student   |
| Department of Computer Science and Engineering |
| School of OGI at OHSU  |
| http://www.cse.ogi.edu/~diatchki   |
==
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: A plea for a little Haskell help.

1999-02-17 Thread Fergus Henderson

On 16-Feb-1999, Michael Hobbs [EMAIL PROTECTED] wrote:
 I'm not sure if this can be cleanly done or not. (I've been able to do
 it less-than-cleanly.) What I want to do is define a class where the
 instance has an option of what type of parameters some of its functions
 can accept. For example, say I have
 
 class Foo a where
   write :: a - b - IO ()
 
 This allows a particular instance's version of `write' to accept any
 type of value as the second parameter. However some instances may not be
 able to accept _any_ type of parameter; maybe some can only write
 Strings. I have been able to accomplish what I want by using a bit of a
 kludge:

What's wrong with

class Foo a b where
write :: a - b - IO ()

?

-- 
Fergus Henderson [EMAIL PROTECTED]  |  "Binaries may die
WWW: http://www.cs.mu.oz.au/~fjh  |   but source code lives forever"
PGP: finger [EMAIL PROTECTED]| -- leaked Microsoft memo.






Re: A plea for a little Haskell help.

1999-02-17 Thread Lennart Augustsson


 What's wrong with
 
   class Foo a b where
   write :: a - b - IO ()
 
 ?
Well, it's not Haskell. :-)

  -- Lennart





Re: A plea for a little Haskell help.

1999-02-17 Thread Michael Hobbs

Fergus Henderson wrote:
 
 On 17-Feb-1999, Lennart Augustsson [EMAIL PROTECTED] wrote:
 
   What's wrong with
  
   class Foo a b where
   write :: a - b - IO ()
  
   ?
 
  Well, it's not Haskell. :-)
 
 Oh, good point blush.  I forgot about that.
 
 Please take my mail above as a vote in favour of including
 multi-parameter type classes in Haskell-2! ;-)

Actually, that's very close to what I have implemented in Real Life. I'm
not sure of what the semantic meaning of "multi-parameter type classes"
is, but an example of what I actually have defined is something like:

  class Foo a where
write :: a b - b - IO ()

In which case I define instances such as

  data Fooable b = Fooable (IORef b)
  instance Foo Fooable where
write (Fooable ref) val = ...

Anyway, back to the point. I'm not sure if such a concept has yet been
given a name, but it sure would eliminate a lot of headaches if Haskell
provided something like type patterns. Example:

  class Foo a where
write :: a - b - IO ()
  instance Foo TextEntry where
write te (val :: String) = setText te val
write te (val :: Show a = a) = setText te $ show val
write te val = ioError ...

Right now, the only way I can figure out how to do this is to define
something like
  data Show a = WriteVal a b = WVString String | WVShow a | WVElse b
but this is not easily extendable for ad-hoc situations. (I haven't even
verified if the above statement will really work. I have only done the
MaybePoly)

- Michael Hobbs






A plea for a little Haskell help.

1999-02-16 Thread Michael Hobbs

I'm not sure if this can be cleanly done or not. (I've been able to do
it less-than-cleanly.) What I want to do is define a class where the
instance has an option of what type of parameters some of its functions
can accept. For example, say I have

class Foo a where
  write :: a - b - IO ()

This allows a particular instance's version of `write' to accept any
type of value as the second parameter. However some instances may not be
able to accept _any_ type of parameter; maybe some can only write
Strings. I have been able to accomplish what I want by using a bit of a
kludge:

data MaybePoly b = IsPoly b | NotPoly String
class FooKludge a where
  write :: a - MaybePoly b - IO ()
instance FooKludge OnlyStrings where
  write only (NotPoly str) = send str
  write _ (IsPoly _) = ioError $ userError "I can't accept this."

The problem is that every function call to `write' has to package up the
variable into a MaybePoly, which gets rather ugly. If I have a function
that returns a MaybePoly, then it has to be unpackaged as well. Can
anyone think of a "prettier" way?

It wouldn't be so bad if I could even do as much as:
polyX :: MaybePoly a - a
polyX (IsPoly x) = x
polyX (NotPoly str) = str

But that fails to type-check.

Thanks for all input,
Michael Hobbs






Re: Do you depend on Hugs/Haskell? Help out!

1998-12-18 Thread S. Alexander Jacobson

If the commercial side is at all useful,
We are using Haskell to generate the HTML and Javascript for Shop.Com.
We are using it for other non-public projects as well.

-Alex-


On Thu, 17 Dec 1998, Tim Sheard wrote:

 Dear Haskell user,
 
 A group of Haskell supporters is trying to raise money to support the
 further development and maintenance of the Hugs interpreter and its
 integration with the GHC run-time system. The idea is not to ask for
 money to do research, or to add zillions of new features and extensions,
 but rather to fix bugs, maintain libraries, build new distributions etc.
 I.e. make it possible for Haskell to be a real tool that people can
 depend upon.
 
 The strategy is to say, "all these people use Haskell (or have used it)
 as a TOOL in their teaching and research. They have found it invaluable
 as a TOOL, and thus someone should support it."
 
 The thrust of the proposal is that Haskell is such an important tool, that: 
 
1) It enables research in many different disciplines that could not be
carried out without it,

2) It provides an important educational tool for both students and
researchers wanting to use a declarative language approach to
problem solving.

3) This is so important that the funding agencies should support this
proposal as a sort of "infrastructure" grant.
 
 In order to make this case I am asking Haskell users to send me a short
 email describing what they use Haskell for. I am looking for two kinds
 of answers: Research and Teaching.
 
 Research:
 
 1) What is your research
 2) Why is it important
 3) How does it use Haskell
 4) What features of Haskell make it particularly usefull
 5) What would have to be done if you couldn't use Haskell or Hugs
 
 Teaching: (No need if already on the teaching page at haskell.org)
 
 1) What course do you teach that uses Haskell in some in integral way?
course name, university.
 2) What published materials do you use (text book, notes etc)
and if not commercially available, where can they be obtained over
the web.
 3) How many students per year take this course
 4) Why did you choose Haskell rather than some other language.
 
 Short, concise answers are best (100-200 words). Long answers are better
 than no answers. Web pointers are also useful, but are the least
 effective way you can contribute. We know this is a busy time of year,
 but there is some urgency in my request, as funding deadlines are
 quickly approaching.
 
 Please reply to us if you can help in this endeavor. We will try and post
 a synopsis of what I find out in a month or so.
 
 
 Tim Sheard, Oregon Graduate Institute
 John Peterson, Yale University
 
 please reply to:  [EMAIL PROTECTED]
 
 
 

___
S. Alexander Jacobson   i2x Media  
1-212-697-0184 voice1-212-697-1427 fax






Do you depend on Hugs/Haskell? Help out!

1998-12-17 Thread Tim Sheard

Dear Haskell user,

A group of Haskell supporters is trying to raise money to support the
further development and maintenance of the Hugs interpreter and its
integration with the GHC run-time system. The idea is not to ask for
money to do research, or to add zillions of new features and extensions,
but rather to fix bugs, maintain libraries, build new distributions etc.
I.e. make it possible for Haskell to be a real tool that people can
depend upon.

The strategy is to say, "all these people use Haskell (or have used it)
as a TOOL in their teaching and research. They have found it invaluable
as a TOOL, and thus someone should support it."

The thrust of the proposal is that Haskell is such an important tool, that: 

   1) It enables research in many different disciplines that could not be
   carried out without it,
   
   2) It provides an important educational tool for both students and
   researchers wanting to use a declarative language approach to
   problem solving.
   
   3) This is so important that the funding agencies should support this
   proposal as a sort of "infrastructure" grant.

In order to make this case I am asking Haskell users to send me a short
email describing what they use Haskell for. I am looking for two kinds
of answers: Research and Teaching.

Research:

1) What is your research
2) Why is it important
3) How does it use Haskell
4) What features of Haskell make it particularly usefull
5) What would have to be done if you couldn't use Haskell or Hugs

Teaching: (No need if already on the teaching page at haskell.org)

1) What course do you teach that uses Haskell in some in integral way?
   course name, university.
2) What published materials do you use (text book, notes etc)
   and if not commercially available, where can they be obtained over
   the web.
3) How many students per year take this course
4) Why did you choose Haskell rather than some other language.

Short, concise answers are best (100-200 words). Long answers are better
than no answers. Web pointers are also useful, but are the least
effective way you can contribute. We know this is a busy time of year,
but there is some urgency in my request, as funding deadlines are
quickly approaching.

Please reply to us if you can help in this endeavor. We will try and post
a synopsis of what I find out in a month or so.


Tim Sheard, Oregon Graduate Institute
John Peterson, Yale University

please reply to:  [EMAIL PROTECTED]