TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using backtracking to undo transactions in Haskell

15 pointsby agocoronaabout 10 years ago

1 comment

saidajigumiabout 10 years ago
For me, this is the money quote:<p><i>The monad instance defines what each kind of computation has to do with these continuations.<p>A bind has two parameters: a closure and a continuation.</i><p><pre><code> x &gt;&gt;=(f1&gt;&gt;=(f2 &gt;&gt;=f3)) </code></pre> Serious light-bulb moment. I&#x27;m very used to thinking about and leveraging closures in imperative languages, but the above finally connected the idea that I can deliberately build abstractions&#x2F;DSLs like this in Haskell for purposes such as action history manipulation. Computation as data! Love it!
评论 #9120848 未加载
评论 #9121085 未加载