News aggregator

Daniil Frumin: ANN: scotty-hastache 0.2

Planet Haskell - Sun, 01/05/2014 - 7:57am

The scotty-hastache library has been updating, following the introduction of the custom exception types in Scotty. Custom exception types (as opposed to plain-text exception mechanism that was previously employed in Scotty) is a more powerful way of handling exceptional situation; an example usage can be found here. Below are the appropriate release notes for scotty-hastache

0.2

Keeping up with the Scotty 0.6 updating. The introduction of the custom exception types is reflected in the scotty-hastache package as well. The main types are now polymorphic over an exception type

type ScottyH e = ScottyT e HState type ActionH e = ActionT e HState

In addition, the specialized (to Text) types and runners are introduced

type ScottyH' = ScottyH Text type ActionH' = ActionH Text scottyH' :: Port -> ScottyH' () -> IO () scottyHOpts' :: Options -> ScottyH' () -> IO ()

Thanks to Kirill Zaborsky for pointing out the incompatibility with 0.6.

As always, the scotty-hastache library is available on Hackage and on GitHub


Tagged: haskell, scotty, web
Categories: Offsite Blogs

My first non-trivial Haskell project - any help appreciated.

Haskell on Reddit - Sun, 01/05/2014 - 6:56am

I've written the back-end for a simple Bridge (card game) bidding helper in Haskell as my first non-trivial project.

BridgeBuddyServer

The idea is to expand this into a more useful general Bridge playing system. Before I go further, I'd really appreciate any feedback on the code: idiomatic use of Haskell; libraries I could have used; code formatting; anything!

submitted by derek-mcloughlin
[link] [27 comments]
Categories: Incoming News

gist:8255552

del.icio.us/haskell - Sun, 01/05/2014 - 4:35am
Categories: Offsite Blogs

Ken T Takusagawa: [qupqknlc] Greedy leap years

Planet Haskell - Sun, 01/05/2014 - 4:12am

Leap day every 4 years.
Omit leap day every 33*4=132 years.
Keep leap day every 100*33*4=13200 years.

This sequence of multipliers [4,33,100] were found by the greedy method. The entire cycle has the same average year length as the Gregorian calendar = 365 + 97/400 days, which uses multipliers [4,25,4]. We alternate between keeping and omitting leap days at each larger multiplier.

countDays::Integer->[Integer]->Integer->Integer;
countDays accum (h:t) offset = countDays (accum*h+offset) t (negate offset);
countDays accum [] _ = accum;
averageYear :: [Integer] -> Rational;
averageYear leapPattern = (countDays 365 leapPattern 1) % (product leapPattern)

What is going on such that averageYear [4,33,100] == averageYear [4,25,4]? Find a set of multipliers which minimizes the product, i.e., cycle length. I suspect this is related to Egyptian fractions or continued fractions. I suspect that the greedy method yields a sequence which monotonically increases.

Update: these are Pierce expansions, a variant of Engel expansions.

Applying the greedy algorithm to 365 + 71/293 days (as proposed by the Symmetry454 calendar) yields multipliers [4,32,58,97,146,293] for a cycle of 11251521835008 days in 30805635584 years. (This is far less efficient than the 293 year cycle.)

When applied to adding "leap weeks" to the Gregorian calendar, we find the sequence [5,8,10] as reported in calendar based on 7. If we apply leap weeks to the 365+71/293 year-length, we get the sequence [5,8,10,97,146,293].

Some disorganized Haskell code for these calculations.

Categories: Offsite Blogs

neilmitchell.blogspot.com.es

del.icio.us/haskell - Sun, 01/05/2014 - 1:35am
Categories: Offsite Blogs

neilmitchell.blogspot.com.es

del.icio.us/haskell - Sun, 01/05/2014 - 1:35am
Categories: Offsite Blogs

Emacs and our API | FP Complete

del.icio.us/haskell - Sun, 01/05/2014 - 12:17am
Categories: Offsite Blogs

365 Tidal Patterns

del.icio.us/haskell - Sun, 01/05/2014 - 12:07am
Categories: Offsite Blogs

Who remembers HP 2013.4.0.0...?

libraries list - Sat, 01/04/2014 - 11:35pm
I do - I'm just a lame-o this cycle! Please review the status below - I'll have the 'prerelease' branch in github updated this weekend, and packages out (src tarball and Mac installers) out this coming week. - Mark *Resolved Issues* - fgl - haven't heard from Ivan, so we'll stay with the status quo. - aeson / dlist - log round'a'bout discussion resulted in decision to omit aeson this cycle. - alex / happy - I haven't heard from the maintainers on the major version bump, but they are both active here and so I'm assuming it is a go. *Current Proposed Versions* *GHC 7.6.3* -- same as last time (erroneously listed as a version bump last time) *Packages with no changes:* fgl, haskell-src, html, HUnit, mtl, parsec, QuickCheck, random, regex-base, regex-compat, regex-posix, split, stm, text, transformers, xhtml, zlib *Packages held back:* cgi: 3001.1.7.5 (3001.1.8.4* requires MonadCatchIO-mtl)* *Packages with minor version bumps:* HTTP:
Categories: Offsite Discussion

Haskell Repa库使用心得

del.icio.us/haskell - Sat, 01/04/2014 - 9:39pm
Categories: Offsite Blogs

Haskell Repa库使用心得

del.icio.us/haskell - Sat, 01/04/2014 - 9:39pm
Categories: Offsite Blogs

Haskell + Cairo

del.icio.us/haskell - Sat, 01/04/2014 - 9:37pm
Categories: Offsite Blogs

Haskell + Cairo

del.icio.us/haskell - Sat, 01/04/2014 - 9:37pm
Categories: Offsite Blogs

ANN: unicode-0.0

General haskell list - Sat, 01/04/2014 - 7:40pm
The first announcement this year: The 'unicode' package contains functions for construction of various characters like: * block graphic elements * frame elements * fractions * subscript and superscript characters http://hackage.haskell.org/package/unicode The package is simple Haskell 2010. For example usage see the included 'visualize' example, buildable with 'cabal install -fbuildExamples', and http://code.haskell.org/~thielema/set-cover/example/Domino.hs
Categories: Incoming News

JLOUIS Ramblings

del.icio.us/haskell - Sat, 01/04/2014 - 6:51pm
Categories: Offsite Blogs