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 LambdaCase #-}
module Bench.StateVSIORef where
import Data.IORef
import Data.IORef.Unboxed
import Control.Monad.State.Strict
n :: Int
{-# LANGUAGE LambdaCase #-}
module Bench.StateVSIORef where
import Data.IORef
import Control.Monad.State.Strict
n :: Int
n = 2 ^ (31 :: Int)
module Bench.StateVSIORef where
import Data.IORef
import Control.Monad.State.Strict
n :: Int
n = 10000 * 10000
rotate :: [a] -> [a]
module NaiveParser where
import Control.Monad
import Data.Maybe (fromMaybe)
import Text.ParserCombinators.Parsec
data Block = List [Block] | ListItem String
deriving Show
@mizunashi-mana
mizunashi-mana / Makefile
Created January 11, 2019 12:23
競技プログラミング用Makefile
CC := cc
CXX := c++
GHC := ghc
RUSTC := rustc
JAVAC := javac
CPPFLAGS :=
CFLAGS := -std=c99
CXXFLAGS := -std=c++14
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
@mizunashi-mana
mizunashi-mana / LICENSE.md
Last active December 2, 2018 06:30
Notice template (this template is licensed under the CC0.)

CC0

Mizunashi Mana has waived all copyright and related or neighboring rights to MPL Notice Template.

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE BangPatterns #-}
module ConduitCerealExt where
import Control.Exception.Base
import Control.Monad.Trans.Resource (MonadThrow, throwM)
import qualified Data.ByteString as BS
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PatternSynonyms #-}
module WithRecursion where
-- | With recursive
newtype K a r = K a
newtype I r = I r
data (f * g) r = Pair (f r) (g r)
data (f + g) r = InL (f r) | InR (g r)