THIS DRAFT HAS MOVED TO https://github.com/owickstrom/kashmir.
This file contains 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 where | |
import Debug.Trace | |
data T = A | B Number | |
instance eqT :: Eq T where | |
A == A = true | |
(B v1) == (B v2) = v1 == v2 | |
_ == _ = false |
This file contains 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 where | |
import Control.Applicative | |
-- value with type a is only for demo purposes, it would be supplied | |
-- asyncronously in Rackla (or with messages, I don't know how it works | |
-- exactly). | |
data PID a = PID a deriving (Show) | |
instance Functor PID where |
This file contains 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 Test.Spec where | |
import Debug.Trace | |
import Control.Monad | |
import Control.Monad.Error.Class | |
import Control.Monad.Trans | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Exception | |
import Control.Monad.Eff.Class | |
import Control.Monad.Aff |
This file contains 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
{ | |
"graph": { | |
"label": "Some Title", | |
"metadata": { | |
"id": "uc1" | |
}, | |
"nodes": [ | |
{ | |
"id": "user", | |
"label": "User", |
This file contains 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
(ns scratch.core | |
(:require [clojure.core.typed :as t])) | |
(t/defalias DropboxEntry | |
(t/Rec [x] | |
(t/U '{:type (Value :file) | |
:path String | |
:mime-type String} | |
'{:type (Value :directory) | |
:path String |
This file contains 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 | |
(require "minikanren/mk.rkt") | |
(struct e/var (name) #:transparent) | |
(struct e/app (fn param) #:transparent) | |
(struct e/lam (arg body) #:transparent) | |
(define (t/fn domain range) | |
(list ':fn domain range)) |
This file contains 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
(pkg main) | |
(import fmt) | |
;; if expressions | |
(: fib (int -> int)) | |
(def (fib n) | |
(if (== n 1) | |
0 | |
(if (== n 2) |
This file contains 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
//----------// | |
// SEMIRING // | |
//----------// | |
// Types that support addition and multiplication. | |
protocol Semiring(a) { | |
add : a -> a -> a | |
zero : a | |
mul : a -> a -> a | |
one : a |
This file contains 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
-- A data type wrapping a non-empty string | |
data Name : Type where | |
MkName : (s : String) -> (not (s == "") = True) -> Name | |
-- Some function that expects a valid Name | |
test : Name -> String | |
test (MkName s _) = s | |
-- Usage of that function. Do I need Refl here? Any better way of doing this? | |
foo : String |