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
Up to date | |
Hello, Haskell! | |
1) Heap [ 13: NPrim Div | |
12: NPrim Mul | |
11: NPrim Sub | |
10: NPrim Add | |
9: NPrim Neg | |
8: NSupercomb twice | |
7: NSupercomb compose | |
6: NSupercomb S |
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 NPlusKPatterns #-} | |
{-# LANGUAGE LambdaCase #-} | |
module Subfactorial where | |
pair (f, g) x = (f x, g x) | |
outl (x, _) = x | |
outr (_, y) = y | |
type Nat = Integer |
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 NPlusKPatterns #-} | |
{-# LANGUAGE LambdaCase #-} | |
module Subfactorial where | |
type Nat = Integer | |
foldn :: (a, a -> a) -> Nat -> a | |
foldn (c, f) = u | |
where u 0 = c | |
u (n+1) = f (u n) |
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
{-# OPTIONS --guardedness #-} | |
module coinductive-tutorial where | |
record Stream (A : Set) : Set where | |
coinductive | |
field | |
hd : A | |
tl : Stream A | |
open Stream |
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
static private Dictionary<int, string> __eraAbbreviatedEnglishEraNameDict = null; | |
static private Dictionary<int, string> eraAbbreviatedEnglishEraNameDict | |
{ | |
get | |
{ | |
if (__eraAbbreviatedEnglishEraNameDict == null) | |
{ | |
CultureInfo cultureJp = new CultureInfo("ja-JP", true); | |
cultureJp.DateTimeFormat.Calendar = new JapaneseCalendar(); |
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
sig A { | |
} | |
sig B { | |
S : set A | |
} | |
sig C { | |
R : set 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
sig A{ | |
S: set A | |
} | |
fun id_A : A -> A{ | |
A -> A & iden | |
} | |
pred Simple{ | |
~S.S in id_A | |
} |
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 fib where | |
open import Data.Bool | |
open import Data.Empty | |
open import Data.Unit | |
open import Data.Fin renaming (zero to fzero; suc to fsuc) hiding (_+_) | |
open import Data.Nat | |
open import Data.Nat.Properties | |
open import Data.Nat.DivMod | |
open import Function |
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 TypeSynonymInstances, | |
FlexibleInstances | |
#-} | |
module FixPrimeTest where | |
import Prelude hiding (Functor(..), map, succ, either, head, tail, init, last) | |
import FixPrime | |
-- | List a | |
data ListF a x = Nil | Cons a x deriving (Show) |
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 LambdaCase #-} | |
module Take where | |
import Prelude hiding (take, drop, splitAt) | |
pair (f, g) x = (f x, g x) | |
safeTail :: [a] -> [a] | |
safeTail [] = [] | |
safeTail (_:xs) = xs |
NewerOlder