6さいカンファレンスのレジュメ的な何か
はいはい、どうも、ちゅーんさんですよ。
module Main where | |
import Sound.Sarasvati.Base | |
sinl :: Float -> [Float] | |
sinl x = map sin $ f 0 | |
where f v = v : f (v + (x / 4410)) | |
zips :: [a] -> [(a, a)] | |
zips x = zip x x |
{-# LANGUAGE TypeSynonymInstances #-} | |
module Main where | |
class Hoge h where | |
hoge :: h a -> String | |
type Foo a = (a, a) | |
instance Hoge Foo where -- => Type synonym `Foo' should have 1 argument, but has been given none | |
hoge _ = "foooooo!" |
module Main where | |
contents::[(String, Int)] | |
contents = | |
[ ("start", 1) | |
, ("string", 11) | |
, ("number", 15) | |
] | |
formatRec :: (Int, (String, Int)) -> String |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
module Main where | |
newtype Eff a = Eff { runEff :: forall w. (a -> VE w) -> VE w } | |
instance Monad Eff where | |
--return :: a -> Eff a | |
return x = Eff $ \k -> k x | |
--(>>=) :: Eff a -> (a -> Eff b) -> Eff b | |
m >>= f = let |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
module Main where | |
---------- | |
-- Eff | |
newtype Eff r a = Eff { runEff :: forall w. (a -> VE w r) -> VE w r} | |
instance Monad (Eff r) where | |
--return :: a -> Eff a |
(´・_・`) | |
/, / | |
(ぃ9 | | |
/ /、 | |
/ ∧_二つ | |
/ / | |
/ \ | |
/ /~\ \ | |
/ / > ) | |
/ ノ / / |
* + 巛 ヽ | |
〒 ! + 。 + 。 * 。 | |
+ 。 | | | |
* + / / イヤッッホォォォオオォオウ! | |
/ / | |
(´・_・`/ / + 。 + 。 * 。 | |
,- f | |
/ ュヘ | * + 。 + 。 + | |
〈_} ) | | |
/ ! + 。 + + * |
/ ) | |
./ / | |
/ / | |
/ / | |
./ / , -つ | |
/ /・_・`) /__ノ | |
/ \ / / | |
.| へ/ / | |
| レ' /、二つ | |
| / |
public class Main { | |
private static void procces(boolean success, String procName){ | |
if(success){ | |
System.out.println("処理 " + procName + " 成功"); | |
throw new RuntimeException(); | |
} | |
System.out.println("処理 " + procName + " 失敗。。。"); | |
} | |