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 GADTs, RankNTypes, MultiParamTypeClasses, FlexibleInstances #-} | |
module End where | |
import qualified Prelude | |
import Control.Category | |
import Data.Monoid | |
import Data.Functor.Identity | |
type Hask = (->) |
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, FlexibleContexts, FlexibleInstances, UndecidableInstances, OverlappingInstances #-} | |
import Control.Lens | |
import Control.Monad.State | |
-- 基本となるオブジェクト | |
data Obj = Obj { | |
_pos :: Int | |
} deriving (Show) | |
-- Obj型のオブジェクトをもつ抽象的なクラスHasObjを作る |
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 ImplicitParams, BangPatterns #-} | |
----------------------------------------------------------------------------- | |
-- | | |
-- Module : Graphics.UI.FreeGame.GUI.GLFW | |
-- Copyright : (C) 2013 Fumiaki Kinoshita | |
-- License : BSD-style (see the file LICENSE) | |
-- | |
-- Maintainer : Fumiaki Kinoshita <[email protected]> | |
-- Stability : experimental | |
-- Portability : non-portable |
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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import sys | |
import os | |
sys.path.append(os.pardir) | |
from PyQt4 import QtGui, QtCore | |
import datetime |
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
#! /usr/bin/python3.3 | |
#-*- coding:utf-8 -*- | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import random | |
from timeit import Timer | |
import time | |
def recur(n, x, func): |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Mon Nov 18 00:40 2013 Time and Allocation Profiling Report (Final) | |
Main +RTS -p -RTS | |
total time = 9.97 secs (9968 ticks @ 1000 us, 1 processor) | |
total alloc = 304,891,560 bytes (excludes profiling overheads) | |
COST CENTRE MODULE %time %alloc | |
update Chimera.STG 69.7 2.0 |
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 System.Environment | |
import Control.Monad.State | |
import Control.Lens | |
data Obj = Obj { _pos :: (Integer, Integer) } deriving Show | |
makeLenses ''Obj | |
benchmark1 :: [Obj] -> IO [Obj] | |
benchmark1 g = mapM (\e -> update `execStateT` e) g |
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, TypeSynonymInstances, FlexibleInstances #-} | |
import Control.Monad.State | |
import Control.Lens | |
import Data.Functor.Identity | |
data Autonomie m a = Autonomie { auto :: a, runAuto :: m () } | |
class Game c where | |
update :: State c () | |
draw :: StateT c IO () |
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 FlexibleContexts, DeriveDataTypeable #-} | |
import Control.Eff | |
import Control.Eff.Reader.Lazy | |
import Control.Eff.State.Lazy | |
import Control.Eff.Writer.Lazy | |
import Data.Typeable (Typeable) | |
import Control.Monad | |
type Task = String | |
newtype Worker = Worker { todo :: [Task] } |