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
diff --git a/network-conduit-tls/Data/Conduit/Network/TLS.hs b/network-conduit-tls/Data/Conduit/Network/TLS.hs | |
index 0531118..4798809 100644 | |
--- a/network-conduit-tls/Data/Conduit/Network/TLS.hs | |
+++ b/network-conduit-tls/Data/Conduit/Network/TLS.hs | |
@@ -9,6 +9,7 @@ module Data.Conduit.Network.TLS | |
, tlsCertificate | |
, tlsKey | |
, tlsNeedLocalAddr | |
+ , tlsAppData | |
, runTCPServerTLS |
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 as P | |
import Control.Exception | |
import Control.Monad | |
import Control.Monad.Trans (MonadIO(..)) | |
import Data.ByteString.Char8 as BS | |
import Data.Conduit | |
import Data.Conduit.Binary as B | |
import Data.Functor | |
import Data.Conduit.Network | |
import Data.Monoid |
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 scalaz._ | |
import scalaz.Scalaz._ | |
import scala.collection.immutable._ | |
object Digits extends App { | |
def sequence[M[_]: Applicative, T[_], A](seq: T[M[A]])(implicit t: Traverse[T]): M[T[A]] = | |
t.traverse(identity[M[A]], seq); | |
def set[A](seq: Seq[A]): Set[A] = Set(seq : _*); | |
//def sorted[A](seq: Seq[A]): SortedSet[A] = SortedSet(seq : _*); |
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 #-} | |
import Control.Monad | |
import Control.Monad.State | |
import Control.Monad.Writer | |
import Data.Char (intToDigit) | |
import Data.Machine | |
import Data.Machine.Plan | |
import Data.Machine.Source | |
import Data.Monoid |
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
public final class None<T> | |
extends AbstractCollection<T> | |
implements Option<T> | |
{ | |
public None() {} | |
public T get() { | |
throw new IllegalArgumentException("No value"); | |
} |
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 java.nio._ | |
import java.nio.channels.Channels | |
import java.io.{ FileInputStream, IOException } | |
import java.util.zip._ | |
import scala.util.control.Exception._ | |
import conduit._ | |
import conduit.Pipe._ | |
object CloseExample extends App { | |
/** |
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
/* | |
BSD3 license | |
------------ | |
Copyright (c) 2013, Petr Pudlák | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
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 Control.Monad | |
import Data.Conduit.Internal | |
import Data.Void | |
import Data.Sequence | |
type PipeF i o u m r = Pipe Void i (Either i o) u m r | |
-- | Implements feedback for a `PipeF`, converting it to `Pipe`. | |
-- Any leftover feedback not consumed by the pipe (or produced after its |
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 Parser where | |
import Data.Char | |
-- | Built-in functions in our language: | |
data BuiltFn | |
= Nat Integer -- ^ Natural number | |
deriving (Eq, Ord, Read, Show) |
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 python | |
import hashlib | |
import sys | |
input = ['#!/usr/bin/env python', 'import hashlib', 'import sys', 'try: input', 'except NameError: input = []', 'try: trans', "except NameError: trans = lambda x: 'MD5 sum of my source is: ' \\", ' + hashlib.md5(x).hexdigest()', 'lines = input', 'lines.insert(3, "input = " + repr(input))', "out = '\\n'.join(lines) + '\\n'", 'print trans(out),'] | |
try: input | |
except NameError: input = [] | |
try: trans | |
except NameError: trans = lambda x: 'MD5 sum of my source is: ' \ | |
+ hashlib.md5(x).hexdigest() | |
lines = input |