A higher kinded type is a concept that reifies a type constructor as an actual type.
A type constructor can be thought of in these analogies:
- like a function in the type universe
- as a type with a "hole" in it
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
using System;namespace | |
donut.net{class Program{static | |
void Main(string[] args){double A=0 | |
,B=0,i,j;var z=new double[7040];var b= | |
new char[1760];while(true){memset(b,' ',1760); | |
memset(z,0.0f, 7040);for(j=0;6.28>j;j+=0.07)for( | |
i=0;6.28>i;i+=0.02){double c = Math.Sin(i);double d | |
=Math.Cos(j);double e=Math.Sin(A);double f=Math.Sin(j); | |
double g=Math.Cos(A); double h=d+2;double D=1 | |
/(c*h*e+f*g+5);double l=Math.Cos(i);double m= |
use std::rc::Rc; | |
trait HKT<U> { | |
type C; // Current type | |
type T; // Type with C swapped with U | |
} | |
macro_rules! derive_hkt { | |
($t:ident) => { | |
impl<T, U> HKT<U> for $t<T> { |
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
struct foo {
struct bar {
int x;
# modified from Original source: https://github.com/python/mypy/issues/731#issuecomment-539905783 | |
from typing import Union, Dict, List | |
JSONPrimitive = Union[str, int, bool, None] | |
JSONType = Union[JSONPrimitive, 'JSONList', 'JSONDict'] | |
# work around mypy#731: no recursive structural types yet | |
class JSONList(List[JSONType]): | |
pass |
\033[38;2;23;147;209m ▄ | |
▟█▙ | |
▟███▙ | |
▟█████▙ | |
▟███████▙ | |
▂▔▀▜██████▙ | |
▟██▅▂▝▜█████▙ | |
▟█████████████▙ | |
▟███████████████▙ | |
▟█████████████████▙ |
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c> |
from typing import Generic, Optional, TypeVar | |
from abc import ABC, abstractmethod | |
from dataclasses import dataclass | |
T = TypeVar('T') | |
E = TypeVar('E') | |
class Result(Generic[T, E], ABC): | |
@abstractmethod |
call plug#begin() | |
Plug 'drewtempelmeyer/palenight.vim' | |
Plug 'vim-airline/vim-airline' | |
Plug 'wlangstroth/vim-racket' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'rust-lang/rust.vim' | |
Plug 'preservim/tagbar' | |
Plug 'universal-ctags/ctags' | |
Plug 'luochen1990/rainbow' | |
Plug 'vim-syntastic/syntastic' |