Skip to content

Instantly share code, notes, and snippets.

View divarvel's full-sized avatar

Clément Delafargue divarvel

View GitHub Profile
data Dependency : String -> Type -> Type
where MkDep : (name: String) -> a -> Dependency name a
DepWrapper : Type -> Type
DepWrapper t = (String ** Dependency _ t)
dep1 : Dependency "toto" Int
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@mandubian
mandubian / gist:5396793
Created April 16, 2013 15:18
An recursive class Reads using the great lazyRead stuff... (Myself, I'm even astonished that it works :D)
sealed abstract trait Tree
case class Leaf(a: String) extends Tree
case class Node(l: Tree, r: Tree) extends Tree
implicit val treeR: Reads[Tree] =
__.read[Leaf].map(x => x:Tree) orElse
(
(__ \ "l").lazyRead(treeR) and (__ \ "r").lazyRead(treeR)
)(Node.apply _).map(x => x:Tree)
@tonymorris
tonymorris / TypeClass.hs
Last active September 15, 2020 13:17
Type-class hierarchy
Moved to https://github.com/tonymorris/type-class
@marcw
marcw / .bash_aliases
Created March 30, 2011 15:12
how to create tag file
alias tags='ctags -f tags -h ".php" -R --exclude=".svn" --exclude="*.yml.php" --totals=yes --tag-relative=yes --PHP-kinds=+cf --fields=+afkst --regex-PHP="/@method[ ][^ ]+[ ]+([^ (]*)/\1/f/"'