タグ

typesに関するyharaのブックマーク (81)

  • A minimalistic example of bidirectional type checking for system F

    Main.hs Sf�XU �� �XU {-# LANGUAGE StrictData, DerivingVia, OverloadedRecordDot #-} {- (compiled with GHC 9.4.2) -} {- HEADS UP this is an example implementation of a non-trivial type system using bidirectional type checking. it is... - naive: a real implementation would use more advanced techniques such as NbE, elaboration to core, debruijn representation, and various optimizations - minimal: ther

    A minimalistic example of bidirectional type checking for system F
    yhara
    yhara 2023/01/15
  • それ、モノイド(Monoid)でできるよ

    この Scrap について TODO 全てのサンプルコードには以下の import が存在している前提でお読みください。

    それ、モノイド(Monoid)でできるよ
    yhara
    yhara 2022/07/08
  • 多相関数を第一級で取り扱う


    GHC RankNTypes  Haskell-jp 稿 ()  Haskell   () ((parametric) polymorphic fu
    多相関数を第一級で取り扱う
  • Rustのトレイトは「高カインド多相のない型クラス」である - なんか考えてることとか

    Rustのトレイト(以降Rustトレイトとつなげて呼ぶことにする)は一体何なのか、様々な他言語の概念を通して調べていたが、やっと(「やはり」でもあるのだが)結論が出たので書いていこうと思う。 また、Rustトレイトはインターフェースなのか、MixInなのか、はたまたトレイトなのかということについて書き直したかったのでそれもついでに書く。 Rustのトレイトにおける否定 前置き Rustのトレイトはインターフェースではない RustのトレイトはJavaのインターフェースではない RustのトレイトはC#のインターフェースではない RustのトレイトはMixInではない Rustのトレイトはトレイトではない Rustのトレイトは「高カインド多相のない型クラス」だった 根拠1: 型クラスと用法が同じである 根拠2: 重複する関数があった際の挙動も同じ Rustのトレイトでは高カインド多相ができな

    Rustのトレイトは「高カインド多相のない型クラス」である - なんか考えてることとか
    yhara
    yhara 2022/03/27
    めちゃめちゃ参考になった
  • Type Sets Proposal 勉強会 (2021/08/01 13:00〜)


     GoType Sets Proposal Nobishii ()  Go "Type Sets" proposal  - Zenn Type Sets Proposal(2) - Zenn Type Parameters Proposal  (Google Meet)   Nobishii Type Sets Proposal Type Sets 
    Type Sets Proposal 勉強会 (2021/08/01 13:00〜)
  • パターンマッチの網羅性検査


    1exit1 2 22
    yhara
    yhara 2021/07/28
    まとめありがたい
  • Higher Kinded Types - herp-technote

    例えばHKTの無いOCamlでは、'a list は型ではなく型コンストラクタという扱いになっているが、HKTのあるHaskell(List A または [A])では * → * という A型を受け取って[A]を返す型である。 式を取って式を返すという関数が式であるとさまざまな実りがある(c.f. ラムダ計算)ように、型を受け取って型を返すという仕組みも型に含まれているとさまざまな嬉しさがある。

    Higher Kinded Types - herp-technote
    yhara
    yhara 2021/07/19
  • Go の "Type Sets" proposal を読む

    Intro 読者の想定知識 この記事で出てくるGo言語仕様用語 サマリー Context Type Parameters Proposalの要点 Type listの必要性 暗黙的な"underlying type matching"の問題 type listからsum typeへ underlying type matchingと代入可能性 underlying type matchingと型switchステイトメント underlying type matchingの表現力の限界 Type Sets Proposal Type sets(型集合) 型Tがinterface ITを実装するための条件 要素を埋め込んだインタフェースのtype set interface elements(インタフェース要素) 任意の型(インタフェース型に限らない) approximation elemen

    Go の "Type Sets" proposal を読む
    yhara
    yhara 2021/04/14
  • Another Generic Dilemma

    Another Generic Dilemma Feb 24, 2021 In “The Generic Dilemma”, Russ Cox observes that you can have only two of separate compilation unboxed values parametric polymorphism (but see 1 and 2 for how you can achieve a middle ground with enough compiler wizardry) Now that Go is getting generics, I want to point out another dilemma: Any language has parametric polymorphism, eventually If you start with

    yhara
    yhara 2021/02/24
  • RustのHigher-Kinded type Trait | κeenのHappy Hacκing Blog


    κeenRust使Higher Kinded type Trait RustHKT HKT map  OptionResultetc  map   Option: map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> Result: map<U, F: FnOnce(T) -> U>(self, op: F) -> Result<U, E> map
    RustのHigher-Kinded type Trait | κeenのHappy Hacκing Blog
  • Javaによる型制約を持ったインスタンスメソッドの模倣 - ロジニキ雑記


     JavaParameterized TypeParameterized Type   public final class Holder<T> { private final T t; public Holder(T t) { this.t = t; }public T t() { return t; } // Holder
    Javaによる型制約を持ったインスタンスメソッドの模倣 - ロジニキ雑記
  • Applicative勉強会

    Applicative勉強会 halcat0x15a

    Applicative勉強会
  • kadai1

    課題4 線形型に関する論文を読んでそれに基づく型推論プログラムを書く 線形型システムとは? 線形型システムとは、プログラム実行中に作られた値が何度使われうるかによって 型を区別するような型システムです。例えば、整数の型はMLの型システムでは単に"int" ですが、 線形型システムでは、高々一回しか使われない整数の型は"int<1>", 何回でも使われうる 整数の型は"int<ω>" のように区別されます。このように型の概念を拡張しても MLと全く同じように自動的に型推論が行なえる (ここでは型の概念が拡張されていますから、 各データが何回使われるかも自動的に推論されることになります)ことが最近になって知られており、 例えば、fn x=>x+1 の型は、∀i>=1, j.(int<i> -> int<j>) のように推論できます。 線形型って何の役に立つの? プログラム実行中に高々一度しか使

    yhara
    yhara 2021/01/27
  • 【Kotlin】try-catch がやりにくければ runCatching を使ってみよう! - Qiita


       try-catch-finally try-catch-finally     fun noException() { val myValue = getMyValue() //  .also { onMySuccess(it) //  onMySuccess  onMyFinally() //  onMyFinally  } setMyValue(myValue) }  getM
    【Kotlin】try-catch がやりにくければ runCatching を使ってみよう! - Qiita
  • Arrowの紹介その1


    Picapp    ΛrrowArrowLibrary? Λrrow is a library for Typed Functional ProgramminginKotlin.   ArrowDataTypes 姿 DocumentKotlinSlack#arr
  • F-ing Modules, yabaitech.tokyo vol.5


    yabaitech.tokyo vol.5gfn(@bd_gfngfn)F-ing modules F-ing Modules F-ing ModulesF-ing ModulesF-ing modulesRossberg, Russo, Dreyer32 F-ing Modules (TLDI, 2010)F-ing Modules (JFP, 2014)RussoDreyerML2ML
    yhara
    yhara 2020/12/02
  • Rust の `!` (ビックリマーク、エクスクラメーションマーク、感嘆符、never) 型 - Don't Repeat Yourself


    Rust 1.47.0 (stable) nightly 使 nightly  TL; DR Rust ! never  使 使 never  TL; DR  ! = never  never  Coercing  never  std::convert::Infallible Rust ! Rust !使 
    Rust の `!` (ビックリマーク、エクスクラメーションマーク、感嘆符、never) 型 - Don't Repeat Yourself
  • Swiftで高カインド多相

    potatotips #52 iOS/Android開発Tips共有会 (Jun 21, 2018) https://potatotips.connpass.com/event/88164/ Library: https://github.com/inamiy/HigherKindSwift

    Swiftで高カインド多相
  • ScalaのOptionクラスのソースコードを読んでみた | メンバーズエッジカンパニーブログ

  • Background: how we got the generics we have (Or, how I learned to stop worrying and love erasure)


     This article was written by Brian Goetz (Java Architect, Oracle). http://cr.openjdk.java.net/~briangoetz/valhalla/erasure.html  2004Javaerasuretype erasureerasure
    Background: how we got the generics we have (Or, how I learned to stop worrying and love erasure)
    yhara
    yhara 2020/07/07