Skip to content

Instantly share code, notes, and snippets.

View igrep's full-sized avatar
:shipit:
Programming in TypeScript, Python, or Haskell.

YAMAMOTO Yuji igrep

:shipit:
Programming in TypeScript, Python, or Haskell.
View GitHub Profile
  • x: 大規模イベントと被ってる
  • -: 小規模のイベントと被ってる
  • +: 休日でない
  • ?: 人によっては休日
  • 指定なし: どれともかぶってない

上に行くほど強い (例えば「休日でなく、かつ大規模イベントと被っている日」はx

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
compiler: ghc-8.2.0.20170507
compiler-check: match-exact
resolver: lts-8.13
setup-info:
ghc:
linux64:
8.2.0.20170507:
url: https://downloads.haskell.org/~ghc/8.2.1-rc2/ghc-8.2.0.20170507-x86_64-deb8-linux.tar.xz
content-length: 141011788
sha1: ff886437c1d2ddfa5686d6c9efb0819a957c3dde
@RichardHightower
RichardHightower / using_cojure_from_java.md
Created April 6, 2016 19:54
Example using Clojure from Java

Normal Java project

tree
.
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
@yumura
yumura / poco.psm1
Last active May 12, 2025 04:05
powershell peco
# Load
Split-Path $MyInvocation.MyCommand.Path -Parent | Push-Location
Get-ChildItem poco_*.ps1 | %{. $_}
Pop-Location
function Select-Poco
{
Param
(
[Object[]]$Property = $null,
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent (threadDelay)
import Control.Lens
import Control.Monad.IO.Class (liftIO)
import Control.Monad.State
import Data.List (nub, isPrefixOf)
import Data.Text.Lazy.Encoding (decodeUtf8)
import Data.Text.Lens (unpacked)
import qualified Network.Wreq as Wreq
-- interface is a more familiar name for the intention of the construct
type alias Append a rest = { rest | append : a -> a -> a}
-- implement is a more familiar name
stringAppend rest = {rest | append = \x y -> x ++ y}
-- this is Monoid
type alias AppendWithId a rest = Append a {rest | id : a}
-- ^ 1 potential superclass
% rails g model m `ruby -e "801.times {|i| print %(c#{i} )}"` && rake db:migrate
% rails r 'p M.new.methods.length'
#=> 10000
module Lib where
import Control.Lens
data Foo = Foo { a :: Int, b :: String, c :: Char } deriving Show
data Bar = Bar { x :: Int, y :: String } deriving Show
constructBar :: Lens Foo Foo Bar Bar
constructBar = lens getFoo2Bar setFooFromBar
getFoo2Bar :: Foo -> Bar