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 FlexibleInstances #-} | |
module Main where | |
import Sound.Arare.ArareDSL | |
data SinOscillator | |
instance NoteController SinOscillator where | |
noteOn = undefined | |
noteOff = undefined |
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 #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
data Seq where | |
Seq :: (Sequensable a, Sequensable b) => a -> b -> Seq | |
data Note = Note { fromNote :: Int } deriving Show | |
a :: Int -> Int -> Note | |
a x y = Note $ x + y |
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
module Main where | |
import Sound.Sarasvati | |
import Control.DeepSeq | |
import Control.Arrow | |
main :: IO () | |
main = do | |
putStrLn "music building..." | |
sarasvatiOutput defaultConfig . vol 0.5 0.5 $!! concat [music, music, r 8] | |
return () |
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
module Main where | |
import Control.Lens | |
import Control.Monad.Takahashi | |
import Control.Monad.State | |
main :: IO () | |
main = do | |
writeSlide "Out.html" presentation | |
putStrLn "Success." |
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
" 検索文字列ハイライト | |
set hlsearch | |
""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 実行 | |
:function ExecFile() | |
:w | |
:if &filetype == "haskell" | |
:! runghc % |
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
var move_rand_pos = function (obj) { | |
obj.x = rand(SCREEN_WIDTH - CHARACTER_WIDTH); | |
obj.y = rand(SCREEN_HEIGHT - CHARACTER_HEIGHT); | |
} |
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
モナド則: (m >>= g) >>= h == m >>= (\x -> g x >>= h) | |
定義: f >=> g == \x -> f x >>= g | |
命題:(f >=> g) >=> h == f >=> (g >=> h) | |
(f >=> g) >=> h | |
== (\x -> f x >>= g) >=> h -- (>=>)の定義 | |
== \y -> (\x -> f x >>= g) y >>= h -- (>=>)の定義 | |
== \y -> (f y >>= g) >>= h | |
== \y -> f y >>= (\z -> g z >>= h) -- モナド則 | |
== \y -> f y >>= (g >=> h) -- (>=>)の定義 |
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 TemplateHaskell, RankNTypes #-} | |
module Main where | |
import Control.Lens | |
import Control.Monad.State | |
import Data.List | |
sample :: [String] | |
sample = | |
[ "hoge" | |
, "piyo" |
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 RankNTypes #-} | |
module Main where | |
type Bool' = forall a. a -> a -> a | |
true :: Bool' | |
true = const | |
false :: Bool' | |
false = const id |
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 TemplateHaskell #-} | |
module Main where | |
import Control.Monad.State | |
import Control.Lens | |
data Point = Point | |
{ _pointX :: Int | |
, _pointY :: Int | |
} deriving Show |