Skip to content

Instantly share code, notes, and snippets.

import Data.Char
euler16 = sum . (map digitToInt) . show
main = print $ euler16 (2 ^ 1000)

!SLIDE

YCombinator

!SLIDE

YCombinatorとは何か

!SLIDE

ベンチャーキャピタル

YコンビネータLLC(Y Combinator LLC)は、カリフォルニア州マウンテンビューのベンチャーキャピタルである。

def pascal1(c: Int, r: Int): Int = {
if (c == 0 || c == r) 1
else pascal1(c - 1, r - 1) + pascal1(c, r - 1)
}
def pascal2(c: Int, r: Int): Int = {
@tailrec
def pascal(n: Int, prev: List[Int]): Int = {
val row = (0 :: prev).zipAll(prev, 0, 0).map(t => t._1 + t._2)
module Main
data FizzBuzz : (n: Nat) -> Type where
Zero : FizzBuzz n
Fizz : FizzBuzz n
Buzz : FizzBuzz n
Woof : FizzBuzz n
Comb : FizzBuzz n -> FizzBuzz n -> FizzBuzz n
instance Semigroup (FizzBuzz n) where
declare
fun {Fact N}
if N == 0 then 1 else N * {Fact N - 1} end
end
declare
fun {AddList L1 L2}
case L1 of H1 | T1 then
case L2 of H2 | T2 then
H1 + H2 | {AddList T1 T2}
module Monad where
import Prelude hiding (fmap, Functor, Monad)
class Functor f where
fmap :: (a -> b) -> f a -> f b
class Functor m => Applicative m where
@mikamix
mikamix / fizzbuzz.rb
Last active September 15, 2015 15:49
class Num
def initialize(v)
@v = v
end
def combine(target)
target
end
end

始代数とcatamorphism


自己紹介

  • 三上遼
  • 0x20歳
  • IoTの会社でスマートロック作ってます
  • 数学弱いです