So we're given the task of determining whether a given integer is a palindrome in base 10.
Seems easy enough:
isPalindrome :: Integer -> Bool
isPalindrome n = show n == reverse (show n)
Done. That was a short article.
// !debit [field] [action] decrements [field] and runs [action] if [field] > 0 | |
// | |
// examples (note the '\' to prevent the &{...} from running immediately) | |
// | |
// !debit classactionresource1 %\{Coll|classaction1} | |
// | |
// !debit repeating_classresources_-KBB1UHdMK0ygfFM3AtV_ClassResourceTotal %\{Coll|classaction2} | |
// | |
// (I don't know a better way to get repeating classaction ids than inspecting the page) | |
var DebitModule = DebitModule || (function(){ "use strict"; |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
module Temp where | |
data A = A1 | A2 | |
data B = B1 | B2 | |
data C (a :: A) (b :: B)where |
require 'set' | |
def ContextFreeGrammar(&blk) | |
ContextFreeGrammar.new(&blk) | |
end | |
class ContextFreeGrammar | |
attr_reader :rules | |
def initialize(&blk) | |
@rules = instance_eval(&blk) |
" adapted from https://github.com/aaronjensen/vimfiles/blob/2a88ef0b92f5a628e898189e612eb0feb34b1419/vimrc#L449-483 | |
" save as ~/.vim/plugin/bracketed_paste.vim to use | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Tmux wrapping borrowed from vitality.vim: https://github.com/sjl/vitality.vim | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
function WrapForTmux(s) | |
if !exists('$TMUX') | |
return a:s | |
endif |
dist | |
*.hi | |
*.o |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Temp where | |
type Point f = forall a. a -> f a | |
data Nat = Z | S Nat |
fizzbuzz: depinjex.c main.c | |
gcc -o $@ $^ | |
fizzbuzz-test: depinjex.c test.c | |
gcc -DENABLE_DEPENDENCY_INJECTION -o $@ $^ | |
test: fizzbuzz-test | |
./$^ | |
clean: |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Cascade where | |
import Control.Category | |
import Control.Comonad |
So we're given the task of determining whether a given integer is a palindrome in base 10.
Seems easy enough:
isPalindrome :: Integer -> Bool
isPalindrome n = show n == reverse (show n)
Done. That was a short article.
<!doctype html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
</body> | |
</html> |