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 A where | |
import GHCJS.Types | |
newtype Foo = Foo (JSRef ()) | |
foreign import javascript unsafe "" foo :: IO Foo | |
{- Output: |
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 GHCJS.DOM | |
import GHCJS.DOM.Types | |
import GHCJS.DOM.Document | |
import GHCJS.DOM.EventM | |
main = do | |
Just doc <- currentDocument | |
connect "keydown" doc $ do |
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 Data.Vector.Storable as V | |
main = do | |
print $ V.fromList [1..9 :: Float] | |
-- output: | |
-- "fromList [5.831554e-39,5.831554e-39,1.0,1.0,1.0,1.0,1.0,1.0,1.0]" |
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 NoMonomorphismRestriction #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE PolyKinds #-} | |
module A where | |
import Control.Lens | |
import Data.Vinyl | |
import GHC.TypeLits | |
class A f 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
import Prelude hiding ((++), concat) | |
import Control.Applicative | |
import Control.Monad | |
import Data.Maybe | |
import Data.Monoid | |
import System.Random | |
import qualified Data.IntMap as IM | |
import Graphics.DrawingCombinators | |
import qualified Graphics.UI.SDL as SDL | |
import Graphics.UI.SDL.Keysym |
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
---------------------------------------------------------------------- | |
vertex group | |
0x00004394 - 0x000043c3 | |
0x4394 flags: 1073741826 | |
0x4398 (16 bytes skipped): | |
0x43a8 vertex array bytes array, # entries: 135800 | |
0x43ac vertex array bytes array offset: 0x47178 | |
0x43b0 (8 bytes skipped): | |
0x43b8 vertex array stride bytes: 40 |
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 TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
module RotateArgs where | |
data Z = Z | |
data S n = S n | |
class RotateArgs n a 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
{-# LANGUAGE TypeOperators #-} | |
module StreamProc where | |
import Prelude hiding ((.), id, const) | |
import Control.Category | |
import Control.Arrow | |
import Control.Applicative | |
const :: (Arrow (~>)) => a -> (b ~> a) | |
const x = arr (\_ -> x) |
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 Control.Monad.State | |
import Data.Map (Map) | |
import qualified Data.Map as M | |
import Data.Set (Set) | |
import qualified Data.Set as S | |
import Data.List (isPrefixOf, intercalate) | |
import Data.Char (toLower) |
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.Set (Set) | |
import qualified Data.Set as S | |
bindSet :: (Ord a, Ord b) => Set a -> (a -> Set b) -> Set b | |
bindSet s k = S.unions . S.toList $ S.map k s | |
foldSet :: (Ord a ) => (a -> b -> Set a) -> a -> [b] -> Set a | |
foldSet _ a [] = S.singleton a | |
foldSet f a (x:xs) = bindSet (f a x) (\fax -> foldSet f fax xs) |
OlderNewer