This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
class C c where | |
class A a where | |
cFrom :: C b => a -> b | |
instance C c => A ((,) c a) where | |
cFrom x = fst x --ghc cant deduce c 2 b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.Functor.Identity | |
infixr 4 .~ | |
infixl 1 & | |
instance Show a => Show (Identity a) where | |
show x = "Identity " ++ (show $ runIdentity x) | |
type Setter s t a b = (a -> Identity b) -> s -> Identity t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
module Main where | |
import Data.Functor.Constant | |
import Data.Foldable | |
import Data.Traversable | |
import Data.Monoid | |
import Control.Applicative | |
infixl 8 ^. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
module Main where | |
import Data.Functor.Identity | |
import Data.Functor.Constant | |
infixl 8 ^. | |
infixr 4 .~ | |
infixl 1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def hoge | |
print "HogeHoge\n" | |
end | |
end | |
F = Foo.new | |
F.hoge | |
class Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define $hoge | |
(matcher { | |
;; <primitive-pp> | |
[,$val [] {[$tgt | |
(match [val tgt] [hoge hoge] { | |
[[<aaa> <aaa>] {[]}] | |
[[<bbb> <bbb>] {[]}] | |
[[<ccc> <ccc>] {[]}] | |
[_ {}]})]}] | |
;; <primitive-dp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define $maybe | |
(lambda [$a] | |
(matcher { | |
;; <primitive-pp> | |
[,$val [a] {[$tgt | |
(match [val tgt] [(maybe a) (maybe a)] { | |
[[<just $x> <just ,x>] {[x]}] | |
[[<nothing> <nothing>] {[]}] | |
[_ {}]})]}] | |
;; <primitive-dp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define $maybe | |
(lambda [$a] | |
(matcher { | |
;; <primitive-pp> | |
[,$val [a] {[$tgt | |
(match [val tgt] [(maybe a) (maybe a)] { | |
[[<just $x> <just ,x>] {[x]}] | |
[[<nothing> <nothing>] {[]}] | |
[_ {}]})]}] | |
;; <primitive-dp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define $maybe | |
(lambda [$a] | |
(matcher { | |
;; <primitive-pp> | |
[,$val [a] {[$tgt | |
(match [val tgt] [(maybe a) (maybe a)] { | |
[[<just $x> <just ,x>] {[x]}] | |
[[<nothing> <nothing>] {[]}] | |
[_ {}]})]}] | |
;; <primitive-dp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 検索文字列ハイライト | |
set hlsearch | |
""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 実行 | |
:function ExecFile() | |
:w | |
:if &filetype == "haskell" |
OlderNewer