Skip to content

Instantly share code, notes, and snippets.

View mizunashi-mana's full-sized avatar
💭
I may be slow to respond.

Mizunashi Mana mizunashi-mana

💭
I may be slow to respond.
View GitHub Profile
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module NatTrans where
import Data.Foldable
import Data.Functor.Identity
newtype f :~> g = NT
@mizunashi-mana
mizunashi-mana / idea.rst
Last active March 16, 2018 02:10
APIが壊れないプログラミング言語

APIが壊れないプログラミング言語

目的

以下を満たすプログラミング言語を目指す.

  • APIのバージョンをコントロールできる.
  • APIの変更を検査し,変更が破壊的であるかを保証できる.
@mizunashi-mana
mizunashi-mana / sum_prop.coq
Created February 25, 2018 13:51
なんかできた
Require Import Arith.
Fixpoint sum (n: nat) {struct n}: nat :=
match n with
| O => O
| S p => S p + sum p
end.
Lemma sum_Sn: forall n, sum (S n) = S n + sum n.
Proof.
@mizunashi-mana
mizunashi-mana / DeferIsPrime.hs
Created February 11, 2018 08:54
IsPrimeを遅延させる
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.DeferIsPrime where
@mizunashi-mana
mizunashi-mana / Extra.hs
Last active November 10, 2017 13:06
Control.Concurrent.Async.Extra
{-# LANGUAGE ImplicitPrelude #-}
module Control.Concurrent.Async.Extra where
import Control.Concurrent.Async
import Control.Monad.Trans.Except
import Data.Foldable
concurrentlyExcept :: IO (Except e a) -> IO (Except e b) -> IO (Except e (a, b))
concurrentlyExcept actA actB = do
import Control.Applicative
import qualified Text.Parsec as P
import Text.Parsec.String
data Command = Command
{ addr :: Maybe Addr
, cmdName :: Char
, param :: Maybe String
} deriving (Show, Eq)
ed :: [String] -> IO ()
ed args = if null args
then do
x <- fromMaybe "" <$> runInputT defaultSettings (getInputLine "")
ed' (setCmd x) [] [] 1 True
else do
x <- createBuffer (head args)
y <- fromMaybe "" <$> runInputT defaultSettings (getInputLine "")
ed' (setCmd y) (head args) x 1 True
module Works.TestParsec where
import Text.Parsec hiding (optional)
import Text.Parsec.String
import Control.Applicative (optional)
data Command = Command
{ address :: Maybe Address
, cmdName :: Char
Pillow==3.3.1

Nested Unordered List Example

For gitbook bug report:

  • Item 1

    Item 1 text