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 qualified Data.Vector as V | |
import qualified Data.Vector.Generic as G | |
import qualified Data.Vector.Fusion.Bundle as Bundle | |
newtype Arr a = Arr [V.Vector a] | |
(<|) :: a -> Arr a -> Arr a | |
a <| Arr (v:w:xs) | |
| V.length v == V.length w = Arr (G.unstream (Bundle.cons a $ G.stream v Bundle.++ G.stream w) : xs) | |
a <| Arr xs = Arr (V.singleton a : xs) |
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 MultiWayIf, ExistentialQuantification, OverloadedStrings #-} | |
import FreeGame | |
import qualified Data.IntMap as IM | |
import Control.Lens | |
import Control.Monad.State | |
import Control.Applicative | |
import Control.Monad | |
import Control.Monad.Identity | |
import qualified Data.Traversable as T |
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
export PS1="$PS1\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
-- https://github.com/ekmett/free/tree/35467bea6916a2efdd7182d071751af685344b1a | |
import Control.Monad.Identity | |
import qualified Control.Monad.Trans.Iter as I | |
import qualified Control.Monad.Trans.Iter.Reflection as R | |
import Control.Monad.State | |
import Data.IORef | |
destruct :: I.IterT IO a -> IO a | |
destruct m = do |
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 ViewPatterns #-} | |
module Source where | |
import Control.Applicative | |
import Control.Comonad | |
import qualified Data.Sequence as Seq | |
import Control.Monad.Identity | |
type Time = Double | |
data Source f a = Source !a (Time -> f (Source f 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
{-# LANGUAGE Rank2Types #-} | |
import Control.Comonad | |
data Saucer e a = Saucer a (forall x. e x -> (x, Saucer e a)) | |
instance Functor (Saucer e) where | |
fmap f (Saucer a h) = Saucer (f a) (fmap (fmap f) . h) | |
instance Comonad (Saucer e) where | |
extract (Saucer a h) = 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
{-# LANGUAGE GADTs, FlexibleContexts, TemplateHaskell #-} | |
import Control.Monad.State | |
import qualified Data.IntMap as M | |
import Control.Lens | |
data Field = Field String (M.IntMap Chara) deriving (Show) | |
data Chara = Chara String deriving (Show) | |
updateField f (Field s m) = Field (f s) m | |
updateChara f (Chara s) = Chara (f s) |
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 Rank2Types #-} | |
import FreeGame | |
import FreeGame.Class | |
import Debug.Trace | |
import FreeGame.Component | |
import FreeGame.Component.Deck | |
meter deck = oneshot $ \(PullGraphic _ cont) -> do | |
let s x = (10 + max (log x / log 10) (-10)) / 10 | |
V2 a b <- fmap (fmap s) $ deck .- RMS 1024 |
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
# "路線コード": { | |
# "駅コード": (X, Y, Z, "駅名"), ... | |
# }, ... | |
stationInfoTable = { | |
# harutrak A | |
"HA": { | |
"HH": (-285, 59, 346, "役場前"), | |
"NV": (-369, 70, 115, "中村"), # 298 blocks | |
"MM": (-370, 69, -56, "メガネケエスタワー前"), # 161 blocks |
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
[ x + y | |
| x <- [1..10] | |
, y <- [1..3]] | |
do | |
x <- [1..10] | |
y <- [1..3] | |
return (x + y) |
OlderNewer