relational-record-examples の sql/6.4.1a.sh に対応するHaskellコードの説明を書いていて、何だか嘘を書いている気分になったので調査してみた。ちなみに書いていた説明は以下のようなもの。英語は雰囲気です。
-- | sql/6.4.1a.sh
--
-- MySQL allows the syntax of UNION that has an order clause at the
-- last of query. SQLite does not.
toRealFloat . either error id . parseOnly Data.Attoparsec.ByteString.Char8.scientific :: ByteString -> Double |
#!/bin/bash | |
cabal configure && cabal build && cabal haddock --hyperlink-source \ | |
--html-location='http://hackage.haskell.org/package/$pkg/docs' \ | |
--contents-location='http://hackage.haskell.org/package/$pkg' | |
S=$? | |
if [ "${S}" -eq "0" ]; then | |
cd "dist/doc/html" | |
DDIR="${1}-${2}-docs" | |
cp -r "${1}" "${DDIR}" && tar -cvz --format=ustar -f "${DDIR}.tar.gz" "${DDIR}" | |
CS=$? |
module Free where | |
import Control.Applicative (Applicative(..)) | |
data Free f a = Pure a | Free (f (Free f a)) | |
instance Functor f => Functor (Free f) where | |
fmap f (Pure a) = Pure (f a) | |
fmap f (Free fa) = Free (fmap (fmap f) fa) |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Objective where | |
import Data.Functor.Identity (Identity(Identity)) | |
-- | | |
-- prop> runObject obj (fmap f m) = fmap (f *** id) (runObject obj m) | |
-- |
import Data.Char (chr) | |
import Numeric (showIntAtBase) | |
repr :: Int -> Chr | |
repr n | |
| n < 10 = chr (48 + n) | |
| n < 36 = chr (65 + n - 10) | |
| n < 62 = chr (97 + n - 36) | |
numbase62 :: (Integral a, Show a) => a -> String |
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
lga = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=local | |
#del = !"git status | grep -o 'deleted:.*' | sed 's/deleted:[\\t ]\\{1,\\}//g' | while read f; do git rm $f; done;" | |
del = !"git rm `git ls-files --deleted`" | |
sta = status | |
alias = !"if test -z $1; then loop=; for k in `git config --get-regexp ^alias\\. | sort | sed -e 's/^alias\\.\\(\\S*\\).*/\\1/g'`; do echo -n $k; loop="${loop}1"; if test ${#loop} -lt 5; then echo -n '\t'; else echo; loop=; fi; done; exit; fi; git config --list | grep ^alias\\.$1= | sed -e s/^alias\\.//; exit;" | |
[user] | |
email = メール |
module ExplicitMin (ExplicitMin) where | |
import Heap | |
data (Heap h) => ExplicitMin h a = E | |
| NE a (h a) | |
deriving (Show) | |
instance (Heap h) => Heap (ExplicitMin h) where | |
empty = E |
#!/bin/sh | |
exec "$0"/../ghc-mod ${1+"$@"} | dos2unix |
$ cab install ghc-mod | |
Resolving dependencies... | |
Downloading ghc-mod-1.10.8... | |
Configuring ghc-mod-1.10.8... | |
Preprocessing executables for ghc-mod-1.10.8... | |
Building ghc-mod-1.10.8... | |
[ 1 of 16] Compiling GHCChoice ( GHCChoice.hs, dist\build\ghc-mod\ghc-mod-tmp\GHCChoice.o ) | |
[ 2 of 16] Compiling Gap ( Gap.hs, dist\build\ghc-mod\ghc-mod-tmp\Gap.o ) | |
[ 3 of 16] Compiling ErrMsg ( ErrMsg.hs, dist\build\ghc-mod\ghc-mod-tmp\ErrMsg.o ) | |
[ 4 of 16] Compiling Types ( Types.hs, dist\build\ghc-mod\ghc-mod-tmp\Types.o ) |