サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
衆院選
goto.ucsd.edu/~rjhala
The “Hello World!” example for fancy type systems is probably the sized vector or list append function (“The output has size equal to the sum of the inputs!”). One the one hand, its perfect: simple enough to explain without pages of code, yet complex enough to show off whats cool about dependency. On the other hand, like the sweater I’m sporting right now, it’s a bit well-worn and worse, was never
This morning, I came across this nice post which describes how one can write a very expressive type for filter using singletons. Lets see how one might achieve this with abstract refinements. 23: 24: {-@ LIQUID "--short-names" @-} 25: 26: import Prelude hiding (filter) 27: 28: import Prelude hiding (filter) 29: isPos, isEven, isOdd :: Int -> Maybe Int 30: filter :: (a -> Maybe a) -> [a] -> [a]
Liquid Types For Haskell Ranjit Jhala University of California, San Diego Joint work with: N. Vazou, E. Seidel, P. Rondon, D. Vytiniotis, S. Peyton-Jones
A large part of the allure of Haskell is its elegant, high-level ADTs that ensure1 that programs won’t be plagued by problems like the infamous SSL heartbleed bug. However, another part of Haskell’s charm is that when you really really need to, you can drop down to low-level pointer twiddling to squeeze the most performance out of your machine. But of course, that opens the door to the #heartbleed
Yesterday someone asked on Reddit how one might define GHC’s OrdList in a way that statically enforces its three key invariants. The accepted solution required rewriting OrdList as a GADT indexed by a proof of emptiness (which is essentially created by a run-time check), and used the new Closed Type Families extension in GHC 7.8 to define a type-level join of the Emptiness index. Today, let’s see
One of the great things about Haskell is its brainy type system that allows one to enforce a variety of invariants at compile time, thereby nipping a large swathe of run-time errors in the bud. Refinement types allow us to use modern logic solvers (aka SAT and SMT engines) to dramatically extend the scope of invariants that can be statically verified. What is a Refinement Type? In a nutshell, Refi
このページを最初にブックマークしてみませんか?
『goto.ucsd.edu』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く