Skip to content

Instantly share code, notes, and snippets.

@sjoerdvisscher
sjoerdvisscher / Pro.hs
Last active May 23, 2018 21:16 — forked from ekmett/Pro.hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PolyKinds #-}
/*globals $ */
/*
* Patches the jQuery-animate method to use CSS-transitions when possible.
*
* - Depends on $.transit: http://ricostacruz.com/jquery.transit/
* - Degrades gracefully to the original method when transitions aren't supported.
* - Provides fallbacks for translateX/Y's, so { x:10, y:10 } (very smooth) will become { top:10, left:10 } (less smooth) for less capable browsers.
* - 3d-transforms could be enabled with enable3d:true. Example: { x:100, enable3d:true }
* - Transitions could be disabled with enableTransitions:false. Example: { x:100, enableTransitions:false }
{-# LANGUAGE TypeFamilies, GADTs, TypeOperators #-}
module LinearMap where
import Prelude hiding ((.))
import Data.Category
import Data.Category.Limit
type a :* b = (a,b)
@sjoerdvisscher
sjoerdvisscher / InductiveConstraints.hs
Created October 12, 2012 11:44 — forked from nfrisby/InductiveConstraints.hs
simple demo of "proving" in Haskell via singleton types
{-# LANGUAGE RankNTypes, TypeFamilies, DataKinds, TypeOperators,
ScopedTypeVariables, PolyKinds, ConstraintKinds, GADTs,
MultiParamTypeClasses, FlexibleInstances, UndecidableInstances,
FlexibleContexts #-}
module InductiveConstraints where
import GHC.Prim (Constraint)