https://wiki.haskell.org/api.php?action=feedcontributions&user=DavidLazar&feedformat=atomHaskellWiki - User contributions [en]2021-09-19T11:36:08ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=HacPDX-II/Attendees&diff=55555HacPDX-II/Attendees2013-03-13T16:07:08Z<p>DavidLazar: </p>
<hr />
<div>{| class="wikitable"<br />
! Name<br />
! Number<br />
! E-mail<br />
! IRC<br />
! Days Attending<br />
|-<br />
| Thomas DuBuisson<br />
| <br />
| Thomas.DuBuisson+hacpdx@gmail.com<br />
| TomMD<br />
| ALL<br />
|-<br />
| David Lazar<br />
|<br />
| (\x -> x@illinois.edu) lazar6<br />
|<br />
| ALL<br />
|-<br />
| Dan Colish<br />
|<br />
| dcolish@gmail.com <br />
| dcolish<br />
| Saturday<br />
|-<br />
| Jason Dagit<br />
|<br />
| <br />
| lispy<br />
| Fri-Sat(?)<br />
|-<br />
| Matthew Sorensen<br />
|<br />
|intercalate "l" ["infa","","ib","eone@gmai",".com"] <br />
| <br />
| Fri-Sat<br />
|-<br />
| Clint Moore<br />
|<br />
| clint@ivy.io<br />
| hydo<br />
| All<br />
|-<br />
| Lee Short<br />
|<br />
| blackcat (a t ) pro-ns.net<br />
| <br />
| Fri(?)-Sat-Sun<br />
|-<br />
| Michael Steele<br />
|<br />
| mikesteele80@gmail.com plus one<br />
|<br />
| ALL<br />
|-<br />
| Andrew Farmer<br />
|<br />
| (\ x -> x ++ "@ku.edu") "anfarmer"<br />
| afarmer<br />
| ALL<br />
|-<br />
| Nathan Collins<br />
|<br />
| nathan.collins@gmail.com<br />
| ntc2<br />
| ALL?<br />
|-<br />
| Jamey Sharp<br />
|<br />
| jamey@minilop.net<br />
| <br />
| ALL?<br />
|-<br />
| Josh Triplett<br />
|<br />
| josh@joshtriplett.org<br />
| <br />
| Fri<br />
|-<br />
| Michael Sloan<br />
| <br />
| mgsloan@gmail.com<br />
| mgsloan<br />
| Sat-Sun<br />
|-<br />
| Ki Yung Ahn<br />
| <br />
| kyagrd@gmail.com<br />
| kyagrd<br />
| Fri,Sat, and Sun afternoon<br />
|-<br />
| Ezekiel Smithburg<br />
| <br />
| tehgeekmeister@gmail.com<br />
| tehgeekmeister<br />
| friday afternoon, saturday, sunday<br />
|-<br />
| Philip Weaver<br />
| <br />
| philip.weaver@gmail.com<br />
| pheaver<br />
| Friday<br />
|-<br />
| Bart Massey<br />
| <br />
| bart.massey@gmail.com<br />
| PO8<br />
| parts of friday, saturday, sunday<br />
|-<br />
| Adam Foltzer<br />
|<br />
| (\x -> x@gmail.com) acfoltzer<br />
| acfoltzer<br />
| Friday afternoon<br />
|}<br />
<br />
<br />
[[Category:Community]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=User:DavidLazar&diff=55554User:DavidLazar2013-03-13T16:04:30Z<p>DavidLazar: Replacing page with 'Hello :-)'</p>
<hr />
<div>Hello :-)</div>DavidLazarhttps://wiki.haskell.org/index.php?title=User:DavidLazar&diff=46078User:DavidLazar2012-06-16T07:18:57Z<p>DavidLazar: update irc nick</p>
<hr />
<div>Student at University of Illinois at Urbana-Champaign<br />
<br />
Email: (\x -> x@illinois.edu) lazar6<br />
<br />
IRC: lazard</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Hackathon&diff=40951Hackathon2011-07-12T23:31:13Z<p>DavidLazar: Oops, typo: Hax -> Hac</p>
<hr />
<div>[[Image:Hac-axe-icon.png|Hac icon]]<br />
<br />
'''Hac: The Haskell Hackathon'''<br />
<br />
The Haskell developer community holds regular hackathons, to get<br />
together, collaborate, and work on key tools and infrastructure.<br />
<br />
* [[CamHac|Cambridge, Aug 2011]]<br />
* [[HacPDX-II|Portland, Jul 2011]]<br />
* [[Hac φ|Philadelphia, Jul 2011]]<br />
* [[BayHac2011|SF Bay Area, Feb 2011]]<br />
* [[Ghent Functional Programming Group/BelHac|Ghent, Nov 2010]]<br />
* [[LtU-Kiev/Hackathon|Kiev, Oct 2010]]<br />
* [[AusHac2010|Australian Hackathon, Jul 2010]]<br />
* [[Hac φ|Philadelphia, May 2010]]<br />
* [[ZuriHac|Zurich, Mar 2010]]<br />
* [[HacPDX|Portland, OR, Sep 2009]]<br />
* [[Hac7|Edinburgh, Aug 2009]]<br />
* [[Hac φ|Philadelphia, Jul 2009]]<br />
* [[Hac5|Utrecht, Apr 2009]]<br />
* [[HaL3|Leipzig, Apr 2008]]<br />
* [[Hac 2008|Göteborg, Apr 2008]]<br />
* [[Hac 2007 II|Freiburg, Oct 2007]]<br />
* [[Hac 2007|Oxford, Jan 2007]]<br />
* [http://hackage.haskell.org/trac/ghc/wiki/Hackathon Portland, Sep 2006]<br />
<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Hackathon&diff=40950Hackathon2011-07-12T23:30:30Z<p>DavidLazar: Add HaxPDX-II</p>
<hr />
<div>[[Image:Hac-axe-icon.png|Hac icon]]<br />
<br />
'''Hac: The Haskell Hackathon'''<br />
<br />
The Haskell developer community holds regular hackathons, to get<br />
together, collaborate, and work on key tools and infrastructure.<br />
<br />
* [[CamHac|Cambridge, Aug 2011]]<br />
* [[HaxPDX-II|Portland, Jul 2011]]<br />
* [[Hac φ|Philadelphia, Jul 2011]]<br />
* [[BayHac2011|SF Bay Area, Feb 2011]]<br />
* [[Ghent Functional Programming Group/BelHac|Ghent, Nov 2010]]<br />
* [[LtU-Kiev/Hackathon|Kiev, Oct 2010]]<br />
* [[AusHac2010|Australian Hackathon, Jul 2010]]<br />
* [[Hac φ|Philadelphia, May 2010]]<br />
* [[ZuriHac|Zurich, Mar 2010]]<br />
* [[HacPDX|Portland, OR, Sep 2009]]<br />
* [[Hac7|Edinburgh, Aug 2009]]<br />
* [[Hac φ|Philadelphia, Jul 2009]]<br />
* [[Hac5|Utrecht, Apr 2009]]<br />
* [[HaL3|Leipzig, Apr 2008]]<br />
* [[Hac 2008|Göteborg, Apr 2008]]<br />
* [[Hac 2007 II|Freiburg, Oct 2007]]<br />
* [[Hac 2007|Oxford, Jan 2007]]<br />
* [http://hackage.haskell.org/trac/ghc/wiki/Hackathon Portland, Sep 2006]<br />
<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40740HacPDX-II2011-06-30T21:02:07Z<p>DavidLazar: Update link to map</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* [http://calagator.org/events/1250460792 Calagator]<br />
* [http://www.reddit.com/r/haskell/duplicates/idkd7/hac_pdx_ii_a_portland_haskell_hackathon_july_2224/ Reddit (/r/programming, portland, and Haskell)]<br />
* Mailing lists: [http://groups.google.com/group/pdxfunc/browse_thread/thread/f474e0e6e2988b1d pdxfunc], [http://www.haskell.org/pipermail/haskell/2011-June/022877.html haskell], [http://www.haskell.org/pipermail/haskell-cafe/2011-June/093617.html haskell-cafe]<br />
<br />
== When ==<br />
<br />
Friday July 22 10:00AM to 5:30 PM<br />
Saturday July 23 10:00AM to 5:30 PM<br />
Sunday July 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the [http://maps.google.com/maps/ms?msa=0&msid=207954109565745071395.0004a6f4049ffe4216b4b Fourth Avenue Building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone to walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
You must RSVP! Go to the [[/Registration|HacPDX Registration]] page<br />
and add your name as an attendee - the selected room can fit a<br />
population in the fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12 and 44 stop right outside the Fourth Avenue<br />
Building; bus 17 has two stops on Lincoln and one on Harrison & 6th, all are easy walks to the venue. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=User:DavidLazar&diff=40739User:DavidLazar2011-06-30T20:40:15Z<p>DavidLazar: Add IRC info</p>
<hr />
<div>Student at University of Illinois at Urbana-Champaign<br />
<br />
Email: (\x -> x@illinois.edu) lazar6<br />
<br />
IRC: davidL</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40738HacPDX-II2011-06-30T20:39:01Z<p>DavidLazar: /* Publicity */ Fix haskell(-general) link</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* [http://calagator.org/events/1250460792 Calagator]<br />
* [http://www.reddit.com/r/haskell/duplicates/idkd7/hac_pdx_ii_a_portland_haskell_hackathon_july_2224/ Reddit (/r/programming, portland, and Haskell)]<br />
* Mailing lists: [http://groups.google.com/group/pdxfunc/browse_thread/thread/f474e0e6e2988b1d pdxfunc], [http://www.haskell.org/pipermail/haskell/2011-June/022877.html haskell], [http://www.haskell.org/pipermail/haskell-cafe/2011-June/093617.html haskell-cafe]<br />
<br />
== When ==<br />
<br />
Friday July 22 10:00AM to 5:30 PM<br />
Saturday July 23 10:00AM to 5:30 PM<br />
Sunday July 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone to walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
You must RSVP! Go to the [[/Registration|HacPDX Registration]] page<br />
and add your name as an attendee - the selected room can fit a<br />
population in the fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12 and 44 stop right outside the Fourth Avenue<br />
Building; bus 17 has two stops on Lincoln and one on Harrison & 6th, all are easy walks to the venue. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40737HacPDX-II2011-06-30T20:35:55Z<p>DavidLazar: Add link to haskell-cafe post</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* [http://calagator.org/events/1250460792 Calagator]<br />
* [http://www.reddit.com/r/haskell/duplicates/idkd7/hac_pdx_ii_a_portland_haskell_hackathon_july_2224/ Reddit (/r/programming, portland, and Haskell)]<br />
* Mailing lists: [http://groups.google.com/group/pdxfunc/browse_thread/thread/f474e0e6e2988b1d pdxfunc], [http://news.gmane.org/gmane.comp.lang.haskell.general haskell], [http://www.haskell.org/pipermail/haskell-cafe/2011-June/093617.html haskell-cafe]<br />
<br />
== When ==<br />
<br />
Friday July 22 10:00AM to 5:30 PM<br />
Saturday July 23 10:00AM to 5:30 PM<br />
Sunday July 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone to walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
You must RSVP! Go to the [[/Registration|HacPDX Registration]] page<br />
and add your name as an attendee - the selected room can fit a<br />
population in the fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12 and 44 stop right outside the Fourth Avenue<br />
Building; bus 17 has two stops on Lincoln and one on Harrison & 6th, all are easy walks to the venue. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=40736Template:Main/Events2011-06-30T20:32:09Z<p>DavidLazar: Add year to HacPDX event</p>
<hr />
<div><div class="subtitle">Upcoming Events</div><br />
;[[HacPDX-II|HacPDX: Portland Hackathon]]<br />
:July 22-24, 2011, Portland, OR<br />
;[[CamHac|Cambridge Hackathon]]<br />
:August 12-14, 2011, Cambridge, UK<br />
;[http://www.utrechtsummerschool.nl/index.php?type=courses&code=H9 3rd Summerschool on Applied Functional Programming]<br />
:August 15-26, 2011, Utrecht, the Netherlands<br />
;[http://www.ittc.ku.edu/ifl2011/ 23rd Symposium on Implementation and Application of Functional Languages.]<br />
:Oct 3-5, 2011, Lawrence, KS<br />
<br />
<div class="subtitle">Recent Events</div><br />
<br />
;[http://goo.gl/gLEqE SF Bay Area Haskell User Group: Multithreaded code verification using Haskell]<br />
:May 18, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/MVsKy SF Bay Area Haskell User Group: Writing dynamically linked libraries in Haskell]<br />
:April 20, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/tG1Wn SF Bay Area Haskell User Group]<br />
:March 16, 2011 @ 7pm, San Francisco, CA<br />
;[[BayHac2011|SF Bay Area Hackaton]]<br />
:February 11-13, 2011, Mountain View, California<br />
;[http://goo.gl/3ppzV SF Bay Area Haskell User Group]<br />
:February 9, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/ijlfS SF Bay Area Haskell User Group]<br />
:January 12, 2011 @ 7pm, San Francisco, CA<br />
;[http://caes.ewi.utwente.nl/External/NLFP/E/ Dutch Functional Programming Day] :January 7, 2011, Twente University, the Netherlands<br />
;[http://www.haskell.org/haskellwiki/Ghent_Functional_Programming_Group/BelHac BelHac]<br />
:November 5-7, 2010, Ghent, Belgium<br />
;[http://goo.gl/1KPa Erik Meijer: “Fundamentalist Functional Programming”]<br />
:November 3, 2010 @ 7pm, San Francisco, CA<br />
;[http://haskell.org/haskellwiki/LtU-Kiev/Hackathon Kiev Hackathon]<br />
:October 16-17, 2010, Kiev, Ukraine</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=40735Template:Main/Events2011-06-30T20:31:38Z<p>DavidLazar: Move SF Bay event to Recent Events</p>
<hr />
<div><div class="subtitle">Upcoming Events</div><br />
;[[HacPDX-II|HacPDX: Portland Hackathon]]<br />
:July 22-24, Portland, OR<br />
;[[CamHac|Cambridge Hackathon]]<br />
:August 12-14, 2011, Cambridge, UK<br />
;[http://www.utrechtsummerschool.nl/index.php?type=courses&code=H9 3rd Summerschool on Applied Functional Programming]<br />
:August 15-26, 2011, Utrecht, the Netherlands<br />
;[http://www.ittc.ku.edu/ifl2011/ 23rd Symposium on Implementation and Application of Functional Languages.]<br />
:Oct 3-5, 2011, Lawrence, KS<br />
<br />
<div class="subtitle">Recent Events</div><br />
<br />
;[http://goo.gl/gLEqE SF Bay Area Haskell User Group: Multithreaded code verification using Haskell]<br />
:May 18, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/MVsKy SF Bay Area Haskell User Group: Writing dynamically linked libraries in Haskell]<br />
:April 20, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/tG1Wn SF Bay Area Haskell User Group]<br />
:March 16, 2011 @ 7pm, San Francisco, CA<br />
;[[BayHac2011|SF Bay Area Hackaton]]<br />
:February 11-13, 2011, Mountain View, California<br />
;[http://goo.gl/3ppzV SF Bay Area Haskell User Group]<br />
:February 9, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/ijlfS SF Bay Area Haskell User Group]<br />
:January 12, 2011 @ 7pm, San Francisco, CA<br />
;[http://caes.ewi.utwente.nl/External/NLFP/E/ Dutch Functional Programming Day] :January 7, 2011, Twente University, the Netherlands<br />
;[http://www.haskell.org/haskellwiki/Ghent_Functional_Programming_Group/BelHac BelHac]<br />
:November 5-7, 2010, Ghent, Belgium<br />
;[http://goo.gl/1KPa Erik Meijer: “Fundamentalist Functional Programming”]<br />
:November 3, 2010 @ 7pm, San Francisco, CA<br />
;[http://haskell.org/haskellwiki/LtU-Kiev/Hackathon Kiev Hackathon]<br />
:October 16-17, 2010, Kiev, Ukraine</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=40734Template:Main/Events2011-06-30T20:29:50Z<p>DavidLazar: Add HacPDX as an upcoming event</p>
<hr />
<div><div class="subtitle">Upcoming Events</div><br />
;[[HacPDX-II|HacPDX: Portland Hackathon]]<br />
:July 22-24, Portland, OR<br />
;[http://goo.gl/gLEqE SF Bay Area Haskell User Group: Multithreaded code verification using Haskell]<br />
:May 18, 2011 @ 7pm, San Francisco, CA<br />
;[[CamHac|Cambridge Hackathon]]<br />
:August 12-14, 2011, Cambridge, UK<br />
;[http://www.utrechtsummerschool.nl/index.php?type=courses&code=H9 3rd Summerschool on Applied Functional Programming]<br />
:August 15-26, 2011, Utrecht, the Netherlands<br />
;[http://www.ittc.ku.edu/ifl2011/ 23rd Symposium on Implementation and Application of Functional Languages.]<br />
:Oct 3-5, 2011, Lawrence, KS<br />
<br />
<div class="subtitle">Recent Events</div><br />
<br />
;[http://goo.gl/MVsKy SF Bay Area Haskell User Group: Writing dynamically linked libraries in Haskell]<br />
:April 20, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/tG1Wn SF Bay Area Haskell User Group]<br />
:March 16, 2011 @ 7pm, San Francisco, CA<br />
;[[BayHac2011|SF Bay Area Hackaton]]<br />
:February 11-13, 2011, Mountain View, California<br />
;[http://goo.gl/3ppzV SF Bay Area Haskell User Group]<br />
:February 9, 2011 @ 7pm, San Francisco, CA<br />
;[http://goo.gl/ijlfS SF Bay Area Haskell User Group]<br />
:January 12, 2011 @ 7pm, San Francisco, CA<br />
;[http://caes.ewi.utwente.nl/External/NLFP/E/ Dutch Functional Programming Day] :January 7, 2011, Twente University, the Netherlands<br />
;[http://www.haskell.org/haskellwiki/Ghent_Functional_Programming_Group/BelHac BelHac]<br />
:November 5-7, 2010, Ghent, Belgium<br />
;[http://goo.gl/1KPa Erik Meijer: “Fundamentalist Functional Programming”]<br />
:November 3, 2010 @ 7pm, San Francisco, CA<br />
;[http://haskell.org/haskellwiki/LtU-Kiev/Hackathon Kiev Hackathon]<br />
:October 16-17, 2010, Kiev, Ukraine</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40720HacPDX-II2011-06-30T05:34:09Z<p>DavidLazar: /* Where */ missing word (again)</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* [http://calagator.org/events/1250460792 Calagator]<br />
<br />
== When ==<br />
<br />
Friday July 22 10:00AM to 5:30 PM<br />
Saturday July 23 10:00AM to 5:30 PM<br />
Sunday July 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone to walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
You must RSVP! Go to the [[/Registration|HacPDX Registration]] page<br />
and add your name as an attendee - the selected room can fit a<br />
population in the fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12, 44, and 17 all stop right outside the Fourth Avenue<br />
Building. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40719HacPDX-II2011-06-30T05:33:29Z<p>DavidLazar: /* When */ fix dates</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* [http://calagator.org/events/1250460792 Calagator]<br />
<br />
== When ==<br />
<br />
Friday July 22 10:00AM to 5:30 PM<br />
Saturday July 23 10:00AM to 5:30 PM<br />
Sunday July 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
You must RSVP! Go to the [[/Registration|HacPDX Registration]] page<br />
and add your name as an attendee - the selected room can fit a<br />
population in the fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12, 44, and 17 all stop right outside the Fourth Avenue<br />
Building. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40714HacPDX-II2011-06-30T03:05:46Z<p>DavidLazar: /* Organizers */ add myself as an organizer</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* Calagator : FIXME add url<br />
<br />
== When ==<br />
Friday Sept 22 10:00AM to 5:30 PM<br />
Saturday Sept 23 10:00AM to 5:30 PM<br />
Sunday Sept 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
Go to the [[/Registration|HacPDX Registration]] page and add your name<br />
as an attendee - the selected room can fit a population in the<br />
fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12, 44, and 17 all stop right outside the Fourth Avenue<br />
Building. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
* [[User:DavidLazar | David Lazar]]<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=User:DavidLazar&diff=40713User:DavidLazar2011-06-30T03:03:14Z<p>DavidLazar: Create user page for myself</p>
<hr />
<div>Student at University of Illinois at Urbana-Champaign<br />
<br />
Email: (\x -> x@illinois.edu) lazar6</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40712HacPDX-II2011-06-30T02:40:57Z<p>DavidLazar: /* Where */ add missing word</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* Calagator : FIXME add url<br />
<br />
== When ==<br />
Friday Sept 22 10:00AM to 5:30 PM<br />
Saturday Sept 23 10:00AM to 5:30 PM<br />
Sunday Sept 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you need someone walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
Go to the [[/Registration|HacPDX Registration]] page and add your name<br />
as an attendee - the selected room can fit a population in the<br />
fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12, 44, and 17 all stop right outside the Fourth Avenue<br />
Building. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II&diff=40711HacPDX-II2011-06-30T02:37:54Z<p>DavidLazar: /* Where */ fix link</p>
<hr />
<div>'''July 22-24 2011'''<br />
<br />
Portland, Oregon, USA<br />
<br />
== About ==<br />
<br />
HacPDX-II is an opportunity to join Portland Haskell hackers in<br />
building and improving Hackage libraries and tools. The project you hack on can<br />
be anything and need-not be pre-existing or general community tools.<br />
<br />
== Communication Channels ==<br />
<br />
During the event, you can reach us at<br />
<br />
irc://irc.freenode.net/#hacpdx<br />
.. phone number to be announced ..<br />
thomas.dubuisson+hacpdx at gmail.com<br />
<br />
Also, check the [[/Projects|projects]] page as we update it to see what is happening.<br />
<br />
== Publicity ==<br />
<br />
* Calagator : FIXME add url<br />
<br />
== When ==<br />
Friday Sept 22 10:00AM to 5:30 PM<br />
Saturday Sept 23 10:00AM to 5:30 PM<br />
Sunday Sept 24 10:00AM to 5:30 PM<br />
<br />
We can work however late, but tentatively let's plan on eating, drinking and sleeping.<br />
<br />
== Where ==<br />
<br />
We will be in room 10 (downstairs) of the<br />
[http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=109280870257923598159.00047041b966a19099376&ll=45.506933,-122.682095&spn=0.022768,0.055661&z=15 fourth avenue building], which is part of Portland State University.<br />
<br />
As the building is locked during the weekends, Attendees we be let in<br />
via the Harrison Street entrance. If you someone walk to a different<br />
entrance to get you then you owe them a quine in Haskell.<br />
<br />
== Equipment ==<br />
<br />
You should bring a laptop with wireless (802.11). The room has<br />
whiteboards and a projector for any discussions or should anyone wish<br />
to give a talk.<br />
<br />
== News ==<br />
* 29Jun2011 - Announced HacPDX... #2. Only one month later than intended (note the similarity to HacPDX #1).<br />
<br />
== Registration ==<br />
<br />
Go to the [[/Registration|HacPDX Registration]] page and add your name<br />
as an attendee - the selected room can fit a population in the<br />
fourties.<br />
<br />
Be sure to list any [[/Projects|projects]] in which you're interested!<br />
<br />
== Food ==<br />
<br />
There are restaurants and food carts in easy walking distance of the venue.<br />
<br />
Some examples:<br />
* Hot Lips Pizza, SW 6th and Hall (2 blocks away)<br />
* Taco Del Mar (next door)<br />
* Baan Thai, SW College and Broadway<br />
* Thanh Long, SW College and Broadway (Vietnamese)<br />
* Chipotle, SW College and Broadway<br />
* Cheerful Tortoise, SW College and Broadway (beer and grease)<br />
* Carts all along 4th across from the FAB.<br />
<br />
== Travel ==<br />
Buses 12, 44, and 17 all stop right outside the Fourth Avenue<br />
Building. The Yellow and Green Lines of the MAX stop a few blocks<br />
away. If you're biking from the east side just take Hawthorne bridge,<br />
a left on first, and a right on Harrison - the building is on the<br />
corner of Harrison and 4th.<br />
<br />
If you want to attend and are coming from outside of Portland feel<br />
free to ask for a hand.<br />
<br />
== Organizers ==<br />
<br />
* Thomas DuBuisson (irc: TomMD, e-mail: Thomas.DuBuisson+hacpdx@gmail.com)<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HacPDX-II/Attendees&diff=40710HacPDX-II/Attendees2011-06-30T02:34:35Z<p>DavidLazar: add myself as an attendee</p>
<hr />
<div>{| class="wikitable"<br />
! Name<br />
! Number<br />
! E-mail<br />
! IRC<br />
! Days Attending<br />
|-<br />
| Thomas DuBuisson<br />
| <br />
| Thomas.DuBuisson+hacpdx@gmail.com<br />
| TomMD<br />
| ALL<br />
|-<br />
| David Lazar<br />
|<br />
| (\x -> x@illinois.edu) lazar6<br />
| davidL<br />
| ALL<br />
|}</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Shootout/Nsieve&diff=33957Shootout/Nsieve2010-03-04T18:06:24Z<p>DavidLazar: fix table</p>
<hr />
<div>A ShootoutEntry for the [http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=all nsieve benchmark]<br />
<br />
diff program output N = 2 with [http://shootout.alioth.debian.org/gp4/iofile.php?test=nsieve&lang=all&file=output this output file] to check your program is correct before contributing.<br />
<br />
Each program should count the prime numbers from 2 to M, using the same nave Sieve of Eratosthenes algorithm:<br />
<br />
* create a sequence of M boolean flags<br />
* for each index number<br />
** if the flag value at that index is true<br />
*** set all the flag values at multiples of that index false<br />
*** increment the count<br />
<br />
Calculate 3 prime counts, for M = 2N 10000, 2N-1 10000, and 2N-2 10000.<br />
<br />
The basic benchmark was described in "A High-Level Language Benchmark." BYTE, September 1981, p. 180, Jim Gilbreath.<br />
<br />
Of course, there are more efficient implementations of the Sieve of Eratosthenes, and there are more efficient ways to sieve prime numbers, for example "Prime sieves using binary quadratic forms".<br />
<br />
For more information see Eric W. Weisstein, [http://mathworld.wolfram.com/SieveofEratosthenes.html "Sieve of Eratosthenes."] From [http://mathworld.wolfram.com/PrimeCountingFunction.html MathWorld PrimeCountingFunction]--A Wolfram Web Resource.<br />
<br />
<br />
== Benchmarks ==<br />
<br />
Debian Linux/x86, N=10<br />
<br />
{| border="1"<br />
! Entry !! Time<br />
|-<br />
| Old || 1.961<br />
|-<br />
| New || 0.669<br />
|}<br />
<br />
== Alternative entry ==<br />
<br />
Use ST.<br />
<br />
<haskell><br />
{-# OPTIONS -O2 -optc-O -fbang-patterns #-}<br />
--<br />
-- The Computer Language Shootout<br />
-- http://shootout.alioth.debian.org/<br />
--<br />
-- Contributed by Don Stewart<br />
-- nsieve over an ST monad Word8 array<br />
--<br />
<br />
import Control.Monad.ST<br />
import Data.Array.ST<br />
import Data.Array.Base<br />
import System<br />
import Control.Monad<br />
import Data.Bits<br />
import Data.Word<br />
import Text.Printf<br />
<br />
main = do<br />
n <- getArgs >>= readIO . head :: IO Int<br />
mapM_ (\i -> sieve (10000 `shiftL` (n-i))) [0, 1, 2]<br />
<br />
sieve n = do<br />
let r = runST (do a <- newArray (2,n) 0 :: ST s (STUArray s Int Word8)<br />
go a n 2 0)<br />
printf "Primes up to %8d %8d\n" (n::Int) (r::Int) :: IO ()<br />
<br />
go !a !m !n !c<br />
| n == m = return c<br />
| otherwise = do<br />
e <- unsafeRead a n<br />
if e == 0 then set (n `shiftL` 1)<br />
else go a m (n+1) c<br />
where<br />
set !j<br />
| j < m = unsafeWrite a j 1 >> set (j+n)<br />
| otherwise = go a m (n+1) (c+1)<br />
<br />
</haskell><br />
<br />
== Current entry ==<br />
<br />
Following the spec, uses Word8's to represent bools. Instead of IOUArray<br />
Int Word8, which has a slow initialisation phase, we use a ByteString,<br />
and call memset to init. Faster than unoptimised C.<br />
<br />
The GHC native code gen seems to do a better job on this one.<br />
<br />
<haskell><br />
{-# OPTIONS -O2 -fasm -fbang-patterns #-}<br />
--<br />
-- The Computer Language Shootout<br />
-- http://shootout.alioth.debian.org/<br />
--<br />
-- Contributed by Don Stewart.<br />
-- Uses Word8 values to represent Bools, avoiding a bit-packing Array Bool<br />
--<br />
<br />
import System<br />
import Foreign<br />
import Data.ByteString.Internal<br />
import Data.ByteString.Unsafe (unsafeIndex)<br />
import Text.Printf<br />
<br />
main = do<br />
n <- getArgs >>= readIO . head<br />
mapM_ (sieve . (10000 *) . (2 ^)) ([n, n-1, n-2] :: [Int])<br />
<br />
sieve n = do<br />
a <- create n $ \p -> memset p 0 (fromIntegral n) >> return ()<br />
r <- go n a 0 2<br />
printf "Primes up to %8d %8d\n" (n::Int) (r::Int)<br />
<br />
go m !a !c !n<br />
| n == m = return c<br />
| true a n = go m a c (n+1)<br />
| otherwise = set (n+n)<br />
where<br />
set !j | j <= m = false a j >> set (j+n)<br />
| otherwise = go m a (c+1) (n+1)<br />
<br />
true !a !n = unsafeIndex a n == 1<br />
false (PS fp _ _) !n = withForeignPtr fp $ \p -> pokeByteOff p n (1 :: Word8)<br />
</haskell><br />
<br />
== IOUArrays ==<br />
<br />
A bit slower than using ByteStrings, since the initialisation phase is poor.<br />
<br />
<haskell><br />
{-# OPTIONS -fbang-patterns #-}<br />
--<br />
-- The Computer Language Shootout<br />
-- http://shootout.alioth.debian.org/<br />
--<br />
-- Contributed by Don Stewart<br />
-- Uses Word8 values to represent Bools, avoiding a bit-packing Array Bool<br />
--<br />
<br />
import System<br />
import Data.Array.IO<br />
import Data.Array.Base<br />
import Text.Printf<br />
import Word<br />
<br />
main = do<br />
n <- getArgs >>= readIO . head<br />
mapM_ (sieve . (10000 *) . (2 ^)) [n, n-1, n-2]<br />
<br />
sieve n = do<br />
a <- newArray (2,n) 0 :: IO (IOUArray Int Word8) -- avoid bit packing Bool type<br />
r <- go n a 0 2<br />
printf "Primes up to %8d %8d\n" (n::Int) (r::Int)<br />
<br />
go m !a !c !n<br />
| n == m = return c<br />
| otherwise = do<br />
e <- unsafeRead a n<br />
if e == 0<br />
then let loop !j | j <= m = unsafeWrite a j 1 >> loop (j+n)<br />
| otherwise = go m a (c+1) (n+1)<br />
in loop (n+n)<br />
else go m a c (n+1)<br />
</haskell><br />
<br />
== Illegal entry ==<br />
<br />
Ported to GHC 6.6<br />
[http://alioth.debian.org/tracker/index.php?func=detail&aid=304422&group_id=30402&atid=411646 Submitted]<br />
<br />
Uses bit packing, so is instead the nsieve-bits entry.<br />
<br />
<haskell><br />
{-# OPTIONS -fbang-patterns #-}<br />
--<br />
-- The Computer Language Shootout<br />
-- http://shootout.alioth.debian.org/<br />
--<br />
-- Contributed by Don Stewart<br />
-- Nsieve over a Bool array<br />
--<br />
<br />
import Data.Array.IO<br />
import Data.Array.Base<br />
import System<br />
import Text.Printf<br />
<br />
main = do<br />
n <- getArgs >>= readIO . head :: IO Int<br />
mapM_ (sieve . (10000 *) . (2 ^)) [n, n-1, n-2]<br />
<br />
sieve n = do<br />
a <- newArray (2,n) True :: IO (IOUArray Int Bool) -- an array of Bool<br />
r <- go a n 2 0<br />
printf "Primes up to %8d %8d\n" (n::Int) (r::Int) :: IO ()<br />
<br />
go !a !m !n !c<br />
| n == m = return c<br />
| otherwise = do<br />
e <- unsafeRead a n<br />
if e<br />
then let loop !j<br />
| j <= m = unsafeWrite a j False >> loop (j+n)<br />
| otherwise = go a m (n+1) (c+1)<br />
in loop (n+n)<br />
else go a m (n+1) c<br />
</haskell><br />
<br />
== Old entry ==<br />
<br />
Studying the Core shows the the mapM was preventing things from being<br />
unboxed properly. Big speedup. The extra `seqs` also help the unboxing.<br />
Should be around the fastest entry now.<br />
<br />
''Is anyone else bothered by the usage of unsafeWrite? I agree that<br />
excellent speed is being gained, but this speed is gained at the cost<br />
of functional-style coding. I'm a novice Haskeller, but using unsafeWrite<br />
seems like an imperative hack to gain speed.'' -- AlsonKemp<br />
<br />
''Response: unsafeWrite is just the same as a normal array update,<br />
without an extraneous bounds check (since it's already performed in the<br />
outer loop). We're just avoiding redundant computation (as we do in all<br />
entries for this problem). SPJ actually recommends unsafe* ops in<br />
arrays, see the "loop performance bug" thread in the haskell mail<br />
archives from 2005. <br />
<br />
In summary, its not a hack -- the name just makes clear that you have to<br />
do your own bounds check (Haskell is good at letting you know when there<br />
are extra proof considerations for the programmer to take). Since this<br />
program runs [http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=all faster than GCC], then I think we should not be worried<br />
about avoiding a redundant bounds check :)'' -- DonStewart<br />
<br />
<haskell><br />
--<br />
-- $Id: nsieve-ghc.code,v 1.27 2006/01/08 22:44:56 igouy-guest Exp $<br />
-- Written by Einar Karttunen, optimised further by Don Stewart<br />
--<br />
<br />
import Data.Array.IO; import Data.Array.Base; import Data.Bits; import System; import Text.Printf<br />
<br />
main = (\n -> mapM_ (sieve.(10000 *).shiftL 1) [n,n-1,n-2]) . read . head =<< getArgs<br />
<br />
sieve m = do c <- newArray (2,m) True >>= \a -> loop a m 2 0<br />
printf "Primes up to %8d %8d\n" (m::Int) (c::Int) :: IO ()<br />
<br />
loop arr m n c | arr `seq` m `seq` n `seq` c `seq` False = undefined<br />
loop arr m n c = if n == m then return c else do<br />
el <- unsafeRead arr n<br />
if el then let loop' j | j > m = loop arr m (n+1) (c + 1)<br />
| otherwise = unsafeWrite arr j False >> loop' (j+n)<br />
in loop' (n+n)<br />
else loop (arr :: IOUArray Int Bool) m (n+1) c<br />
</haskell><br />
<br />
== Entry 2 ==<br />
<br />
Shortest entry in any language<br />
<br />
<haskell><br />
{-# OPTIONS -O2 -optc-O3 #-}<br />
<br />
-- $Id: nsieve-ghc.code,v 1.27 2006/01/08 22:44:56 igouy-guest Exp $<br />
-- Written by Einar Karttunen, shortened by Don Stewart<br />
<br />
import Data.Array.IO; import Data.Array.Base; import Data.Bits; import System; import Text.Printf<br />
<br />
loop arr m n c = if n == m then return c else do<br />
el <- unsafeRead arr n<br />
if el then do mapM_ (flip (unsafeWrite arr) False) (tail [n,n+n..m])<br />
loop arr m (n+1) $! c + 1<br />
else loop (arr :: IOUArray Int Bool) m (n+1) c<br />
<br />
sieve m = do c <- newArray (2,m) True >>= \a -> loop a m 2 0<br />
printf "Primes up to %8d %8d\n" (m::Int) (c::Int) :: IO ()<br />
<br />
main = (\n -> mapM_ (sieve.(10000 *).shiftL 1) [n,n-1,n-2]) . read . head =<< getArgs<br />
</haskell><br />
<br />
== Original entry ==<br />
<br />
<haskell><br />
{-# OPTIONS -O2 -optc-O3 #-}<br />
<br />
-- $Id: nsieve-ghc.code,v 1.27 2006/01/08 22:44:56 igouy-guest Exp $<br />
-- written by Einar Karttunen<br />
<br />
import Data.Array.IO<br />
import Data.Array.Base<br />
import Data.Bits (shiftL)<br />
import System (getArgs)<br />
<br />
loop :: IOUArray Int Bool -> Int -> Int -> Int -> IO Int<br />
loop arr m n c | n == m = return c<br />
| otherwise = do el <- unsafeRead arr n<br />
if el then do mapM_ (\i -> unsafeWrite arr i False) (tail [n,n+n..m])<br />
loop arr m (n+1) $! c+1<br />
else do loop arr m (n+1) c<br />
<br />
fmt width i = let is = show i in (replicate (width - length is) ' ') ++ is<br />
<br />
sieve n = do let m = (1 `shiftL` n) * 10000<br />
arr <- newArray (2,m) True<br />
c <- loop arr m 2 0<br />
putStrLn ("Primes up to "++fmt 8 m++" "++fmt 8 c)<br />
<br />
main = do n <- getArgs >>= readIO.head<br />
sieve n >> sieve (n-1) >> sieve (n-2)<br />
<br />
</haskell><br />
<br />
[[Category:Code]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Let_vs._Where&diff=33956Let vs. Where2010-03-04T17:53:03Z<p>DavidLazar: spelling/typos</p>
<hr />
<div>Haskell programmers often wonder, whether to use <hask>let</hask> or <hask>where</hask>.<br />
This seems to be only a matter of taste in the sense of "[[Declaration vs. expression_style]]",<br />
however there is more about it.<br />
<br />
It is important to know that <hask>let ... in ...</hask> is an expression,<br />
that is, it can be written wherever expressions are allowed.<br />
In contrast to that, <hask>where</hask> is bound to a surrounding syntactic construct,<br />
like the [[pattern matching]] line of a function definition.<br />
<br />
== Advantages of let ==<br />
<br />
Consider you have the function<br />
<haskell><br />
f :: s -> (a,s)<br />
f x = y<br />
where y = ... x ...<br />
</haskell><br />
and later you decide to put this into the <hask>Control.Monad.State</hask> monad.<br />
However, transforming to<br />
<haskell><br />
f :: State s a<br />
f = State $ \x -> y<br />
where y = ... x ...<br />
</haskell><br />
will not work, because <hask>where</hask> refers to the pattern matching <hask> f = </hask>,<br />
where no <hask>x</hask> is in scope.<br />
<br />
In contrast, if you had started with <hask>let</hask>, then you wouldn't have trouble.<br />
<haskell><br />
f :: s -> (a,s)<br />
f x =<br />
let y = ... x ...<br />
in y<br />
</haskell><br />
This is easily transformed to:<br />
<haskell><br />
f :: State s a<br />
f = State $ \x -><br />
let y = ... x ...<br />
in y<br />
</haskell><br />
<br />
== Advantages of where ==<br />
<br />
Because "where" blocks are bound to a syntactic construct, they can be used to share bindings between parts of a function that are not syntactically expressions. For example:<br />
<br />
<haskell><br />
f x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
where<br />
a = w x<br />
</haskell><br />
<br />
In expression style, you might use an explicit <hask>case</hask>:<br />
<br />
<haskell><br />
f x<br />
= let a = w x<br />
in case () of<br />
_ | cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
</haskell><br />
<br />
or a [[Case|functional equivalent]]:<br />
<br />
<haskell><br />
f x =<br />
let a = w x<br />
in select (f (h x a))<br />
[(cond1 x, a),<br />
(cond2 x, g a)]<br />
</haskell><br />
<br />
or a series of if-then-else expressions:<br />
<br />
<haskell><br />
f x<br />
= let a = w x<br />
in if cond1 x<br />
then a<br />
else if cond2 x<br />
then g a<br />
else f (h x a)<br />
</haskell><br />
<br />
These alternatives are arguably less readable and hide the structure of the function more than simply using <hask>where</hask>.<br />
<br />
== Lambda Lifting ==<br />
<br />
One other approach to consider is that let or where can often be implemented using [[lambda lifting]] and [[let floating]], incurring at least the cost of introducing a new name. The above example:<br />
<br />
<haskell><br />
f x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
where<br />
a = w x<br />
</haskell><br />
<br />
could be implemented as:<br />
<br />
<haskell><br />
f x = f' (w x) x<br />
<br />
f' a x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
</haskell><br />
<br />
The auxiliary definition can either be a top-level binding, or included in f using <hask>let</hask> or <hask>where</hask>.<br />
<br />
[[Category:Style]]<br />
[[Category:Syntax]]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=HAppS_tutorial2&diff=21174HAppS tutorial22008-06-05T04:35:51Z<p>DavidLazar: tiny changes for consistency</p>
<hr />
<div>[[Category:Tutorials]]<br />
<br />
Most of the stuff on this page refers to HAppS 0.9.1.2 or greater.<br />
This is the most recent development version at the time of this<br />
writing. There is another tutorial for HAppS 0.8.8 at [[HAppS tutorial]]. Start there to get a background. This page is dedicated to the things that have changed in the newer versions.<br />
<br />
Author's Note: This page will be in various states of disrepair for awhile. I'm creating this document as I am learning HAppS, so it may reflect my inaccurate perceptions. Some of the information on this page MAY EVEN BE WRONG. If you know it's wrong, I would be grateful for your help in improving it.<br />
<br />
Second Author's Note: This is by NO means a complete list. The best reference (that I've found so far) is, in the source, SimpleHTTP.hs - it has everything listed here, and more.<br />
<br />
[http://happs.org/ HAppS] is a framework for developing Internet<br />
services quickly, deploying them easily, scaling them massively, and<br />
managing them effortlessly. Web, persistence, mail, DNS and database<br />
servers are all built-in so you can focus on app development rather<br />
than integrating and babysitting lots of different servers/services<br />
(the Haskell type system keeps everything consistent).<br />
<br />
== Introduction ==<br />
<br />
The basic web server framework in HAppS consists of a call to simpleHTTP that is passed a list of ServerParts that define the available pages. simpleHTTP searches through the ServerParts and returns the response generated by the first matching ServerPart. Typically ServerParts will match based on some part of the request URL.<br />
<br />
The ServerPart is the workhorse of defining HAppS actions. The <br />
biggest goal of this document is to provide a useful guide to the<br />
ServerPart primitives that are available.<br />
<br />
<br />
----<br />
<br />
===Fundamental Data Types===<br />
<br />
Need better explanations here.<br />
<br />
Author's Note: Due to my inexperience with Monads, these explanations are probably lacking. Feel free to improve them.<br />
<br />
These data types provide the framework for converting a Request into a Result in a structured way.<br />
<br />
====WebT====<br />
<haskell><br />
newtype WebT m a = WebT { unWebT :: m (Result a) }<br />
</haskell><br />
<br />
A WebT is a computation that generates a result.<br />
<br />
====ServerPartT====<br />
<br />
<haskell><br />
newtype ServerPartT m a = ServerPartT { unServerPartT :: Request -> WebT m a }<br />
</haskell><br />
<br />
A ServerPartT is a function that converts a Request into a WebT.<br />
<br />
===Basic ServerPart Functions===<br />
<br />
====High-level description====<br />
<br />
Currently, these ServerPart primitives are defined in SimpleHTTP.hs. They were recently moved there from AlternativeHTTP.hs.<br />
<br />
* dir - match a directory at the front of the URL<br />
* path - another way to match a URL directory<br />
* multi - run a list of server parts<br />
* method - runs a server part if the request has the specified method<br />
* withRequest - builds a ServerPartT from a WebT<br />
* anyRequest - runs a ServerPartT no matter what the request was<br />
* withData - retrieve data from the input query or the cookies<br />
* withDataFn - retrieve data from the input query or the cookies<br />
* applyRequest<br />
* ok<br />
* toResponse<br />
* fileServe - a generic file server that returns files from the local file system as responses<br />
<br />
====dir====<br />
<br />
<haskell><br />
dir :: Monad m => String -> [ServerPartT m a] -> ServerPartT m a<br />
</haskell><br />
<br />
The first argument is matched to the first directory element in the path URL. If it matches, then the ServerParts in the second argument are run.<br />
<br />
<haskell><br />
module Main where<br />
<br />
import HAppS.Server<br />
<br />
impl = [ dir "test" [ dir "me" [ anyRequest $ ok $ toResponse "/test/me matched." ]<br />
, anyRequest $ ok $ toResponse "/test matched."] ]<br />
<br />
main = simpleHTTP nullConf { port = 8080 } impl<br />
</haskell><br />
<br />
===== compiling the "dir"-example =====<br />
Suppose you have saved the "dir"-example in the file dir_test.hs.<br />
Then you can compile with <br />
<br />
ghc --make dir_test.hs -o dir_test<br />
<br />
run it with ./dir_test and watch the result on your browser through<br />
http://localhost:8080/test/me<br />
<br />
<br />
====path====<br />
<br />
<haskell><br />
path :: (FromReqURI a, Monad m) => (a -> [ServerPartT m r]) -> ServerPartT m r<br />
</haskell><br />
<br />
Similar to dir except instead of passing a String and a list of ServerParts, you pass a function that returns a list of ServerParts.<br />
<br />
FromReqURI is a type class that facilitates the conversion of data in the URI to Haskell types. The basic types are are already members of the class.<br />
<br />
<haskell><br />
module Main where<br />
<br />
import HAppS.Server<br />
<br />
handleProjectById :: Int -> [ServerPart Response]<br />
handleProjectById id = [ anyRequest $ ok $ toResponse $ "Project num " ++ show id ++ " addressed."]<br />
<br />
handleProjectByTag :: String -> [ServerPart Response]<br />
handleProjectByTag tag = [ anyRequest $ ok $ toResponse $ "Project tag " ++ show tag ++ " addressed."]<br />
<br />
impl = [ dir "projects"<br />
[ path $ handleProjectById<br />
, path $ handleProjectByTag ]<br />
]<br />
<br />
main = simpleHTTP nullConf { port = 8080 } impl<br />
<br />
</haskell><br />
====multi====<br />
<br />
<haskell><br />
multi :: Monad m => [ServerPartT m a] -> ServerPartT m a<br />
<br />
</haskell><br />
<br />
Returns a ServerPart that runs the list of ServerParts supplied in the first argument.<br />
<br />
====method====<br />
<br />
<haskell><br />
method :: (MatchMethod method, Monad m) => method -> WebT m a -> ServerPartT m a<br />
</haskell><br />
<br />
Filters for a specific request method. <br />
<br />
An important note: '''method also prevents further matching on the request URL. This means you must capture (using path, dir, etc) the entire url before using method.''' This is useful, however, as method GET alone will match "/" (which cannot be matched with dir).<br />
<br />
Below example illustrates handling different kind of request methods.<br />
<br />
<haskell><br />
module Main where<br />
<br />
import HAppS.Server<br />
import Control.Monad (mplus)<br />
import Text.XHtml hiding (method, dir)<br />
import qualified Text.XHtml as H<br />
<br />
-- a page for gathering comments<br />
commentPage :: Html<br />
commentPage = body <<<br />
(toHtml "Please give us your opinions:" +++<br />
(form ! [H.method "POST"] <<<br />
[ textarea ! [strAttr "name" "comment", strAttr "cols" "50", strAttr "rows" "12"] << ""<br />
, br, input ! [strAttr "type" "submit"]]))<br />
<br />
resultPage :: String -> Html<br />
resultPage str = body <<<br />
(toHtml "Thank you for your comments." +++<br />
blockquote << (p << str))<br />
<br />
processComment (Comment str) = [ anyRequest $ ok $ resultPage str ]<br />
<br />
-- comment as a data type<br />
newtype Comment = Comment String<br />
instance FromData Comment where<br />
fromData = do c <- look "comment" `mplus` return "No comment."<br />
return (Comment c)<br />
<br />
unauthMethods = (`elem` [CONNECT,TRACE,HEAD])<br />
impl = [ dir "comment" [ method GET $ ok commentPage<br />
, methodSP POST $ withData processComment<br />
, method () $ ok $ toHtml "Service not implemented for this type of method."]<br />
, method unauthMethods $ unauthorized $ toHtml "You're not authorized."]<br />
<br />
main = simpleHTTP nullConf { port = 8080 } impl<br />
<br />
</haskell><br />
<br />
We can see the behaviour from shell (note, html output omitted):<br />
<pre><br />
quad% curl -X CONNECT http://localhost:8080/<br />
You're not authorized.<br />
<br />
quad% curl -X OPTIONS http://localhost:8080/comment<br />
Service not implemented for this type of method.<br />
</pre><br />
<br />
====methodSP====<br />
identical to method, except for it takes a ServerPart T instead of a WebPart T<br />
<br />
====withRequest====<br />
<haskell><br />
withRequest :: (Request -> WebT m a) -> ServerPartT m a<br />
</haskell><br />
<br />
Since a ServerPartT is an encapsulation for a function (Request -> WebT), the withRequest function acts as a ServerPartT constructor.<br />
<br />
====anyRequest====<br />
<haskell><br />
anyRequest :: Monad m => WebT m a -> ServerPartT m a<br />
anyRequest x = withRequest $ \_ -> x<br />
<br />
</haskell><br />
<br />
anyRequest uses withRequest to construct a ServerPartT from the supplied WebT.<br />
<br />
====withData====<br />
withData provides a mechanism for retrieving structured data from a request. The first argument to withData is a function that takes a FromData instance in and returns [ServerPartT]. FromData is defined as follows.<br />
<br />
<haskell><br />
class FromData a where<br />
fromData :: RqData a<br />
</haskell><br />
<br />
So all you have to do to use withData is implement a fromData function for your data structure. fromData returns RqData which is a ReaderT that builds a computation that can get your type from the data in the request. HAppS provides several functions to use in constructing a fromData function for your data type. These functions are:<br />
<br />
* lookInput<br />
* lookBS<br />
* look<br />
* lookCookie<br />
* lookCookieValue<br />
* readCookieValue<br />
* lookRead<br />
* lookPairs<br />
<br />
Here is an excerpt from one of the HAppS examples that illustrates the concept.<br />
<br />
<haskell><br />
data MyStructure = MyStructure String<br />
instance FromData MyStructure where<br />
fromData = do str <- look "str"<br />
return $ MyStructure str<br />
<br />
main = do simpleHTTP nullConf { port = 8080 }<br />
[ withData $ \(MyStructure str) -><br />
[ anyRequest $ ok $ "You entered: " ++ str ]<br />
, anyRequest $ ok "Sorry, I don't understand." ]<br />
</haskell><br />
<br />
In this example, the look function gets the contents of the variable "str" passed in the request.<br />
http://localhost:8080/?str=foo<br />
<br />
====fileServe====<br />
<haskell><br />
fileServe :: MonadIO m => [FilePath] -> FilePath -> ServerPartT m Response<br />
</haskell><br />
<br />
Creates a ServerPartT computation that serves files in the local filesystem. The first argument is a list of filenames to serve. The second argument is a path to the local directory where those files reside.<br />
<br />
====seeOther====<br />
<haskell><br />
seeOther :: (Monad m, ToSURI uri) => uri -> res -> WebT m res<br />
</haskell><br />
preformes an http redirect to uri. returns res (a response).<br />
<br />
===Error Codes===<br />
* badRequest<br />
* unauthorizied<br />
* notFound<br />
* seeOther<br />
* found<br />
* movedPermanently<br />
* tempRedirect<br />
<br />
==Working with State==<br />
NOTE: This section is in progress.<br />
<br />
* startSystemState - call this function to select an entry point<br />
* query - get the state<br />
* update - change the state<br />
<br />
The query and update functions provide all the mechanisms needed to work with state.<br />
<br />
HAppS works with state by working with functions that manipulate the state. Lemmih has described it as follows, "[Google's] BigTable pushes data on several machines in a parallel manner. HAppS pushes functions around on several machines in a parallel manner." On a single machine, HAppS keeps a transaction log by storing the functions that modified the state. In order to do this, those functions must be serialized.<br />
<br />
Because of this, the query and update functions take QueryEvents and UpdateEvents as a parameter. These functions are typically generated by the TemplateHaskell mkMethods function to eliminate the need to write the above mentioned serialization code. Calls to mkMethods look like the following (taken from AllIn.hs):<br />
<br />
<haskell><br />
$(mkMethods ''UserComponent ['getComponent,'setComponent])<br />
$(mkMethods ''SingletonComponent ['setSingleton,'getSingleton])<br />
</haskell><br />
<br />
The lists in the second arguments are lists of the names of functions for which QueryEvents and UpdateEvents are to be created. QueryEvents and UpdateEvents are created from functions that return a MonadReader and MonadState respectively.<br />
<br />
====Other Things To Check Out====<br />
Blog series by the first author, detailing the creation of an application to handle users:<br />
<br />
[http://softwaresimply.blogspot.com/ Working with HAppS]<br />
<br />
<br />
Blog post by second author, expanding upon what was in the first post series:<br />
<br />
[http://dbpatterson.com/blog/4711386806 Building With HAppS - Part 1 - More User Functionality]</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Yhc/RTS/Modules&diff=20485Yhc/RTS/Modules2008-04-08T21:19:45Z<p>DavidLazar: typos</p>
<hr />
<div>{{Yhc}}<br />
<br />
In YHC modules are loaded at runtime by yhi from .hbc bytecode files. For a precise specification of the bytecode format see [[Yhc/RTS/hbc]]. <br />
<br />
This file details how the loading process works, to see what structures are loaded into memory by the module system see [[Yhc/RTS/Heap]].<br />
<br />
== Loading by demand ==<br />
<br />
The program starts by loading the module with the 'main' function in it. Statically main will have a list of functions that it might call at runtime, these functions are loaded and their dependencies chased similarly. This is all handled by the code in "module.c" in src/runtime/BCKernel.<br />
<br />
Yhi is careful to only load functions from the bytecode that could potentially be used, so as to minimize runtime memory use. Resolution then proceeds as follows:<br />
<br />
* Suppose the runtime needs to load "Prelude.foldr" first it would open the right Prelude.hbc file and minimally load it, if it isn't loaded already.<br />
<br />
* To minimally load a module:<br />
** first the module string table is read from the .hbc file. The string table associates each unique string index with a StringRef. A StringRef holds either the contents of the loaded string or an offset to where it can be found in the file. When the module is first loaded only the offsets are loaded into the string table.<br />
** Then when the actual string data for a string is needed later on in the process the string table will either return the stored string data or it will go to the right place in the file and load the string data.<br />
** Having read the string table the object table is read. Again a similar trick is used the object table associates object indexes with ObjectRefs, and again ObjectRefs hold either the object data or its file offset. <br />
** However this time a lookup table is used to map object names to object indexes. Note that this will cause the strings representing object names to be loaded as a side effect.<br />
<br />
* Having minimally loaded the Prelude module the resolution process would use the module lookup table to resolve 'foldr' to a object index. Using this index the corresponding ObjectRef would be looked up in the object table. The ObjectRef either has the object data associated with it or not. If not then the data is loaded from the offset of the file specified by the ObjectRef.<br />
<br />
* Since Prelude.foldr is a function it has a function constant table. Thus table is loaded with the bytecode instructions for foldr and all the names referenced in the constant table are resolved. In this manor the process continues recursively. <br />
<br />
* Cyclic dependencies are handled by updating the object data associated with an ObjectRef before recursing to load it's dependencies; even though the object data might not be fully loaded yet.</div>DavidLazarhttps://wiki.haskell.org/index.php?title=DDC/ClassSystem&diff=20484DDC/ClassSystem2008-04-08T21:11:17Z<p>DavidLazar: typo</p>
<hr />
<div>== Regions ==<br />
In short, two pieces of data are in different regions if they are never substituted for each other. This property, or lack thereof, is sometimes called ''aliasing''.<br />
<br />
Data type constructors have a region annotation as their first argument, which indicates what region they're in. Due to type elaboration, we usually don't see the region annotations, but we can write them in signatures if we want to:<br />
<br />
<haskell><br />
succ :: forall %r1 %r2. Int %r1 -> Int %r2<br />
succ x = x + 1<br />
<br />
sameInt :: forall %r1. Int %r1 -> Int %r1<br />
sameInt x = x<br />
<br />
pi :: Float %r1<br />
pi = 3.1415926535<br />
</haskell><br />
<br />
Region variables can be quantified with <hask>forall</hask> much like type variables. If a region variable in the return type of a function is quantified it means the region is ''fresh'', ie the data was allocated by the function itself. <br />
<br />
Notice that in the type of <hask>succ</hask>, both <hask>%r1</hask> and <hask>%r2</hask> are quantified, this means that <hask>succ</hask> accepts data from any region and returns a freshly allocated <hask>Int</hask>.<br />
<br />
<hask>sameInt</hask> just passes its data though, so the same region is on both argument and return types.<br />
<br />
<hask>pi</hask> is just static <hask>Float</hask> and not a function that does allocation, so it doesn't have a <hask>forall</hask>.<br />
<br />
== Region classes ==<br />
In Haskell we use type classes on type variables to restrict how these variables can be instantiated.<br />
<haskell><br />
(==) :: forall a. Eq a => a -> a -> Bool<br />
</haskell><br />
<br />
The <hask>Eq a</hask> here restricts 'forall a' to just the types that support equality.<br />
<br />
In Disciple, we can do a similar thing with regions:<br />
<haskell><br />
succ :: forall %r1 %r2<br />
. Int %r1 -> Int %r2<br />
:- Const %r1<br />
</haskell><br />
<br />
The ''region class'' constraint <hask>Const %r1</hask> restricts <hask>succ</hask> so that it only accepts arguments which are constant. Data in <hask>Const</hask> regions is guaranteed by the type system never to be destructively updated. In Disciple we write the class constraints at the end of the type for clarity, though there is a [http://code.google.com/p/disciple/issues/detail?id=103 (ticket)] to allow the standard Haskell syntax as well.<br />
<br />
The opposite of <hask>Const</hask> is <hask>Mutable</hask> and we can explicitly define data values to have this property.<br />
<br />
<haskell><br />
counter :: Int %r1 :- Mutable %r1<br />
counter = 0<br />
</haskell><br />
<br />
Any <hask>Int</hask> that is passed to <hask>succ</hask> is required to be <hask>Const</hask>. If you try and pass a <hask>Mutable</hask> <hask>Int</hask> instead it will be caught by the type system.<br />
<br />
<haskell><br />
main ()<br />
= do out $ succ counter<br />
</haskell><br />
<br />
<pre><br />
./Main.ds:...<br />
Conflicting region constraints.<br />
constraint: Base.Mutable %1<br />
from the use of: counter<br />
at: ./Main.ds:...<br />
<br />
conflicts with,<br />
constraint: Base.Const %2<br />
from the use of: succ<br />
at: ./Main.ds:...<br />
</pre><br />
<br />
== Effect purification ==<br />
Besides manually added annotations, the main source of <hask>Const</hask> constraints in a Disciple program is the use of laziness. Remember from [[DDC/EvaluationOrder|EvaluationOrder]] that the suspension operator <hask>(@)</hask> maps onto a set of primitive <hask>suspend</hask> functions.<br />
<br />
If we wanted a lazy version of <hask>succ</hask> that only incremented its argument when the result was demanded, then we could write it like this:<br />
<br />
<haskell><br />
lazySucc x = (+) @ x 1<br />
</haskell><br />
<br />
this is desugared to:<br />
<br />
<haskell><br />
lazySucc x = suspend2 (+) x 1<br />
</haskell><br />
<br />
where <hask>suspend2</hask> has the following type (ignoring closure information once again)<br />
<br />
<haskell><br />
suspend2<br />
:: forall a b c !e1 !e2<br />
. (a -(!e1)> b -(!e2)> c) -> a -> b -> c<br />
, Pure !e1<br />
, Pure !e2<br />
</haskell><br />
<br />
Now (+) for <hask>Int</hask> has this type:<br />
<haskell><br />
(+) :: forall %r1 %r2 %r3 !e1<br />
. Int %r1 -> Int %r2 -(!e1)> Int %r3<br />
:- !e1 = !{ !Read %r1; !Read %r2 }<br />
</haskell><br />
<br />
Which says it reads the two arguments and returns a freshly allocated <hask>Int</hask>.<br />
<br />
When we pass <hask>(+)</hask> as the first argument of <hask>suspend2</hask> the type system ends up with an ''effect class'' constraint <hask> Pure !{!Read %r1; !Read %r2;}</hask> which it satisfies by forcing <hask>%r1</hask> and <hask>%r2</hask> to be <hask>Const</hask>. If a value is in a <hask>Const</hask> region then it is guaranteed never to be destructively updated, which means it doesn't matter when we read it, which means that operation is pure.<br />
<br />
To say this another way, when a function application is suspended the type system ''purifies'' its visible <hask>Read</hask> effects by requiring the data being read to be <hask>Const</hask>.</div>DavidLazarhttps://wiki.haskell.org/index.php?title=Playing_by_the_rules&diff=20477Playing by the rules2008-04-08T14:32:54Z<p>DavidLazar: typo</p>
<hr />
<div>GHC's [[GHC/Using_rules|term rewriting engine]] provides a playground for all sorts of user-defined optimisations and<br />
tweaks to Haskell code.<br />
This page collects examples of the use of rewrite rules.<br />
There is more information available on the GHC [http://hackage.haskell.org/trac/ghc/wiki/RewriteRules rewrite rules] page.<br />
<br />
== reverse . reverse = id ==<br />
<br />
The following question was asked in [[IRC channel|#haskell]]:<br />
<br />
15:40 Excedrin> why doesn't 'head $ reverse $ reverse [1..]' work in Haskell?<br />
<br />
The answer is: it does work, if you tell the compiler that:<br />
<br />
<haskell><br />
reverse . reverse = id<br />
</haskell><br />
<br />
Using the following rewrite rule:<br />
<br />
<haskell><br />
{-# RULES<br />
"reverse.reverse/id" reverse . reverse = id<br />
#-}<br />
<br />
main = print . head . reverse . reverse $ [1..]<br />
</haskell><br />
<br />
We can "optimise" this program, changing a non-terminating program:<br />
<haskell><br />
$ ./a.out<br />
^C<br />
</haskell><br />
<br />
into a much faster one:<br />
<br />
<haskell><br />
$ ghc -fglasgow-exts -ddump-simpl-stats A.hs<br />
5 PostInlineUnconditionally<br />
4 UnfoldingDone<br />
1 RuleFired<br />
1 reverse.reverse/id<br />
7 BetaReduction<br />
3 SimplifierDone<br />
<br />
$ ./a.out<br />
1<br />
</haskell><br />
<br />
As can be seen here, rewrite rules let you teach the compiler about<br />
interesting algebraic properties you code satisfies, that it can't find<br />
on its own.<br />
<br />
'''Note:''' In general it's a bad idea for rules to change the semantics (meaning) of your code in such a way. Consider someone using <tt>reverse . reverse</tt> to demand strictness of an IO action, this code would no longer work with the above rule.<br />
<br />
== Fast ByteString construction ==<br />
<br />
Another technique is to use rewrite rules to remove intermediate lists<br />
when building bytestrings from literal string constants. The problem is<br />
that string constants must be converted from a [Char] to a ByteString,<br />
to use literal strings as ByteStrings. This is highly inefficient, when<br />
GHC already allocates string constants as unboxed byte arrays. We can<br />
bypass the [Char] conversion using rewrite rules.<br />
<br />
Supposing we want to use a ByteString literal:<br />
<br />
<haskell><br />
import qualified Data.ByteString.Char8 as C<br />
<br />
mystring = C.pack "rewrite rules are fun!"<br />
main = C.putStrLn mystring<br />
</haskell><br />
<br />
and it is compiled by GHC to:<br />
<br />
<haskell><br />
mystring_rDR = Data.ByteString.Char8.pack (GHC.Base.unpackCString# "rewrite rules are fun!"#)<br />
<br />
Main.main = Data.ByteString.putStrLn mystring_rDR<br />
<br />
:Main.main = GHC.TopHandler.runMainIO @ () Main.main<br />
</haskell><br />
<br />
Now, the string literal has been packed by GHC for us into a Addr#, pointing<br />
to a proper C string. Now, we'd like to remove that intermediate<br />
unpackCString#, and just pack the string literal straight into a ByteString,<br />
avoiding an intermediate list.<br />
<br />
So we add a rewrite rule:<br />
<br />
<haskell><br />
{-# RULES<br />
"pack/packAddress" forall s . pack (unpackCString# s) = B.packAddress s<br />
#-}<br />
</haskell><br />
<br />
Now, when compiled with -O -fglasgow-exts, we get:<br />
<br />
<haskell><br />
1 RuleFired<br />
1 FPS pack/packAddress<br />
</haskell><br />
<br />
and the code is transformed as follows:<br />
<br />
<haskell><br />
mystring = Data.ByteString.Base.packAddress "rewrite rules are fun!"<br />
</haskell><br />
<br />
to<br />
<br />
<haskell><br />
mystring = Data.ByteString.Char8.pack (GHC.Base.unpackCString# "rewrite rules are fun!"#)<br />
</haskell><br />
<br />
and then the rewrite rule kicks in, and we construct a new ByteString directly<br />
from the Addr#, via a call to strlen to get the length:<br />
<br />
<haskell><br />
mystring =<br />
let addr#_a146 :: GHC.Prim.Addr#<br />
addr#_a146 = "rewrite rules are fun!"#<br />
in case Data.ByteString.Base.$wccall addr#_a146 s2#_a1Q8 of<br />
(# ds3_a1Re, ds4_a1Rf #) -><br />
Data.ByteString.Base.PS addr#_a146<br />
(GHC.ForeignPtr.PlainForeignPtr var#_a1Q9)<br />
0<br />
(GHC.Prim.word2Int# ds4_a1Rf)<br />
</haskell><br />
<br />
''exactly'' what we'd like. So at runtime, this string will require only a call<br />
to strlen to build.<br />
<br />
== Locating errors ==<br />
<br />
Rewrite rules can ''almost'' be used to solve the infamous 'fromJust: Nothing'<br />
error message. Couldn't we just use rewrite rules to rewrite ''*transparently''<br />
all uses of fromJust to safeFromJust, tagging the call site with a location?<br />
To work this requires a few things to go right:<br />
<br />
* a rewrite rule<br />
* assertions<br />
* and rewrite rules firing before assertions are expanded<br />
<br />
Let's try this. Consider the program:<br />
<br />
<haskell><br />
1 import qualified Data.Map as M<br />
2 import Data.Maybe<br />
3<br />
4 main = print f<br />
5<br />
6 f = let m = M.fromList<br />
7 [(1,"1")<br />
8 ,(2,"2")<br />
9 ,(3,"3")]<br />
10 s = M.lookup 4 m<br />
11 in fromJust s<br />
</haskell><br />
<br />
When we run it we get the not so useful error:<br />
<br />
$ ./A<br />
A: Maybe.fromJust: Nothing<br />
<br />
Ok, so we have a few tricks for locating this, using<br />
[http://www.cse.unsw.edu.au/~dons/loch.html LocH], we can catch an assertion<br />
failure, but we have to insert the assertion by hand:<br />
<br />
<haskell><br />
1 import Debug.Trace.Location<br />
2 import qualified Data.Map as M<br />
3 import Data.Maybe<br />
4<br />
5 main = do print f<br />
6<br />
7 f = let m = M.fromList<br />
8 [(1,"1")<br />
9 ,(2,"2")<br />
10 ,(3,"3")]<br />
11 s = M.lookup 4 m<br />
12 in safeFromJust assert s<br />
13<br />
14 safeFromJust a = check a . fromJust<br />
</haskell><br />
<br />
Which correctly identifies the call site:<br />
<br />
$ ./A<br />
A: A.hs:12:20-25: Maybe.fromJust: Nothing<br />
<br />
Now, this approach is a little fragile. 'assert' is only respected by GHC if -O<br />
is ''not'' on, so if we happened to try this trick with -O, we'd get:<br />
<br />
$ ./A<br />
A: Debug.Trace.Location.failure<br />
<br />
So lesson one: you have to do the bug hunting with -Onot.<br />
<br />
Currently there's -fignore-asserts for turning off assertions, but no flag for<br />
turning them on with -O, Simon, could this be fixed? Could we get a<br />
-frespect-asserts that works even with -O ?<br />
<br />
Ok, assuming this assert trick is used, can we get the compiler to insert the<br />
asserts for us? If so, this would be a great advantage, you'd just be able to<br />
switch on a flag, or import a debugging module, and your fromJusts would be<br />
transparently rewritten. With rewrite rules we do just this!<br />
<br />
So, to our initial unsafe use of fromJust, we add a rewrite rule:<br />
<br />
<haskell><br />
--<br />
-- rewrite fromJust to a located version, and hope that GHC expands<br />
-- 'assert' after the rule fires..<br />
--<br />
{-# RULES<br />
"located fromJust" fromJust = check assert . myFromJust<br />
#-}<br />
</haskell><br />
<br />
This just tells the compiler to replace every occurence of fromJust with a<br />
assertion-throwing fromJust, should it fail. We have to use myFromJust here, to<br />
avoid rule recursion.<br />
<br />
<haskell><br />
--<br />
-- Inlined to avoid recursion in the rule:<br />
--<br />
myFromJust :: Maybe a -> a<br />
myFromJust Nothing = error "Maybe.fromJust: Nothing" -- yuck<br />
myFromJust (Just x) = x<br />
</haskell><br />
<br />
Ok, so can we get ghc to rewrite fromJust to the safe fromJust magicaly?<br />
<br />
$ ghc --make -Onot A.hs -fglasgow-exts -ddump-simpl-stats<br />
[1 of 1] Compiling Main ( A.hs, A.o )<br />
1 RuleFired<br />
1 located fromJust<br />
Linking A ...<br />
<br />
Yes, the rule fired! GHC *did* rewrite our fromJust to a more useful fromJust.<br />
Running it:<br />
<br />
<haskell><br />
$ ./A<br />
A: A.hs:19:36-41: Maybe.fromJust: Nothing<br />
</haskell><br />
<br />
Looks good! But that is deceiving: the assert was expanded before the rule<br />
fired, and refers to the rewrite rule source line (line 19), not the fromJust<br />
call site (line 12). Now if we could just have the 'assert' token inserted<br />
into the AST before it was expanded, we'd be home and dry. Could this be done<br />
with TH? Or could we arrange for asserts in rewrite rules not to be expanded<br />
till later?<br />
<br />
Note that this is still a useful technique, we can rewrite head/fromJust/... to<br />
some other possibly more useful message. And if we can constrain the rule to fire<br />
in only particular modules, we may be able to narrow down the bug, just by<br />
turning on a rule. For example, adding:<br />
<br />
<haskell><br />
{-# RULES<br />
"located fromJust" fromJust = safeFromJust<br />
#-}<br />
<br />
safeFromJust s = case s of<br />
Nothing -> "safeFromJust: failed with Nothing. Ouch"<br />
Just x -> x<br />
</haskell><br />
<br />
will produce:<br />
<br />
<haskell><br />
$ ./A<br />
"safeFromJust: failed with Nothing. Ouch"<br />
</haskell><br />
<br />
So rewrite rules can be used to transparently alter uses of partial functions<br />
like head and fromJust.<br />
<br />
== [[Fusion]] and deforestation ==<br />
<br />
By far the most elaborate use of compiler rewrite rules is to perform<br />
automatic [[deforestation]] of intermediate data structures. This is<br />
documented in a number of [[Research_papers/Compilation#Fusion_and_deforestation|research papers]].<br />
Note that also for this application field of rewrite rules the above mentioned problem of potentially changing the semantics of programs occurs. Read further under [[Correctness of short cut fusion|correctness of short cut fusion]].<br />
<br />
== Symbolic differentiation ==<br />
<br />
I like to demonstrate to people, that GHC has already built-in a kind of Computer Algebra system.<br />
The optimizer can be abused to differentiate expressions symbolically.<br />
Unfortunately it cannot be forced to do so.<br />
That's why, some, better say: too many, expressions are not derived.<br />
<br />
* http://www.haskell.org/pipermail/haskell-cafe/2005-March/009489.html<br />
* http://darcs.haskell.org/htam/src/ExploreHaskell/SymbolicDifferentiation.hs<br />
<br />
<br />
[[Category:Tutorials]]<br />
[[Category:Mathematics]]<br />
[[Category:Performance]]<br />
[[Category:Program transformation]]</div>DavidLazar