A guide to setting up the Haskell tooling for Emacs in a Nix environment.
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
package completable.async; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.concurrent.*; | |
import static java.util.concurrent.Executors.callable; | |
/** |
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
trait λ { | |
type α | |
} | |
trait Functor extends λ { | |
type α <: λ | |
def map[A,B](x: α { type α = A })(f: A => B): α { type α = B } | |
} |
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
import Test.QuickCheck | |
import Control.Applicative ((<$>)) | |
import Data.List (scanl) | |
-- To test whether my timsort implementation has the bug described in | |
-- http://envisage-project.eu/proving-android-java-and-python-sorting-algorithm-is-broken-and-how-to-fix-it/ | |
-- Answer: yes :-( | |
runLengthInvariantBroken :: (Num i, Ord i) => i -> i -> i -> i -> Bool | |
runLengthInvariantBroken a b c i = (b - a <= i - b) || (c - b <= i - c) |
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
Require Import List. | |
Import ListNotations. | |
Set Implicit Arguments. | |
Fixpoint reverse (X: Type) (xs: list X): list X := | |
match xs with | |
| [] => [] | |
| x :: xs' => reverse xs' ++ [x] | |
end. |
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
;;;; This script can be loaded during emacs initialization to automatically | |
;;;; send `kill-region' and `kill-ring-save' regions to your system clipboard. | |
;;;; The OSC 52 terminal escape sequence is used to transfer the selection from | |
;;;; emacs to the host terminal. | |
;;;; It is based off of the osc52.el copyright the Chromium OS authors, but | |
;;;; was modified to add support for tmux, graphical displays, and | |
;;;; multi-byte strings. | |
;;;; It works in hterm, xterm, and other terminal emulators which support the |
So what I understand to be your questions:
- What is a coherency problem?
- What does over constained code look like / cause?
- How do you lose your "desired" instance?
A way to step through understanding this problem:
- Oh shit, If I have local type classes, I have to handle crazy wacky cases in my implementation, this will likely have performance and correctness implications (see Coherency.scala)
- What happens if I close over constraint on construction? Oops if I close over it, I end up with OverConstrained code (see OverConstrainedCode.scala) and worse I still have coherency issues, and the ability to lose my intended behavious (LosingAnInstance.scala)
- Oh wow, if I just don't do local type classes, by never define conflicting implicits, and ascribe a single type to each behaviour, everything is simple and just works.
- hprof a builtin java agent which dumps profiling info at runtime
- class sharing class file cache used for faster startup times
- pack200 unpack200 uber packed jars
- mission control a Profiling, Monitoring, and Diagnostics Tools Suite
- jstat performance stats tool
- jhat heap dump browser
- jmap memory maps
- jstack prints stack trace of running process
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
Convention: Byte array notation as it would appear in a hexeditor. | |
= Layout= | |
KDBX files, the keepass database files, are layout as follows: | |
1) Bytes 0-3: Primary identifier, common across all kdbx versions: | |
private static $sigByte1=[0x03,0xD9,0xA2,0x9A]; | |
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1) |
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
### Versions | |
casper$ patsopt --version | |
Hello from ATS2(ATS/Postiats)! | |
ATS/Postiats version 0.0.6 with Copyright (c) 2011-2014 Hongwei Xi | |
casper$ ajhc --version | |
ajhc 0.8.0.11 (e601dfc26abce79686e41c2609ed5beb7fd7f4d5) | |
compiled by ghc-7.6 on a x86_64 running linux | |
casper$ idris --version | |
Idris version 0.9.11.2 |
NewerOlder