Skip to content

Instantly share code, notes, and snippets.

@nobsun
Created August 11, 2014 06:53
Show Gist options
  • Select an option

  • Save nobsun/bfc1f88e1562ac0f51f5 to your computer and use it in GitHub Desktop.

Select an option

Save nobsun/bfc1f88e1562ac0f51f5 to your computer and use it in GitHub Desktop.
Haskellプログラミングのコツのようなもの(その2) ref: http://qiita.com/nobsun/items/c16417fdecd7f5c2f9fa
f . g $ x ≡ f $ g $ x -- (1)
$ ghci -v0↲
Prelude> :type ($)↲
($) :: (a -> b) -> a -> b
Prelude> :type (.)
(.) :: (b -> c) -> (a -> b) -> a -> c
(.) :: (b -> c) -> (a -> b) -> a -> c
(f . g) x = f (g x)
(f . g) $ x = f $ (g $ x)
f . g $ x = f $ g $ x
main = getContents >>= putStr . gonyo
interact f = getContents >>= putStr . f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment