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
#!/usr/bin/env stack | |
-- stack runhaskell | |
{-# OPTIONS_GHC -Wall -Wno-orphans #-} | |
import Data.Bifunctor | |
import Data.Foldable | |
import Data.List.NonEmpty (NonEmpty ((:|))) | |
import Data.Tree | |
import Test.QuickCheck |
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
#include <algorithm> | |
using std::transform; | |
#include <iostream> | |
using std::cerr; | |
using std::cout; | |
using std::endl; | |
#include <string> | |
using std::string; | |
#include <vector> | |
using std::vector; |
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 CountLines where | |
import Prelude hiding (length, lines, | |
readFile) | |
import Control.Monad.Trans.Resource (runResourceT) | |
import Data.ByteString.Streaming.Char8 (lines, readFile, toLazy) | |
import Streaming (mapped) | |
import Streaming.Prelude (fst', length) |
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
#!/usr/bin/env stack | |
-- stack --resolver=lts-13.10 script | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Default | |
import Network.HTTP.Req | |
main :: IO () | |
main = do |
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
#!/usr/bin/env stack | |
-- stack --resolver=lts-13.10 script | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.Text.Lazy as TextL | |
import Math.NumberTheory.Recurrencies | |
import Web.Scotty | |
main = scotty 8080 $ |
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
#!/usr/bin/env stack | |
-- stack --resolver=lts-13.0 script | |
{-# LANGUAGE TemplateHaskell #-} | |
import Data.String.Interpolate (i) | |
import Language.Haskell.TH.Quote (quoteExp, quoteFile) | |
main = putStr $(quoteExp (quoteFile i) "hello.txt") where | |
world = "мир" |
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
-- stack --resolver=lts-13.8 script | |
{-# OPTIONS -Wall -Wno-orphans #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
import Data.EDN (Tagged (..), TaggedValue, Value (..), renderText) |
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 OverloadedStrings #-} | |
import Control.Concurrent (forkIO) | |
import Control.Monad (void) | |
import Data.IORef (IORef, atomicModifyIORef, newIORef, | |
readIORef) | |
import Data.Map.Strict (Map) | |
import qualified Data.Map.Strict as Map | |
import Data.Text (Text) |
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
#include <functional> | |
#include <iostream> | |
using namespace std; | |
function<int(int)> add(int x) {return [=](int y){return x + y;};} | |
int main() { | |
cout << add(1)(2) << endl; | |
return 0; | |
} |
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 note4 = runNetworkSim $ do | |
Right note1 <- | |
runReplicaSim (applicationSpecific 1) $ | |
runExceptT $ | |
newObject Note | |
{ note_end = Nothing | |
, note_start = fromGregorian 2018 10 17 | |
, note_status = TaskStatus Active | |
, note_text = "пример" |