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
Main.mapM_Unpack (f :: Word8 -> m ()) (PS payload rb1_a1Tf offset length) -> | |
let { | |
>> :: m () -> m () -> m () | |
>> = GHC.Base.>> @ m $dMonad_a1E5 @ () @ () } | |
in | |
letrec { | |
loop :: Addr# -> Int# -> m () -> GHC.Prim.State# GHC.Prim.RealWorld -> (# GHC.Prim.State# GHC.Prim.RealWorld, m () #) | |
loop addr index default_m world -> | |
case index of | |
(-1) -> (# world, default_m #) |
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
Main.mapM_IndexReverse = (f :: GHC.Word.Word8 -> m ()) (PS payload rb1_a1UY offset length) -> | |
let return :: m () | |
return = GHC.Base.return @ m $dMonad_a1Dq @ () GHC.Tuple.() | |
>> :: m () -> m () -> m () | |
>> = GHC.Base.>> @ m $dMonad_a1Dq @ () @ () | |
in | |
letrec { | |
loop :: Int# -> m () | |
loop index -> | |
case index of |
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 MultiWayIf, BangPatterns #-} | |
import Data.Word | |
import Data.Char | |
data Tape = Tape { negatives :: [Word8], currentTape :: !Word8, positives :: [Word8] } | |
mkTape = Tape (repeat 0) 0 (repeat 0) | |
shiftLeft (Tape (x:left) curr right) = Tape left x (curr:right) | |
shiftRight (Tape left curr (x:right)) = Tape (curr:left) x right |
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 OpenGLUtils where | |
import Data.ByteString ( ByteString(..) ) | |
import qualified Data.ByteString as BS | |
import qualified Data.ByteString.Unsafe as BSU | |
import Graphics.UI.GLUT | |
import Graphics.Rendering.OpenGL (($=)) | |
import qualified Graphics.Rendering.OpenGL as GL | |
import qualified Codec.BMP as BMP | |
import Foreign.ForeignPtr |
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 AlexMonadicTemplate (main) where | |
} | |
%wrapper "monad" | |
tokens :- | |
<0> . { mkL LDummy } | |
<0> $white ; | |
{ |
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
#!/bin/bash | |
function curlMingw { | |
local address="$1" | |
perl -e "use LWP::UserAgent;" -e "my \$ua = LWP::UserAgent->new;" -e "my \$req = HTTP::Request->new(GET => \"$address\");" -e "my \$resp = \$ua->request(\$req);" -e "print \$resp->decoded_content;" | |
} |
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
qscintilla-qt4 = stdenv.mkDerivation rec { | |
name = "qscintilla-qt4-${version}"; | |
version = pkgs.qscintilla.version; | |
disabled = isPy3k || isPyPy; | |
src = pkgs.qscintilla.src; | |
buildInputs = [ pkgs.python ]; | |
propagatedBuildInputs = [ pkgs.pyqt4 pkgs.qscintilla pkgs.qt4 ]; |
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
ТЕТРІС 0.0.0.12 | |
Реалізація класичного тетріса (з урізаними можливостями), з виводом у консоль. | |
Урізано: відображення наступної фігури та рахунку | |
клавіша прискореного падіння фігури | |
рівні та зміна швидкостей | |
Код переписано багато разів, з кожним разом він ставав все кращим та кращим. | |
> {-# LANGUAGE TemplateHaskell #-} |
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
#include <iostream> | |
#include <string> | |
#include <utility> | |
#include <conio.h> | |
#include <chrono> | |
#include <thread> | |
#include "react/Domain.h" | |
#include "react/Event.h" | |
#include "react/Observer.h" |
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
type Timer = ( Rational -- ^ start time | |
, Rational) -- ^ interval | |
createTimer :: Rational -- ^ interval | |
-> IO Timer | |
createTimer interval = | |
(\x -> (x, interval)) . toRational . utctDayTime <$> getCurrentTime | |
updateTimer :: Timer -> IO (Timer, Bool) | |
updateTimer (time, interval) = |
OlderNewer