fn :: Int -> Int
fn x = x + 1
fnM :: State Int ()
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
import Control.Monad.Reader | |
class Iso a b where | |
isoFrom :: a -> b | |
isoTo :: b -> a |
module queue | |
import Data.Vect | |
-- Here's the port of the Liquid Haskell blog post on amortized | |
-- queues. The tricksy bit is that the "amortized" bit depends on | |
-- laziness. This means that while in the REPL (where Idris is lazy) | |
-- this is reasonably efficient. It compiles absolutely horribly | |
-- though because each time push or pop something we rotate the whole | |
-- damned thing. |
// what's the difference between: | |
var family = new Array(); | |
// and | |
var family = []; |
I hereby claim:
To claim this, I am signing this object:
-- This: | |
data GlishaState us libs = GlishaState { | |
userState :: us, | |
libraryState :: libs, | |
window :: G.Window, | |
drawFn :: DrawFn us | |
} | |
-- Action monad parametrized over us and libs | |
-- Both us and libs hoisted into MonadState for library or client |
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
</Grid.ColumnDefinitions> | |
<Grid.RowDefinitions> | |
<RowDefinition/> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition MinHeight="70"/> | |
</Grid.RowDefinitions> |
std::map<std::string, std::string> parseOptions(std::vector<std::string> const& args) { | |
std::map<std::string, std::string> options; | |
auto it = args.begin(); | |
it++; // skip the file name | |
while(it != args.end()) { | |
if (it->at(0) == '-') { | |
std::string key = *it; |
--hoistState :: Monad m => S.State s a -> S.StateT s m a | |
--hoistState = S.StateT . (return .) . S.runState | |
hoistState :: (Monad m, S.MonadState s m) => S.State s a -> m a | |
hoistState op = do | |
x <- S.get | |
let (r, x') = S.runState op x | |
S.put x' | |
return r |
int32_t n = 0; | |
int32_t duty = 99; | |
int32_t dutyChange = -1; | |
int32_t pulse = 100; | |
int32_t pulse_counter = 0; | |
while(1) { /* Loop forever */ | |
//btns = kb.GetKeys(); /* Read button states */ | |
btns = MyKeyboard_GetKeys(); |