You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
[妄想] Rubyに欲しい文法 の記事を読んでいて、ここに書いてあるような動的型チェックであれば Contracts を使えばいいんじゃないのかな、と思いました。 Contracts とは Contracts という gem は、メソッドにコードコントラクトを設定する機構を追加するものです。 コードコントラクトというのは、あるコード(主にメソッド)に対して「事前条件(pre condition)」や「事後条件(post condition)」などを追加するもので、C++ や .NET Framework ではよく使われている(ような気がする)ものです。 ただ、この Contracts gem においては、もっと単純に、「メソッドの引数と戻り値がある条件を満たしているかをチェックするもの」と考えて良いと思います。そこに条件を設定できるなら、当然型チェックだって可能ですし、想定している用途とし
2020/12/27追記 https://www.ruby-lang.org/ja/news/2020/12/25/ruby-3-0-0-released/ => Ruby3.0.0にRBSとTypeProfと用いた静的解析に対するソリューションが提供されました。 今後はこちらのエコシステムをガンガン盛り上げていきましょう💪 #あいさつ P.S. 12/11 HaskellからRubypeにgemを変更しました こんにちは. 寒さが一段と厳しくなってきた事もありまして心を温めるGemを作りました. Rubyの振る舞いを汚染する事無く型保証の恩恵をゆるふわ受けられるgemです (型をつけるとか型保証という言葉をこの文脈ではメソッドの引数返り値のクラスを実行時にチェックするという意味で使っている.) 得体の知れないGemで抵抗感があるかもしれませんが、コード自体は50行以下の薄いGemなので
Code Faster.Tired of having to run your code to find bugs? Flow identifies problems as you code. Stop wasting your time guessing and checking. Code Smarter.It's hard to build smart tools for dynamic languages like JavaScript. Flow understands your code and makes its knowledge available, enabling other smart tools to be built on top of Flow. Code Confidently.Making major changes to large codebases
RubyKaigi 2014 レポート まつもとゆきひろさん、Ruby 3に向けて組み込んでみたいアイデアを提案 ~ RubyKaigi 2014 2日目 基調講演 2014年9月18日~20日の3日間、タワーホール船堀にてRubyKaigi 2014が開催されました。基調講演をそれぞれレポートします。 2日目の基調講演は、まつもとゆきひろさんです。まつもとさんは、過去に開催されたRubyConfでRubyに取り込んでみたいアイデアを提案してきました。しかし、最近のカンファレンスではRubyの未来についてあまり言及していませんでした。そこで今年は「Comming Soon...」というタイトルで、Ruby 3のアイデアを話しました。 今まで提案してきたアイデアを振り返る 2001年 まつもとさんは2001年のRubyConfでRubyのVirtual Machineを作りたいというアイデア
F7 is an enhanced typechecker for the F# programming language, a dialect of ML. F7 pioneers the static checking of security properties expressed with refinement types. Although the original motivation was to check security properties, F7 is not security-specific and is applied in other areas, such as database modelling. The theoretical core of F7 is the typed lambda-calculus Refined Concurrent FPC
土日使って気合で作った。 mizchi/dts-parser とりあえずlib.d.tsがパースできたのでだいたいのものはパースできると思う。 パース結果のファイルサイズが大きすぎてバイナリ扱いされてて笑った。 https://raw.githubusercontent.com/mizchi/dts-parser/master/lib.d.ts.parsed 使い方 こんな型定義dummy.d.tsが declare module Foo { export function fun(str: string):void; export function funfun(str: string):void; export var a:number, b: Object; export var c: Object; export class Bar { f():string; x: any; }
たぶん僕は人類の怠惰を極めたようなcoffee-scriptの文法が好きすぎるのだけど、その結果型を書けるcoffee-scriptを作り始めてしまった。 Fork元はCoffeeScriptRedux mizchi/CoffeeScriptRedux https://github.com/mizchi/CoffeeScriptRedux/tree/type とりあえず今の版だと次のコードが通る。 目標 x :: Number = 3 y :: String = "hello" z :: Boolean = false # z :: String = 4 #=> Error # y = x #=> Error a :: Any = 3 a = 'fadfa' b = 'a' fn :: Function = -> x = 3 n = -> i = '' f2 :: Function = (
type-check demo type-check is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. For more information, including documentation and more examples, please check out the README on GitHub. MIT License. Version 0.4.0 For updates on t
死なないシステムの構築のために考えたり、調べたりしたことのメモ。開発環境や手法等の気になる技術の記録など。Erlangの型チェックを簡単にするためのライブラリを教えてもらったので、試してみた。 コンパイル時にエラーを検出するものだと思っていたが、どうやら、-typeで定義した型のチェックを簡単にできるようにするものらしい。 以下のようなトランプのカードであるかを判定するコードを書いてみた。 -compile({parse_transform, sheriff}).を記載することで利用できるようになるよう。 実行してみる。 1>card:check_trump({14,heart}). No TrumpMark {heart, 14} ok 2>card:check_trump({13,heart}). Trump card is heart 13 ok 3>card:check_tr
Sam Tobin-Hochstadt <samth@racket-lang.org>, Vincent St-Amour <stamourv@racket-lang.org>, Eric Dobson <endobson@racket-lang.org>, and Asumu Takikawa <asumu@racket-lang.org> Typed Racket is Racket’s gradually-typed sister language which allows the incremental addition of statically-checked type annotations. This guide is intended for programmers familiar with Racket. For an introduction to Racket,
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く