ScalaCheck 1.14.0 was just released with support for deterministic testing using seeds. Some folks have asked for examples, so I wanted to produce a Gist to help people use this feature.
These examples will assume the following imports:
Kris Nuttycombe asks:
I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?
I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.
I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.
import spire.algebra._ | |
import spire.implicits._ | |
object Transducer { | |
type RF[R, A] = (R, A) => R | |
def apply[A, B](f: A => B) = | |
new Transducer[B, A] { | |
def apply[R](rf: RF[R, B]): RF[R, A] = (r, a) => rf(r, f(a)) | |
} |
Gödel left in his papers a fourteen-point outline of his philosophical beliefs, that are dated around 1960. They show his deep belief in the rational structure of the world. Here are his 14 points:
( maze.tal ) | |
( ) | |
( mazes generated by randomized depth-first search ) | |
( press any key to generate a new maze ) | |
( ) | |
( generator uses a simple 16-bit xorshift RNG ) | |
( based on http://b2d-f9r.blogspot.com/2010/08/16-bit-xorshift-rng-now-with-more.html ) | |
%DEBUG { #ff #0e DEO } | |
%<<5 { #50 SFT2 } |
--- uxnbot.lua 2022-10-20 21:33:58.783691604 -0400 | |
+++ uxnrepl.lua 2022-10-20 21:33:14.229193549 -0400 | |
@@ -1201,6 +1201,12 @@ | |
end | |
end | |
local chat = require('chat') | |
+print('uxnrepl (ctrl-d to quit)') | |
+io.write('> ') | |
+io.flush() | |
for l in io.stdin:lines() do |
( main method for testing ) | |
|0100 | |
#1234 #0001 ;testcases JSR2 | |
#0000 #0431 ;testcases JSR2 | |
#0039 #0003 ;testcases JSR2 | |
#9321 #ffff ;testcases JSR2 | |
#ffff #9321 ;testcases JSR2 | |
#ffff #ffff ;testcases JSR2 | |
#7654 #8000 ;testcases JSR2 | |
#8000 #0001 ;testcases JSR2 |
#!/usr/bin/python | |
# | |
# by Erik Osheim | |
# | |
# This program uses a recursive descent, LL1 parser to generate a Code object | |
# for the given input. Code objects are pure expressions whose behavior can | |
# only be controlled via a dictionary of strings-to-numbers provided to run. | |
# | |
# Syntax: | |
# |
package half | |
import scala.math.{pow, round, signum} | |
import scala.util.Random.nextInt | |
import java.lang.{Float => JFloat} | |
/** | |
* Float16 represents 16-bit floating-point values. | |
* | |
* This type does not actually support arithmetic directly. The |