Skip to content

Instantly share code, notes, and snippets.

Yuya Kono takoeight0821

Block or report user

Report or block takoeight0821

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
We couldn’t find that file to show.
takoeight0821 / GIf.hs
Last active Dec 2, 2019
generic 'if'
View GIf.hs
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module GIf where
import Data.Kind
import GHC.Generics
import Prelude
takoeight0821 / Main.hs
Last active Nov 3, 2019
View Main.hs
module Main where
newtype IODouble = IODouble { runIODouble :: IO Double }
instance Num IODouble where
fromInteger x = IODouble $ do
print x
pure $ fromInteger x
(IODouble x) + (IODouble y) = IODouble $ do
x' <- x
takoeight0821 / foo.s
Created Aug 31, 2019
Arch Linuxでclang -c foo.sでこれコンパイルするとclangがセグフォする
View foo.s
.intel_syntax noprefix
call not
# 以下ログ
# Stack dump:
takoeight0821 / main.c
Last active Apr 16, 2019
View main.c
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <gc.h>
#include <stdint.h>
struct value;
struct env
takoeight0821 / main.c
Last active Apr 13, 2019
View main.c
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <gc.h>
union value;
struct env;
struct closure;
union value;
takoeight0821 / main.js
Last active Feb 5, 2019
View main.js
const Discord = require('discord.js');
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
function diceRoll(count, roll) {
let dices = [];
takoeight0821 /
Last active Dec 11, 2018
#include <iostream>
#include <tuple>
#include <algorithm>
#include <vector>
using namespace std;
template <typename T>
unsigned int digit_sum(T x, unsigned int base) {
auto result = 0;
takoeight0821 / main.c
Created Dec 7, 2018
View main.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN 256
typedef struct stack {
int *stack;
int len;
} Stack;
takoeight0821 / AstDsl.hs
Created Nov 28, 2018
View AstDsl.hs
module AstDsl where
import Control.Monad.State
import Control.Monad.Identity
import Data.Monoid
import Control.Monad.Writer
-- こんな普通のAST定義があるとする
data Expr = Let String Expr Expr
| Var String
You can’t perform that action at this time.