This file contains 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 TemplateHaskell #-} | |
import Data.Lens.Template | |
import qualified Data.Map as Map | |
import Data.Map (Map) | |
import System.Random | |
import StatefulLens |
This file contains 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
*.out | |
*.a |
This file contains 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
#pragma once | |
#include <cmath> | |
#include <iostream> | |
using namespace std; | |
static constexpr int pow(int x, int n) { |
This file contains 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
module Behaviour where | |
import Prelude hiding (id, (.), head, tail, zip, unzip, map, repeat, cycle) | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Category | |
import Data.Stream |
This file contains 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 Arrows, TypeOperators #-} | |
import Prelude hiding (id, (.)) | |
import SF | |
-- this is the timer - returns length of the tick | |
ticks :: () :-> Double | |
ticks = constant 1 | |
-- Modelling the physics. |
This file contains 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 | |
TemplateHaskell, | |
Arrows | |
#-} | |
module Thing where | |
import Prelude hiding (id, (.)) | |
import Control.Arrow |
This file contains 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 RankNTypes #-} | |
type List a = | |
forall b. | |
(a -> b -> b) -> (b -> b) | |
nil :: List a | |
nil _ a = a | |
infixr 5 >< |
This file contains 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
module AST where | |
data AST | |
= [Name] :=> AST | |
| Name :? AST | |
| App [AST] | |
| Atom String | |
| Const Integer | |
| Force AST |
This file contains 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
:- use_module(library(lists)). | |
construct(Fields, Record) | |
:- Record =.. [record | Fields] | |
. | |
% synonym | |
% | |
make --> construct. | |
build --> destruct. |
This file contains 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 Control.Applicative | |
import Control.Monad.Reader | |
import Control.Monad.State | |
import Control.Monad.Error | |
import Text.Printf | |
data Step |
OlderNewer