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 Peano where | |
open import Data.Nat using (ℕ; zero; suc) | |
open import Relation.Binary.Core using (_≢_; refl) | |
{- | |
already defined: | |
data ℕ : Set where | |
zero : ℕ -- axiom 1 | |
suc : (n : ℕ) -> ℕ -- axiom 2 |
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
foo() { | |
List<List<int>> arr; | |
arr[0] = 0; // no error nor warning | |
arr = 0; // ditto | |
} | |
main() {} | |
// % dart foo.dart | |
// % | |
// % dart --enable_type_chekcs foo.dart |
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
noether (A::Set)(R::rel A) :: Type | |
= (P::pred A) -> ((x::A) -> ((y::A) -> R y x -> P y) -> P x) -> (x::A) -> P x | |
infiniteDescent (A::Set) | |
(R::rel A) | |
(P::pred A) | |
:: noether A R -> | |
((x::A) -> P x -> exists A (\(x1::A) -> and (R x1 x) (P x1))) -> | |
(x::A) -> not (P x) | |
= \ (h1::noether A R) -> | |
\ (h2::(x::A) -> P x -> exists A (\(x1::A) -> and (R x1 x) (P x1))) -> |
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
infiniteDescent : ∀ {a l} -> (A : Set a) -> (R : Rel A l) -> | |
(P : Pred A l) -> Noether A R -> | |
((x : A) -> P x -> ∃ (λ y -> R y x × P y)) -> | |
(z : A) -> ¬ (P z) | |
infiniteDescent A R P noe f | |
= noe (λ w → ¬ P w) g | |
where g : (x : A) → ((y : A) → R y x → ¬ P y) → ¬ P x | |
g x h px with f x px | |
... | (v , k) = h v (proj₁ k) (proj₂ k) |
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 Half where | |
-- http://staff.aist.go.jp/reynald.affeldt/tpp2011/garrigue_candy.v | |
open import Data.Nat | |
open import Data.Nat.Properties | |
open import Relation.Binary.Core | |
open import Relation.Binary.PropositionalEquality | |
half : ℕ -> ℕ |
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 | |
-- see also Shugo's blog | |
-- http://shugo.net/jit/20111129.html#p01 | |
import Control.Applicative | |
import Data.List | |
import System.Environment | |
import System.IO | |
import qualified Text.ParserCombinators.Parsec as PC |
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 Noricoco where | |
-- Hello! See also | |
-- http://togetter.com/li/312309 | |
open import Data.Empty using (⊥-elim) | |
open import Data.Nat using (_≟_; ℕ) | |
open import Data.Sum using (_⊎_; inj₁; inj₂) | |
open import Relation.Binary.PropositionalEquality using (_≡_) | |
open import Relation.Nullary using (yes; no) |
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
-- http://www.slideshare.net/yashigani/haskell-in/19 | |
module Homework where | |
import Data.List(foldl') | |
myNull :: [a] -> Bool | |
myNull [] = True | |
myNull _ = False |
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
-- http://koko-u.github.com/haskell_book_reading/#25 | |
import Data.Char (toUpper, intToDigit, isSpace) | |
import Data.List (isInfixOf, nub) | |
import Numeric (showIntAtBase) | |
upperCase :: String -> String | |
upperCase = map toUpper | |
removeSpaces :: String -> String |
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
2013-03-27 すごいHaskell読書会 in 大阪 #7 の課題について | |
@yashigani さんの出題した課題の設計方針を書きます | |
問題はこちら: | |
https://gist.github.com/yashigani/5231928 | |
上記資料の一番下に課題があります。 | |
転載: | |
----- |