3 ms·
I think these 3 slides really stand out, they show with how little code one can write serious software in Haskell... 1. ACID (acid-compliant persistance on Has
by cies 14y ago
I think these 3 slides really stand out, they show with how little code one can write serious software in Haskell...
1.
ACID (acid-compliant persistance on Haskell data types, with indexes)
http://dev.stephendiehl.com/hask/#(27) http://dev.stephendiehl.com/hask/#(27)
2.
Pipes (program on streams of data)
http://dev.stephendiehl.com/hask/#(30) http://dev.stephendiehl.com/hask/#(30)
3.
Scotty (micro web-framework, a la Sinatra or Flask, on top of the super fast Warp server)
http://dev.stephendiehl.com/hask/#(32) http://dev.stephendiehl.com/hask/#(32)
- cscheid 14y agoAbout your point 3), it's worth noting the "toHtml" call buried in that example. Haskell is both strongly and statically typed. That type boundary between strings and HTML output is enforced by the compiler, and it automatically (and provably!) prevents a metric crapload of injection attacks.
- deleted 14y ago[deleted]
- tel 14y agoTo bring this into sharper detail, notice that there's the "OverloadedStrings" compiler directive at the top of the file. That means that "hello " and "!" are of type Html, different from String. Strings can only be concatenated with Html after they've been escaped. For more elaboration, see http://blog.moertel.com/posts/2006-10-18-a-type-based-solution-to-the-strings-problem.html http://blog.moertel.com/posts/2006-10-18-a-type-based-soluti...
- freyrs3 14y agoHere's an example that brings together Aeson, Lens, Acid-State and Scotty together in one file. Haskell really does have some great offerings for building very solid and fast web applications. [1] https://github.com/sdiehl/haskell-warp-rest/blob/master/server.hs https://github.com/sdiehl/haskell-warp-rest/blob/master/serv...
- drhodes 14y agoThat url is 404, maybe this is the one? https://github.com/sdiehl/haskell-warp-rest/blob/master/warp_rest_example.hs https://github.com/sdiehl/haskell-warp-rest/blob/master/warp...
- avital 14y agoCan acid-state be ported to Javascript?
- arianvanp 14y agoyou could try cross-compiling it with Fay or UHC (haskell to javascript compilers)
- boothead 14y agoYou'd probably need one of the more heavyweight options (e.g. GHCJS). Fay doesn't understand typeclasses afaik, so it's not really suitable for porting haskell libraries verbatim to the browser.
- cies 14y agoMaybe but it does not seem very obvious to do so to me.. I guess one is better off with using JS's localStorage from Fay[1] or Sunroof[2]. 1. http://fay-lang.org http://fay-lang.org 2. https://github.com/ku-fpg/sunroof-compiler/wiki/Tutorial https://github.com/ku-fpg/sunroof-compiler/wiki/Tutorial