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
$ cargo build | |
Compiling project v0.1.0 (file:///home/yoeight/code/rust/project-driver) | |
src/project/internal/types.rs:48:30: 48:34 error: cannot move out of borrowed content | |
src/project/internal/types.rs:48 connection_type: self.connection_type, | |
^~~~ | |
src/project/internal/types.rs:50:20: 50:24 error: cannot move out of borrowed content | |
src/project/internal/types.rs:50 creds: self.creds | |
^~~~ | |
error: aborting due to 2 previous errors | |
Could not compile `project`. |
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
benchmarking map/machines | |
time 49.16 ms (49.08 ms .. 49.24 ms) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 49.21 ms (49.17 ms .. 49.28 ms) | |
std dev 91.09 μs (50.76 μs .. 146.6 μs) | |
benchmarking map/pipes | |
time 32.91 ms (32.86 ms .. 32.95 ms) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 32.94 ms (32.92 ms .. 32.98 ms) |
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 RankNTypes, GADTs #-} | |
module Bidi where | |
import Control.Monad.Trans | |
import Data.Machine | |
data Pipe a' a b' b c where | |
Request :: a' -> Pipe a' a b' b 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
{-# LANGUAGE RankNTypes #-} | |
newtype State s a = State { runState :: forall r. s -> (a -> s -> r) -> r } | |
stateReturn :: a -> State s a | |
stateReturn a = State $ \s k -> k a s | |
stateMap :: (a -> b) -> State s a -> State s b | |
stateMap f (State sa) = State $ \s kb -> sa s (kb . f) |
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 RankNTypes #-} | |
newtype State s a = State { runState :: forall r. s -> (a -> s -> r) -> r } | |
stateReturn :: a -> State s a | |
stateReturn = undefined | |
stateMap :: (a -> b) -> State s a -> State s b | |
stateMap = undefined |
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 GADTs, ExistentialQuantification, RankNTypes #-} | |
data A | |
data B | |
data C | |
data Foo a where | |
FooA :: Foo A | |
FooB :: Foo B | |
FooC :: Foo C |
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 Prelude hiding (cycle) | |
newtype Mu f = Mu (f (Mu f)) | |
data Cons a b | |
= Nil | |
| Cons a b | |
instance Functor (Cons a) where | |
fmap _ Nil = Nil |
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 Unix where | |
import Data.Foldable (traverse_) | |
import System.IO | |
import Control.Monad.Trans | |
import Pipes | |
import Pipes.Parse | |
import qualified Pipes.Prelude as P |
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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE RankNTypes #-} | |
import Control.Applicative | |
import Control.Monad | |
import Control.Monad.State | |
import Control.Monad.Trans | |
-------------------------------------------------------------------------------- | |
-- | Free encoding | |
-------------------------------------------------------------------------------- |
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
GHC: 7.8.2 | |
Cabal: 1.18.0.3 |