{{ message }}

Instantly share code, notes, and snippets.

🦉
Someone here is possessed by an owl. Who?

🦉
Someone here is possessed by an owl. Who?
Created Jan 30, 2014
View Param.hs
 module Param where data Param = Param { param1 :: Int, param2 :: Int, param3 :: Int, param4 :: Int, param5 :: Int, param6 :: Int, param7 :: Int,
Last active Aug 29, 2015
Typeclasses in JavaScript.
View Algebra.hs
 {-# LANGUAGE RankNTypes #-} module Algebra where data Monoid a = Monoid { zero :: a, op :: a -> a -> a } data Foldable f = Foldable { fold :: forall a. Monoid a -> f a -> a
Created Feb 15, 2014
beautiful-docs bug
View coffee.md

# My file

`# comment`
Last active Aug 29, 2015
View Foo.hs
 module Main where import Unsafe.Coerce -- ideq is strict in its parameters ideq :: a -> a -> Bool ideq a b = a `seq` b `seq` aid == bid where aid = unsafeCoerce a :: Int bid = unsafeCoerce b :: Int
Last active Aug 29, 2015
View MonoidalCategory.hs
 {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TupleSections #-} import Prelude hiding (fst, snd, curry, uncurry, (.)) import Control.Category import Data.Void import Control.Arrow (Kleisli(..), arr) class Category cat => MonoidalCategory cat p u | p -> u where
Created May 24, 2014
Glitch
View bacon.js
 var Bacon = require("baconjs"); var aBus = new Bacon.Bus(); a = aBus.toProperty(3); b = a.map(function (x) { return x * 2; }); c = a.map(function (x) { return x * 3; }); d = Bacon.combineWith(function (x, y) { return x + y; }, b, c);
Last active Aug 29, 2015
View sort-osx-path.sh
 # if we have haskell installed command -v runhaskell > /dev/null 2>&1 if [ \$? ]; then # Embedded haskell TMP=`mktemp /tmp/orderpath.XXXXXX` cat > \$TMP <<'EOF' module Main where import System.Environment (getEnvironment)
Last active Aug 29, 2015
View error.txt
 No instance for (Ord a0) arising from a use of ‘sort_idemp’ The type variable ‘a0’ is ambiguous Note: there are several potential instances:
Created Jul 17, 2014
Result of watching to much #OPLSS videos
View typed-css.md

CSS. Cascading Style Sheets. What are they?

Wikipedia says:

Cascading Style Sheets (CSS) is a style sheet language used for describing...

And one important observation: there are no abstraction mechanism in CSS. CSS expression evaluates to itself. Thus CSS is not very fascinating as a programming language.

There are sass, lesscss and others. They add some abbstractions mechanisms, notably variables and mixins (which are kind-of-functions). Yet I don't like them as languages, they are barely macro systems.

It would be nice to have pure (do you really need side-effects while generating CSS?) typed, well-designed CSS abstraction language.

Created Jul 17, 2014
View TicTacToe.agda
 module TicTacToe where open import Prelude open import Data.List -- TicTacToe it is! -- There is two players data Player : Set where X O : Player