Skip to content

Instantly share code, notes, and snippets.

View isomorpheme's full-sized avatar

Daan Rijks isomorpheme

View GitHub Profile
{-# LANGUAGE TemplateHaskell #-}
module A
( someFunc
) where
import B
$(splice)
@isomorpheme
isomorpheme / keybase.md
Created February 5, 2016 18:39
Keybase proof

Keybase proof

I hereby claim:

  • I am ijks on github.
  • I am ijks (https://keybase.io/ijks) on keybase.
  • I have a public key ASABOMeeb7wsWoD0D3bDKTADE4BKATh7_EOaxuvD0pz7YQo

To claim this, I am signing this object:

@isomorpheme
isomorpheme / example
Last active August 29, 2015 14:22
Word length count in Rust
$ cat test.txt
this is a line
this is another line
this is yet another line!
that was some whitespace
Supercalifragilisticexpialidocious is a very long word
But the full name of 'Titin', the largets known protein, is a whopping 189,819 characters! You're lucky I didn't paste it here...
$ cat test.txt | target/debug/wordcount_histogram
0: 1
@isomorpheme
isomorpheme / power_sum.rs
Created May 31, 2015 00:06
Find integers n such that sum(digit^3 for digit in n) == n
use std::env;
fn digits(x: u32) -> Vec<u32> {
x.to_string()
.chars()
.map( |c| {
c.to_string().parse::<u32>().unwrap()
}).collect()
}
@isomorpheme
isomorpheme / GHCI example
Last active August 29, 2015 14:13
/r/dailyprogrammer #196 in Haskell by /u/teslatronic
λ> :m Set
λ> let a = fromList [1,4,7]
λ> let b = fromList [-4, 7, 10]
λ> a `union` b
{1,4,7,-4,10}
λ> a `intersect` b
{7}
λ> let a' = complement a
λ> 7 `member` a'
Interrupted. -- Goes on forever, since elem needs to look through the whole list.