This file contains hidden or 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.IntMap (IntMap) | |
import qualified Data.IntMap as IM | |
import qualified Data.HashMap.Strict as HM | |
import Data.Aeson | |
transformIM :: ToJSON a => IntMap a -> Object | |
transformIM = HM.map toJSON . HM.fromList . convertKeys . IM.toList | |
where convertKeys = map (\(k, v) -> (T.pack $ show k, v)) |
This file contains hidden or 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 Rank2Types #-} | |
import Data.Word (Word8) | |
import Data.Bits (shiftL, (.|.)) | |
import qualified Graphics.UI.SDL as SDL | |
import qualified Graphics.UI.SDL.Primitives as Prims | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
{------------------------------------------------------------------------------ |
This file contains hidden or 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
$ curl -X PUT -H 'Content-Type: application/x-tar' -d @dist/doc.tar http://foo:[email protected]/package/verbalexpressions-1.0.0.0/docs | |
Warning: Couldn't read data from file "dist/doc.tar", this makes an empty | |
Warning: POST. | |
Invalid documentation tarball: truncated tar archive |
This file contains hidden or 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 Rank2Types #-} | |
import qualified Graphics.UI.SDL as SDL | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
{------------------------------------------------------------------------------ | |
Main | |
---------------------------------------------------------------------------} |
This file contains hidden or 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
right :: Event t Bool | |
left :: Event t Bool | |
ship = accumB 100 move | |
move n = whenMove left (fmap ($ n) add) | |
`union` whenMove right (fmap ($ n) sub) | |
add = once (+ 1) <@ tick | |
sub = once (flip (-) 1) <@ tick |
This file contains hidden or 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 Rank2Types #-} | |
import qualified Graphics.UI.SDL as SDL | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
{------------------------------------------------------------------------------ | |
Main | |
---------------------------------------------------------------------------} |
This file contains hidden or 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
-- I'm currently trying to translate this code https://github.com/bernstein/breakout/blob/master/src/ReactiveUtils.hs | |
-- to use linear package instead of vector-space, and I'm not sure if I've understood diffE completely. | |
import Linear.Vector | |
import Reactive.Banana | |
type Time = Double | |
integral :: (Additive f, Num a) => Event t Time -> Behavior t (f a) | |
-> Behavior t (f a) |
This file contains hidden or 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
integral :: Additive a => Event t Time -> Behavior t a -> Behavior t a | |
integral t b = sumB $ (\v dt -> dt *^ v) <$> b <@> diffE t |
This file contains hidden or 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
// Nexuiz version (formatted for humans) | |
set g_nexuizversion "2.1" | |
// Nexuiz version (formatted for machines) | |
// used to determine if a client version is compatible | |
// this doesn't have to be bumped with every release | |
// bump when clients become incompatible or any other perfectly good reason | |
// (e.g. game data incompatibility, engine version incompatibility, etc | |
// note: this automatically filters the server browser, clients of the new | |
// version won't see old servers, and clients of the old version won't see new |
This file contains hidden or 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 Hell | |
import DotHellRC | |
main = startHell def { configImports = "import DotHellRC" : configImports def } |