4 ms·
A workshop on monads with C++14
- dkarapetyan 12y agoTemplate template templates. I didn't know that was thing.
- TheOtherHobbes 12y agoC++ repeats itself, first as tragedy, then as farce.
- bmcarr 12y agoAnd the award for least descriptive commit log of all time goes to... Cool stuff though.
- radarsat1 12y agoEh, when you're doing writing rather than coding, sometimes it's hard to be more descriptive than "added more text." I have a few repositories where I don't care much about the "logic" of the history, but I just want things versioned. (e.g. a folder full of text files with random ideas jotted down.) My commit commands tend to look like, git commit -m "`date`"
- rsp1984 12y ago// must be overloaded template<template<typename> class M,typename T,typename F> auto operator>>=(const M<T>& m, F f)->decltype(f(std::declval<const T>())); Could someone please point out to me why exactly this is useful and why I would want to code like this? Does it help me solve specific types of problems?
- patrick73 12y agoI think this is worth enough for intellectual practice, but honestly, I can't see how this can solve a specific type of problem.
- dkarapetyan 12y agoMonads are originally a solution to giving semantics to i/o, exceptions, and other things that fall under the generic headline of side-effecting computations. I'm not sure what value you get out of it when your language isn't Haskell. Here's the paper that started it all: http://www.cs.cmu.edu/afs/cs/user/crary/www/819-f09/Moggi91.pdf http://www.cs.cmu.edu/afs/cs/user/crary/www/819-f09/Moggi91.....
- whoopdedo 12y agoIt looks like he's using template metaprogramming so he can write C++ as if it were Haskell. So why not just use Haskell?