[Haskell-beginners] Einstein's Problem

Patrick LeBoutillier patrick.leboutillier at gmail.com
Wed Dec 23 14:46:51 EST 2009

Hi all,

I've been working hard at trying to solve Einstein's problem
(http://www.davar.net/MATH/PROBLEMS/EINSTEIN.HTM) if an efficient
manner using Haskell.

I have posted my solution here: http://haskell.pastebin.com/m3ff1973a

This exercise has been a real eye opener for me, especially for
learning to work with the Maybe and List monads.

I'm looking for suggestions for making the "test" function nicer. In
order to make my solution fast, I generate my test cases
thereby elimating most of the cases early on. However the function
looks funny (deeply nested).

I'm also open to any comments about making better use of the different
Haskell idioms.

Thanks a lot,

Patrick LeBoutillier
Rosemère, Québec, Canada

More information about the Beginners mailing list