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
-- | This JSON package retains the order of array elements. | |
-- JSON: http://www.ietf.org/rfc/rfc4627.txt | |
module JSON ( | |
JSON(..) | |
, parseJSON | |
) where | |
import Control.Applicative ((<*),(*>),(<$>),(<$)) | |
import Control.Monad (void) |
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
-- % cabal install PSQueue | |
-- % ghci Dijkstra.hs | |
-- > dijkstra sample A | |
-- [(A,0,A),(D,4,A),(E,7,D),(C,8,E),(B,9,E)] | |
module Dijkstra where | |
import Control.Applicative hiding (empty) | |
import Data.List (unfoldr) | |
import Data.Maybe (fromJust) |
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
-- ghc Main.hs -package ghc | |
module Main where | |
import DynFlags | |
import FastString | |
import HsSyn | |
import Lexer | |
import Outputable | |
import Parser |
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 LambdaCase #-} | |
{-# LANGUAGE NumericUnderscores #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
-- | | |
-- To reproduce with curl, run mainTls (from ghci) and use | |
-- | |
-- @ |
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 Main where | |
import Control.Monad | |
import Control.Monad.Free | |
import Prelude hiding (putChar, getChar) | |
import qualified System.IO as IO | |
import Test.QuickCheck | |
---------------------------------------------------------------- | |
-- Our DSL |
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 OverloadedStrings #-} | |
module Main where | |
import Data.IORef | |
import Data.Default | |
import qualified Network.HTTP.Types as Http | |
import qualified Network.Wai as Wai | |
import Network.Wai.Handler.Warp as Warp |
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 OverloadedStrings #-} | |
module Main where | |
import Control.Concurrent | |
import Control.Monad | |
import Data.ByteString hiding (putStrLn) | |
import Data.Default.Class | |
import Network.TLS | |
import Network.TLS.Extra.Cipher |
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 Main (main) where | |
import Control.Concurrent | |
main :: IO () | |
main = do | |
codechan <- newEmptyMVar | |
wait <- newEmptyMVar | |
myid <- myThreadId | |
putStrLn $ "I'm " ++ show myid |
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 BangPatterns #-} | |
-- % ghc -Wall -threaded -O A.hs | |
-- % ./A +RTS -N2 | |
-- | |
-- illegal hardware instruction | |
-- segmentation fault | |
module Main where | |
import Control.Concurrent |
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
Trying full handshake: | |
ClientHello --> | |
"010000e80303b90e92607bd3688f93ca0c05bc45253801a70c1b7d4d15e0919583594b3665b400003cc02bc02cc02fc030009e009fc023c024c027c0280067006bc009c00ac013c01400330039009c009d003d003c0035002f1301130200380032000a0005010000830000001d001b000018746c7331332e63727970746f2e6d6f7a696c6c612e6f7267ff01000100000a00060004001d0017000b00020100000d0012001008040805080604020503060304010201002b0003027f12002800260024001d0020252d54f0a5a7bfa3d61b904a616e2eed9dd091a0be6359ff44889610ddf49b44002d00020101" | |
"0200004e7f12e25d168388d7f371b510af05f0f1c55882cc14ef1e68fb97845b34271623ad991301002800280024001d00200b0870a2a19d080eaa56b5eda30e6e5978cffd5cd59afffa1bd6ea1cb6e66e26" | |
<-- ServerHello | |
"08000010000e000a00060004001d0017000000000b0009bc000009b800051830820514308203fca0030201020212031b91d311dd34af1b39e8a55d6f28eb45fb300d06092a864886f70d01010b0500304a310b300906035504061302555331163014060355040a130d4c6574277320456e6372797074312330210603550403131a4c6574277320456e637279707420417574686f72697479205833301e170d3137303 |
NewerOlder