This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExUnit.start | |
defmodule EventServerTest do | |
use ExUnit.Case, async: false | |
test "spawn and crash" do | |
pid = Process.spawn_link(fn -> | |
exit :foo | |
end) | |
:timer.sleep(1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExUnit.start | |
defmodule TeardownTest do | |
use ExUnit.Case | |
def teardown do | |
assert 1 == 2 | |
end | |
test "foo" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
pl : Bool -> Type -> Type | |
pl True t = Lazy t | |
pl False t = t | |
-- Only defined for True. | |
partial | |
onlyTrue : Bool -> Bool | |
onlyTrue True = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
import Effect.State | |
import Effect.Exception | |
printInner : { [ STATE Int, EXCEPTION Int ] } Eff m () | |
printInner = return () | |
main : IO () | |
main = runInit ['St := 1, 'Ex := 1] $ do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
import Effect.State | |
import Effect.StdIO | |
import Effect.System | |
data Level = Debug | Info | Warn | Error | Critical | |
-- Apparently Idris doesn't have deriving yet, so define those instances | |
-- manually. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE EmptyDataDecls #-} | |
module Main where | |
import Test.ClassLaws | |
data EqLaw1 a | |
class Eq a => EqLaws a where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
; Quick and ugly benchmark to see how if association lists for | |
; smallish lists are quicker to update than hash tables. | |
; To run: open in DrRacket and press the Run button. | |
(require plot) | |
; List of words of varying length. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am pminten on github. | |
* I am pminten (https://keybase.io/pminten) on keybase. | |
* I have a public key whose fingerprint is D3E4 F718 A175 34B4 6E8D 3B81 9B6C 1FB0 7226 79BA | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%default total | |
-- An infinite list of numbers (.., -2, -1, 0, 1, 2, ...) | |
-- with a way to go forward and backward. | |
codata NumberLine = NL Int NumberLine NumberLine | |
-- Make a number line starting at a particular point. | |
-- | |
-- Try changing "codata" above into "data". This function will fail to compile | |
-- as it's not guaranteed to terminate. |