Skip to content

Instantly share code, notes, and snippets.

@oleks
oleks / keybase.md
Last active October 15, 2017 20:16

Keybase proof

I hereby claim:

  • I am oleks on github.
  • I am oleks (https://keybase.io/oleks) on keybase.
  • I have a public key whose fingerprint is 851E A9A9 4FB2 6EF2 46D9 5E9A FF3B 19F0 883C DB4E

To claim this, I am signing this object:

@oleks
oleks / part1.md
Last active March 7, 2016 21:52
Notebook 1

Test

module Expr
data Expr = X
| Plus (Expr, Expr)
Show Expr where
show X = "x"
show (Plus (e_left, e_right)) = (show e_left) ++ " + " ++ (show e_right)
{-
module Spaces
import Lightyear.Char
import Lightyear.Combinators
import Lightyear.Core
import Lightyear.Strings
toomany : Either String (List Char)
toomany = parse (many $ char ' ') " "
@oleks
oleks / A.idr
Last active April 15, 2017 15:37
Using dependent types in regular types
module A
import Data.Vect
data T =
MkT (Vect len Int)
eq' : Vect n Int -> Vect m Int -> Bool
eq' {n} {m} v w = n == m && (exactLength n v) == (exactLength n w)
@oleks
oleks / A.idr
Last active April 16, 2017 21:27
Defining equality for a non-dependent type hosting a dependent type
module A
import Data.Vect
data T
= Val Int
| Vec (Vect len T)
vectEq : Eq a => Vect n a -> Vect m a -> Bool
vectEq {n} {m} v w = n == m && Just v == (exactLength n w)
module Sample
import Data.Vect
import Data.SortedMap
X : (n : Nat) -> Type
X n = Vect n Nat
Y : Nat -> Nat -> Type
Y m n = Vect m (X n)
$ java --version
openjdk 9.0.0.15
OpenJDK Runtime Environment (Zulu build 9.0.0.15+181)
OpenJDK 64-Bit Server VM (Zulu build 9.0.0.15+181, mixed mode)
@oleks
oleks / gist:79ced969f38fc193a17037d3bca44f69
Created November 7, 2017 17:20
Rider 2017.2 installation fails
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.ide.ClassUtilCore to field sun.net.www.protocol.jar.JarFileFactory.fileCache
WARNING: Please consider reporting this to the maintainers of com.intellij.ide.ClassUtilCore
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ERROR: null
java.lang.reflect.InvocationTargetException
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1328)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1303)
// K&R style (according to Rider)
if (condition) {
foo();
}
else {
foo();
}
// One true brace style (1TB)
if (condition) {