Skip to content

Instantly share code, notes, and snippets.

@GongYiLiao
GongYiLiao / gfib.py
Created September 9, 2022 22:08
Trun Python into Haskell - a test
from itertools import islice
from typing import TypeVar, NoReturn
from collections.abc import Callable, Generator, Sequence, Iterable
T = TypeVar('T')
def gfib(f: Callable[[Sequence[T]], T],
xs:Sequence[T]) -> Generator[T]:
while True:
x, *xs = *xs, f(xs)
@GongYiLiao
GongYiLiao / major-mode-specific powerline
Created November 13, 2014 20:08
a failed attempt to build major-mode-specific powerline in emacs
;; fancy status line
(require 'powerline)
;; make poweline ### autoload
(defpowerline powerline-mule-info
(format-mode-line mode-line-mule-info))
;;
(defface powerline-filemode-active
'((t (:background "OliveDrab3" :foreground "grey22" :inherit mode-line)))