Skip to content

Instantly share code, notes, and snippets.

Avatar
🎞️
Fan of Film Cameras

Kazuki Okamoto kakkun61

🎞️
Fan of Film Cameras
View GitHub Profile
View .editorconfig
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
View tournament.hs
{- cabal:
build-depends: base, comonad
ghc-options: -Wall
-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
import Control.Comonad (Comonad (extract, extend))
View figure01.cs
namespace Wintellect.Interop.Sound
{
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
sealed class Sound
{
public static void MessageBeep(BeepTypes type)
{
View main.hs
import Control.Monad (guard, replicateM)
import Data.List (foldl')
main :: IO ()
main = do
print $ head $ do
[a, b, c, d, e, g, h, j] <- replicateM 8 [0 .. 9]
[f, i] <- replicateM 2 [1 .. 9]
guard $ h * h `mod` 10 == h
guard $ dec [f, d, c, a, j, h] * dec [i, b, c, f, e, h] == dec [f, b, a, e, c, i, i, j, e, g, i, h]
@kakkun61
kakkun61 / Dockerfile
Created Sep 29, 2020
GHC 9.0.1 Alpha 1 on Windows
View Dockerfile
# escape=`
FROM mcr.microsoft.com/windows:2004
RUN curl -O https://www.7-zip.org/a/7z1900-x64.exe
RUN 7z1900-x64.exe /S /D=C:\7zip\
RUN curl -O https://downloads.haskell.org/ghc/9.0.1-alpha1/ghc-9.0.0.20200925-x86_64-unknown-mingw32.tar.xz
RUN 7zip\7z x ghc-9.0.0.20200925-x86_64-unknown-mingw32.tar.xz
RUN 7zip\7z x ghc-9.0.0.20200925-x86_64-unknown-mingw32.tar
View CSC8002.circuitjs
$ 1 0.000005 7.010541234668786 51 5 43
a -384 128 -304 128 8 15 -15 1000000 -2.1615219297999033 2.2232274830737646 100000
r -384 112 -512 112 0 20000
r -304 80 -304 256 0 100000
r -304 256 -304 384 0 100000
w -304 128 -240 128 0
r -240 128 -240 192 0 40000
r -240 192 -144 192 0 40000
a -240 256 -144 256 8 15 -15 1000000 0.0002192264858535964 0 100000
w -240 192 -240 240 0
@kakkun61
kakkun61 / 10.md
Last active Aug 8, 2020
Haskell 2010 Language Report
View 10.md

10.3 Layout

Section 2.7 gives an informal discussion of the layout rule. This section defines it more precisely.

The meaning of a Haskell program may depend on its layout. The effect of layout on its meaning can be completely described by adding braces and semicolons in places determined by the layout. The meaning of this augmented program is now layout insensitive.

The effect of layout is specified in this section by describing how to add braces and semicolons to a laid-out program. The specification takes the form of a function L that performs the translation. The input to L is:

レイアウトの効果はこのセクションに記載されたどのように波括弧とセミコロンをプログラムに挿入することで仕様とされる。仕様は関数 L の形をとる。L はその変形をする。L への入力は:

View settings.json
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View block-wall.scad
block_width = 10;
block_height = 4;
block_thickness = 1;
clay_width = 0.5;
clay_thickness = 0.5;
unit_width = block_width + 2 * clay_width;
unit_height = block_height + 2 * clay_width;
View BUILD
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "hello-time",
srcs = ["hello-time.cc"],
hdrs = ["hello-time.h"],
visibility = ["//visibility:public"],
)