-- one dot (.)
ghci
> :t (.)
(.) :: (b -> c) -> (a -> b) -> a -> c
> :t .-- one dot (.)
ghci
> :t (.)
(.) :: (b -> c) -> (a -> b) -> a -> c
> :t .| > import Text.Parse | |
| > | |
| -- type check | |
| > :t word | |
| word :: TextParser String | |
| > | |
| > :t runParser | |
| runParser :: Parser t a -> [t] -> (Either String a, [t]) | |
| > | |
| -- word |
#
# cnt <- newIORef 1
# :t cnt
cnt :: IORef Integer
# readIORef cnt
1
# writeIORef cnt 99
# readIORef cnt
99$ tree
.
└── view
├── base.html
└── main.content.html| :set -XOverloadedStrings | |
| -- EDEをつかうため | |
| import Text.EDE | |
| -- カスタムの関数を作るため | |
| import Text.EDE.Filters | |
| -- parseがかぶるのでObjectだけインポート | |
| import Data.Aeson.Types (Object) | |
| -- カスタムの関数を定義を格納するマップ | |
| import qualified Data.HashMap.Strict as Map |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Example.Example18 where | |
| import Control.Exception.Safe (SomeException, catch) | |
| -- my library |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Example.Example16 where | |
| import Control.Exception.Safe (SomeException, catch) | |
| -- my library |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE TypeFamilies#-} | |
| module Example.Example15 where | |
| import Control.Exception.Safe (SomeException, catch) | |
| -- my library |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| module Example.Example15 where | |
| import Control.Exception.Safe (SomeException, catch) | |
| -- my library | |
| import DataBase.MySQLX.NodeSession |
| >> "a" | |
| "a" | |
| >> "\a" | |
| "\a" | |
| >> "\\a" | |
| "\\a" | |
| >> "\\\a" | |
| "\\\a" | |
| >> P.length ("a"::String) | |
| 1 |