This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Nested div masked off by circular container div (SO) | |
* http://stackoverflow.com/q/12964400/1397351 | |
*/ | |
#nav{ | |
width: 100%; | |
height: 2em; | |
} | |
.aaa{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TestCase { | |
// Given input of type X return a function of | |
// type List[(A,B)] => List[B] forall B | |
// Types X & A are related | |
object filt extends Poly1 { | |
implicit def caseOne = at[Int]( i => { | |
object partialbind extends somefn(i); | |
partialbind | |
} ) | |
// ...may have other cases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ackage discsort | |
import scalaz._, Scalaz._ | |
import shapeless._ | |
// Attempt at implementing generic discrimiated sort, | |
// based on the following paper; | |
// www.diku.dk/hjemmesider/ansatte/henglein/papers/henglein2011a.pdf | |
trait SOrder[A] | |
case class Nat0(i: Int) extends SOrder[Int] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TestCase { | |
trait MYtype[A] | |
case class Bob(i: Int) extends MYType[Int] | |
case class Wibble[A,B](t1: MYType[A], t2: MYType[B]) extends MYType[A\/B] | |
// MYType => ( List[(A,B)] => List[B] ) | |
// So we define myfun for each member of the MYType ADT | |
object myfun extends Poly1 { | |
implicit def caseOne = at[Bob]( i => { ... somefn } ) | |
implicit def caseTwo[A,B] = at[Wibble[A,B]]( i => { { xs => myfun(as) ++ myfun(bs) } } ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Function | |
fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz" | |
| n `mod` 5 == 0 = "Buzz" | |
| n `mod` 3 == 0 = "Fizz" | |
| otherwise = show n | |
fzb = fix (\x acc -> (fizzBuzz acc):(x (acc+1))) 1 | |
-- take 100 fzb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Container :: * -> * -> * where | |
-- Some other cases go here | |
Map :: (a -> b) -> Container b v -> Container a v | |
-- Think a map type, k to v | |
combine :: (v -> v -> v) -> Container k v -> Container k v -> Container k v | |
combine c (Map f ct1) (Map g ct2) = Map f $ combine c ct1 ct2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes, GADTs, KindSignatures, ScopedTypeVariables, DataKinds, | |
TypeSynonymInstances, FlexibleInstances, OverlappingInstances, | |
TypeOperators, StandaloneDeriving #-} | |
module MyData.Trie where | |
import Control.Arrow | |
import Data.Array | |
import Data.Bits | |
import Data.Char |