tag:blogger.com,1999:blog-1777990983847811806.post8412251435899967731..comments2016-09-20T11:12:53.563-07:00Comments on Haskell for all: Spreadsheet-like programming in HaskellGabriel Gonzaleznoreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1777990983847811806.post-20482868985017586362015-05-30T12:33:35.888-07:002015-05-30T12:33:35.888-07:00You can model a variable number of updatables if t...You can model a variable number of updatables if they all store the same type of value. For example, assuming you have a sequence of updatable values of type:<br /><br /> example :: Seq (Updatable a)<br /><br />... you can turn that into an updatable sequence of values by using `Data.Traversable.sequenceA`:<br /><br /> sequenceA example :: Updatable (Seq a)<br /><br />Under the hood this will generate a minimal update tree where each primitive update of an `a` triggers O(log N) downstream updates to build the new `Seq a`, where N is the size of the original sequence.<br /><br />The reason I use `Seq` instead of list is because it has a much more efficient implementation of `sequenceA`.Gabriel Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-26483238650069515972015-05-27T14:42:12.847-07:002015-05-27T14:42:12.847-07:00Gabriel, you say that mvc-updates "excel at s...Gabriel, you say that mvc-updates "excel at spread sheets" but as far as I see it deals only with finite and fixed number of Updatables which does not look like spread sheets which could contain variable and possibly huge number of cells.<br />Am I correct at that of if I'm wrong how could you model variable number of updatables using mvc-updates? Or maybe there is something outside of this library which could make it possible in some comparatively easy way?<br />BTW Thanks for all your writings - I (and probably many others too) get a lot from reaging them.Qrilkahttp://www.blogger.com/profile/14856370078919907461noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-81097489707324314892014-12-31T15:01:52.203-08:002014-12-31T15:01:52.203-08:00Nobody has implemented an actual spread sheet appl...Nobody has implemented an actual spread sheet application on top of this yet.<br /><br />There are some similarities to functional reactive programming. This answer on Stack Overflow was part of the inspiration for this library (and the second example):<br /><br />http://stackoverflow.com/a/1028642/1026598Gabriel Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-8229296341303952082014-12-01T01:57:03.138-08:002014-12-01T01:57:03.138-08:00Looks great! I don't understand it yet, but I ...Looks great! I don't understand it yet, but I will, soon! ;)<br /><br />Has anyone went so far and implemented a spreadsheet app (expanding on your example)? I would like to do that because I always wanted to have my own light-version of Excel.<br /><br />Also it seems, there are similarities to functional reactive programming (maybe solving similar problems).RJMhttp://www.blogger.com/profile/05083403673307795547noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-4862017526254907812014-10-11T13:58:35.120-07:002014-10-11T13:58:35.120-07:00This comment has been removed by the author.Günther Schmidthttp://www.blogger.com/profile/08750715117486767875noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-80496196659756085192014-06-17T00:58:05.390-07:002014-06-17T00:58:05.390-07:00@Russel: considering that Gabriel implemented spre...@Russel: considering that Gabriel implemented spreadsheet-like programming (and spreadsheet = one-way dataflow constraints), I'd say at least one person cares about constraint programming, enough to do a (somewhat simplistic) implementation.<br /><br />Then there are the million plus iOS/Mac programmers using AutoLayout and KVO/Bindings. AutoLayout is based on the Cassowary constraint solver, KVO/Bindings is equivalent to a simple one-way constraint solver (without formulae)<br /><br />And finally, spreadsheets are the most wide-spread form of programming, and again, spread-sheets = one-way dataflow constraints.<br /><br />So you have a funny definition of "nobody" :-)<br /><br />@Gabriel: what do you mean with "resource management"? Considering the wide variety of constraint systems, are you certain that none have this? In fact, mvc-updates seems quite limited compared to most constraint systems I am aware of.Marcel Weiherhttp://www.blogger.com/profile/11651004661887001433noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-24627396808317880192014-06-17T00:56:53.539-07:002014-06-17T00:56:53.539-07:00This comment has been removed by the author.Marcel Weiherhttp://www.blogger.com/profile/11651004661887001433noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-38697388064535732552014-06-16T14:17:43.588-07:002014-06-16T14:17:43.588-07:00No one cares about constraint programming. Nice ar...No one cares about constraint programming. Nice article though.Russell Stewarthttp://www.blogger.com/profile/12416857172204347731noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-47417838355728171872014-06-15T08:01:52.192-07:002014-06-15T08:01:52.192-07:00I don't use mathematics for the sake of using ...I don't use mathematics for the sake of using mathematics. The purpose behind structuring programs mathematically is to compose small bits of mathematical functionality, each of which is correct in isolation, to build larger mathematical structures which are still correct.<br /><br />Sure, you can always whip up some specialized and non-mathematical solution, but these will rarely generalize to more complex problems well. They will usually solve some very specific problem very well, but the moment you deviate from the problem it was intended to solve it will become very brittle.<br /><br />Even the very example you give (constraint programming systems) demonstrates this issues. Constraint programming lacks the resource management sophistication of `mvc-updates`, where as you combine updatable values it automatically merges their resource management logic, and it's not clear to me how I would extend it with this feature, whereas with `mvc-updates` it was trivial because it took the principled approach.Gabriel Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-21574097397658524352014-06-15T01:27:01.438-07:002014-06-15T01:27:01.438-07:00Constraint programming systems show you that "...Constraint programming systems show you that "spreadsheets" can be implemented (simply) as libraries without the need for any of category theory or abstract algebra.<br /><br />So these don't add anything substantive here, apart from pleasing your personal palate (which is a perfectly fine thing to do).<br />Marcel Weiherhttp://www.blogger.com/profile/11651004661887001433noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-13818427356417546322014-06-14T12:00:30.151-07:002014-06-14T12:00:30.151-07:00I'm a little bit familiar with constraint prog...I'm a little bit familiar with constraint programming, but the main thing I look for in a programming paradigm are programming interfaces inspired by category theory or abstract algebra (i.e. monoids, functors, categories, etc.). Are there analogs of that in constraint programming?Gabriel Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-55756109339679770982014-06-14T09:58:16.869-07:002014-06-14T09:58:16.869-07:00Look up constraint programming... :-)Look up constraint programming... :-)Marcel Weiherhttp://www.blogger.com/profile/11651004661887001433noreply@blogger.com