This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.CAS | |
import Data.IORef | |
test1 = do ref <- newIORef 0 | |
let old = 0 | |
new = (old+1) | |
casIORef ref old new | |
test2 = do let old = 0 | |
ref <- newIORef old |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- No LANGUAGE pragmas! This is all barebones Haskell. | |
-- $ ghc --make -O2 -fllvm -fforce-recomp tagless.hs | |
import Control.Applicative | |
import Control.Monad.Reader hiding (fix) | |
import Control.Monad.State hiding (fix) | |
import Criterion.Main | |
-- An example of how multiple backends can be achieved for an EDSL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Formatter; | |
public class _interp { | |
//labels | |
static final int _value$_of = 0; | |
static final int _apply$_k = 1; | |
static final int _apply$_env = 2; | |
static final int _apply$_proc = 3; | |
//registers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
import Control.Applicative | |
import Data.Dynamic | |
import Data.Maybe | |
type Id = Integer | |
data Val where | |
Var :: Id -> Val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
*** Local Variables: *** | |
*** coq-prog-name: "coqtop" *** | |
*** coq-prog-args: ("-emacs-U" "-I" "sf") *** | |
*** End: *** | |
*) |
NewerOlder