# comment
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
module Param where | |
data Param = Param { | |
param1 :: Int, | |
param2 :: Int, | |
param3 :: Int, | |
param4 :: Int, | |
param5 :: Int, | |
param6 :: Int, | |
param7 :: 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
{-# 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 |
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
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 |
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 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 |
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
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); |
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
# 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) |
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
No instance for (Ord a0) arising from a use of ‘sort_idemp’ | |
The type variable ‘a0’ is ambiguous | |
Note: there are several potential instances: |
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.
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
module TicTacToe where | |
open import Prelude | |
open import Data.List | |
-- TicTacToe it is! | |
-- There is two players | |
data Player : Set where | |
X O : Player |
OlderNewer