News aggregator

PROPOSAL: Add displayException to Exception typeclass

libraries list - Mon, 11/10/2014 - 4:01pm
I started a discussion a few weeks back on some theoretical changes to how exceptions are displayed. That discussion covered a lot of different ground. I'd now like to formally propose the original change I mentioned in that thread: 1. Add a new method to the Exception typeclass: -- | Render this exception value in a human-friendly manner. Default implementation: < at >show< at >. displayException :: e -> String displayException = show 2. Modify GHC's default exception handler to use `displayException` instead of `show`. This change will, on its own, cause no breakage[1] and, without further action, will have no change in program behavior. It does, however, allow users to begin distinguishing between how their exceptions should be `show`n versus how they should be displayed to an end user. Note that I am *not* proposing at this time any other changes discussed in the previous thread. If someone wants to propose removing Show superclasses, adding a Read superclass, providing a typeRepStack method[2],
Categories: Offsite Discussion

What would be a good mini-project for a beginner to demonstrate basic proficiency in Haskell?

Haskell on Reddit - Mon, 11/10/2014 - 11:16am

Hi, first of all, sorry if this isn't an appropriate post for this subreddit. Hope it is okay to post here.

I'm currently doing a masters in CS and as an Individual Study module, I have chosen to learn Haskell. As this is an Individual Study module and doesn't follow a strict syllabus, I have some input in how I am assessed. My supervisor has suggested I come up with a project that will demonstrate what I have learned and I will be assessed on that. This will be a project that I am likely going to have to start over Christmas and finish mid-January.

Would anyone be able to recommend a suitable project idea that will be sufficiently substantial for a masters degree, but manageable enough for someone who has no background in functional programming (all previous programming experience is in Java)?

submitted by lurk_in_progress
[link] [24 comments]
Categories: Incoming News

Extensible Effects

del.icio.us/haskell - Mon, 11/10/2014 - 10:49am
Categories: Offsite Blogs

Philip Wadler: Save our Universities

Planet Haskell - Mon, 11/10/2014 - 8:42am
<style type="text/css">PRE.cjk { font-family: "AR PL UMing HK",monospace; }PRE.ctl { font-family: "Lohit Devanagari",monospace; }P { margin-bottom: 0.21cm; }</style>
An open letter to my MSPs. Support and suggestions for how to carry
this forward as a campaign are solicited.

Dear Gavin Brown, Sarah Boyack, Alison Johnstone, Kezia Dugdale,
Cameron Buchanan and Neil Findlay,

I write to ask your help to preserve a secure future for Scottish
Universities.

Academics for all UK universities, including those in Scotland, have
faced falling wages and falling pensions over many years. "The real
wages of academics have fallen by 13% since 2008, one of the largest
sustained wage cuts any profession has suffered since the Second World
War." So wrote Will Hutton in the Guardian, October 2013 [1].

In 2011, Universities UK imposed vastly reduced pensions on new
hires. Old hires who pay into the pension fund for forty years receive
a pension of one-half their final salary; new hires who do the same
receive a pension of one-half their average salary. Basing pensions on
average rather than final salary may be sensible, but to do so with no
adjustment in multiplier suggests employers are using this as an
excuse to slip in a large cut; it means new hires receive about 2/3
the benefits received by old hires. All staff also suffered other cuts
to pensions: additional caps and less good adjustment for inflation.
At the time, it was predicted that within a few years old hires would
be moved to the inferior scheme for new hires, and that is what has
now come to pass. [2]

Universities UK argue that the reductions are necessary to avoid a
deficit, but their claim has been widely criticised. Notably, a group
of prominent statisticians point out Universities UK inflated the
deficit by assuming a buoyant economy when predicting future salaries
but assuming a recession when predicting investment returns. [3]

A strong university system is one of the jewels in the crown of the
UK, and particularly for Scotland. That excellence is a huge driver
of innovation and growth. If Scotland reduces its investment in
universities, it won't be long before we feel that loss throughout the
economy. [4,5]

Scotland has a University system second to none, and to keep it strong
we need pay and pensions that attract and retain the best minds
throughout the world. We must have a system that is fair to both: old
hires must retain attractive conditions; new hires must have the bad
deal imposed on them in 2011 rolled back. Speaking as an old hire, I'd
settle for a small cut in pension if it meant bringing new hires onto
the same level: we must keep the system strong for the future.

The UCU has gone on strike over the issue (suspension of assessment,
which it hopes will minimise disruption for students). But UCU is
unlikely to succeed without political support.

I write to ask you, as my representative in the Scottish parliament,
will you direct the Scottish Funding Council to make fair treatment
for academics in Scottish Universities, both new hires and old, a top
priority?

Thank you for your consideration. Yours,

-- Philip Wadler
Professor of Theoretical Computer Science
School of Informatics
University of Edinburgh


[1] http://www.theguardian.com/commentisfree/2013/oct/13/england-leave-funding-universities-students
[2] http://www.theguardian.com/education/2010/nov/23/oxbridge-pensions-academics-protest-united
[3] http://www.theguardian.com/higher-education-network/blog/2014/oct/29/marking-boycott-why-are-academics-protesting-about-pensions
[4] http://www.universities-scotland.ac.uk/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=156&cntnt01returnid=23
[5] Royal Society of Edinburgh, Enlightening the Constitutional Debate, Science and Higher Education, p177--198,
    http://www.royalsoced.org.uk/cms/files/events/reports/2013-2014/The%20Book.pdf
Categories: Offsite Blogs

list comprehension with multiple generator|targets

haskell-cafe - Mon, 11/10/2014 - 4:58am
I'm guessing this isn't supported, but might be worth asking - can I extend a list comprehension like ['A' | A <- s] to multiple values? Like, data V = A | B | C pv :: [V] -> [Char] pv [] = [] pv (A:x) = 'A':(pv x) pv (B:x) = 'B':(pv x) pv (_:x) = pv x
Categories: Offsite Discussion

Implementation of "until"

libraries list - Sun, 11/09/2014 - 9:14pm
I got to looking at the `until` function (in GHC.Base):
Categories: Offsite Discussion

Can I check the length in a guarded expresion

haskell-cafe - Sun, 11/09/2014 - 8:33pm
Hello, I try to make a guarded solution to find the last item in a list. I thought I could do something like this | length a == 1 = a But then I see a lot of error messages. Is there another way I can check the length of a list with guards ? Roelof
Categories: Offsite Discussion