Alternatively, you could create a file with contents [1, 2, 3] and read it to know the expected output: import json with open("example1.json", "r") as ex1_file: ex1 = ex1_file.read().rstrip() assert(json.dumps([1,2,3]) == ex1) The file example1.json is called a golden file. Here are some advantages of golden tests over ordinary unit tests: If the expected output is large in size, it may be impract
(この記事は Haskell (その2) Advent Calendar 2017 - Qiita の3日目の記事です) A Tour of Go in Haskell というサイトを作りました。 英語版(開発中) もあります。 サイトのソースは GitHub で管理しています。 概要 今流行りの Go 言語は並行並列処理が簡単に書けることを1つの売りにしているようです。 Haskell も Go と同じく軽量スレッドやチャネルを利用することができ、並行並列が得意な言語の1つです。 そこで、A Tour of Go という Go の有名なチュートリアルの 並行性 の章を Haskell で書いてみることで、 Haskell と Go を並行並列処理の記述という観点で比べてみよう、というのが A Tour of Go in Haskell になります。 Go ユーザや Haskell に慣れ
// # 24 // // From http://rosettacode.org/wiki/24_game // // Write a program that randomly chooses and displays four digits, each from 1 ──► 9 (inclusive) with repetitions allowed. // // The program should prompt for the player to enter an arithmetic expression using just those, and all of those four digits, used exactly once each. The program should check then evaluate the expression. // // The g
Miso is a small isomorphic Haskell front-end framework featuring a virtual-dom, diffing / patching algorithm, event delegation, event batching, SVG, Server-sent events, Websockets, type-safe servant-style routing and an extensible Subscription-based subsystem. Inspired by Elm and React. Miso is pure by default, but side effects can be introduced into the system via the Effect data type. Miso makes
async also provides a plethora of useful combinators that should be in the standard toolkit of every Haskell programmers, such as race, concurrently, the Concurrently Alternative Applicative, and many others. Some async patterns # Finally, I want to show some patterns that are common and that will hopefully give a bit of an idea of how async can be used to easily implement complex tasks. If you’re
Drive-by Haskell Contributions Neil Mitchell http://ndmitchell.com Getting started contributing • Or: ideas to improve your existing project Static -Wall Docs Haddock Test hpc Perf profile Goal: Start doing cooler stuff Time Complexity Typo Docs New func New feature Do: Check your change is welcome • Is the project on GitHub? • Look at the open PR’s – do they languish? • When was the last commit?
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く