Skip to content

Instantly share code, notes, and snippets.

$ opam upgrade -v
Everything as up-to-date as possible.
The following newer versions couldn't be installed:
- base-bytes.legacy is not available because it requires OCaml < 4.02.0.
- camlp4.4.03.0 is not available because it requires OCaml >= 4.03.0.
The following would require downgrades or uninstalls, but you may upgrade them explicitely:
- async.112.24.00
- async_extra.112.24.00
- async_kernel.112.24.00
- async_unix.112.24.00
$ opam install async_extra.112.24.00 --dry-run
The following actions will be performed:
- remove core_bench.112.17.00
- upgrade pa_ounit from 112.17.00 to 112.24.00 [required by async_extra]
- downgrade zarith from 1.3 to 1.2 [required by asn1-combinators]
- upgrade bin_prot from 112.17.00 to 112.24.00 [required by async_extra]
- upgrade sexplib from 112.17.00 to 112.24.00 [required by async_extra]
- recompile pa_bench.112.06.00 [uses pa_ounit]
- recompile uri.1.8.0 [uses sexplib]
- upgrade typerep from 112.17.00 to 112.24.00 [uses bin_prot]
$ opam config report
# OPAM status report
# opam-version 1.2.0
# self-upgrade no
# os darwin
# external-solver aspcud
# criteria -count(removed),-notuptodate(request),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution)*
# jobs 6
# repositories 1* (http)
# pinned 1 (path)
Downloading semigroups-0.16.2.2...
Configuring semigroups-0.16.2.2...
Building semigroups-0.16.2.2...
Preprocessing library semigroups-0.16.2.2...
src/Data/Semigroup.hs:105:8:
Ambiguous module name ‘Numeric.Natural’:
it was found in multiple packages:
nats-0.1.2@nats_1SlQ91QfEGVBnpiEUJoePq base-4.8.0.0
Failed to install semigroups-0.16.2.2
@yminsky
yminsky / gist:5accb38dee5ce7b59e52
Created April 11, 2015 19:34
Attempt to Cabal install "implicit"
~ $ \rm -rf .cabal
~ $ cabal install implicit
Config file path source is default config file.
Config file /Users/yminsky/.cabal/config not found.
Writing default configuration to /Users/yminsky/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'implicit'.
You may need to run 'cabal update' to get the latest list of available
packages.
@yminsky
yminsky / gist:6082664b3ea074424c46
Created April 11, 2015 19:36
Now trying pandoc
~ $ cabal install pandoc
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: pandoc-1.13.2 (user goal)
trying: base-4.8.0.0/installed-901... (dependency of pandoc-1.13.2)
next goal: haddock-library (dependency of pandoc-1.13.2)
rejecting: haddock-library-1.2.0 (conflict: pandoc => haddock-library>=1.1 &&
<1.2)
rejecting: haddock-library-1.1.1, 1.1.0 (conflict:
base==4.8.0.0/installed-901..., haddock-library => base>=4.3 && <4.8)
@yminsky
yminsky / gist:1f8d17fb639a111c54eb
Created April 11, 2015 19:59
A better failure building implicit...
~ $ cabal install implicit
Resolving dependencies...
Downloading Boolean-0.2.3...
Downloading NumInstances-1.4...
Configuring Boolean-0.2.3...
Downloading ansi-terminal-0.6.2.1...
Configuring NumInstances-1.4...
Downloading byteorder-1.0.4...
Configuring ansi-terminal-0.6.2.1...
Downloading mtl-2.1.3.1...
@yminsky
yminsky / gist:544fc49c6d9a932ba424
Created April 19, 2015 22:47
The code that sounds good.
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(speakerPin,LOW);
delayMicroseconds(tone);
}
}
@yminsky
yminsky / gist:f98996143e4631eb739b
Created April 19, 2015 22:49
This one sounds worse, but is non-blocking
void play_note(long tone, long start, long now) {
long gap = now - start;
long step = gap / tone;
boolean high = (step % 2 == 0);
if (high) { digitalWrite(speaker_pin, HIGH); }
else { digitalWrite(speaker_pin,LOW); }
}
@yminsky
yminsky / Plotting sine and cosine with c3 and js_of_caoml
Created June 19, 2015 02:33
Plotting sine and cosine with c3 and js_of_ocaml
let get_by_id id =
let d = Dom_html.document in
Js.Opt.get (d##getElementById (Js.string id))
(fun () -> assert false)
let rec range i n =
if i >= n then [] else i :: range (i + 1) n
let base =
range 0 100