Skip to content

Instantly share code, notes, and snippets.

View bryal's full-sized avatar
😸

JoJo bryal

😸
View GitHub Profile
@bryal
bryal / init.el
Created September 11, 2017 18:40
(prefer-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8-unix)
(setq menu-bar-mode nil)
(setq scroll-bar-mode nil)
(setq scroll-margin 22)
(setq show-paren-mode t)
(setq tool-bar-mode nil)
(setq tooltip-mode nil)
(setq undo-limit 800000)
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
class Add a b where
type Ret a b :: *
add :: a -> b -> Ret a b
instance Add Int Double where
type Ret Int Double = Double
add a b = (fromIntegral a) + b
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
class Add a b where
type Ret a b :: *
add :: a -> b -> Ret a b
instance Add Int Double where
type Ret Int Double = Double
add a b = (fromIntegral a) + b
Error: Type mismatch: Expected `Bool`, found `Bool`
Cannot infer or coerce `Bool` to `Bool`
--> test.kvs:21:17
21: (if (=i i 0)
^^^^^^^^
(extern malloc (-> UInt (Ptr UInt8)))
(extern read_int64 (-> RealWorld (Cons Int64 RealWorld)))
(extern print_int64 (-> (Cons Int64 RealWorld) (Cons Nil RealWorld)))
(extern print_float64 (-> (Cons Float64 RealWorld) (Cons Nil RealWorld)))
(extern eq-int64 (-> (Cons Int64 Int64) Bool))
(extern lt-int64 (-> (Cons Int64 Int64) Bool))
(extern gt-int64 (-> (Cons Int64 Int64) Bool))
(extern mul-int64 (-> (Cons Int64 Int64) Int64))
(extern div-int64 (-> (Cons Int64 Int64) Int64))
match *tree {
// Type application, e.g. `(Vec Int32)`; or type variable with constraints,
// e.g. `(: t Num)`
CST::SExpr(ref app, ref pos) if !app.is_empty() => match app[0] {
CST::Ident(":", _) if app.len() > 2 => {
let tv = self.parse_constraints_spec(&app[1..]);
let name = tv.explicit.unwrap();
if tvars.contains_key(name) {
let first_pos = &tvars.get(name).unwrap().1;
pos.error("Type variable has already been defined in this scope");
<h1> hello </h1>
<marquee> world </marquee>
#!/usr/bin/env python3
import sys, os, socket, subprocess
from pathlib import Path
STATIONS = [
("radio noden", "https://streamer.radio.co/sb562d9095/listen"),
("p1 - sr", "https://sverigesradio.se/topsy/direkt/132-hi-aac.m3u"),
("p2 - sr", "https://http-live.sr.se/p2musik-aac-320"),
("p3 - sr", "https://sverigesradio.se/topsy/direkt/164-hi-aac.m3u"),