Snippets created by Ryan Riley
NUnit Sugar
Some simple functions for writing more idiomatic F# tests with NUnit.
45 people like this
Posted: 1 years ago by Ryan RileyParallel Sitemap Test Runner
A sitemap-based url tester that runs in parallel.
35 people like this
Posted: 1 years ago by Ryan RileyEnumerableStream
A lazy enumerable/stream of bytes.
8 people like this
Posted: 1 years ago by Ryan RileyDictionary extensions
Extensions to dictionaries.
21 people like this
Posted: 1 years ago by Ryan RileyAsync TCP Server
A basic, asynchronous TCP server
15 people like this
Posted: 1 years ago by Ryan RileyAsync to IObservable
Wraps an Async as an IObservable to allow easier consumption by other .NET languages. Many thanks to desco for his help: http://cs.hubfs.net/forums/thread/16545.aspx
3 people like this
Posted: 1 years ago by Ryan RileyUri Parser
A Uri parser using the Cashel library [1]. This implementation is using ArraySegment<byte> as the underlying state, as I'm using it within a server, but it would be trivial to switch it to using a list. Also, note that I am not parsing the Uri into any specific structure, though that, too, would be trivial. For my current purposes, I just needed to validate the Uri. [1] https://github.com/panesofglass/cashel
20 people like this
Posted: 1 years ago by Ryan RileyComposable WCF Web API using Async
A functional wrapper around the new WCF Web APIs (http://wcf.codeplex.com/). Composition is achieved through the use of the HttpRequestMessage -> Async<HttpResponseMessage> signature. Pushing the app calls in the MessageHandler intercepts all requests and allows you to take control at the earliest point possible before operation selection occurs. Extending this slightly to call the innerChannel's SendAsync would allow you to create a middleware layer that would work both with this and other, normal Web API services.
39 people like this
Posted: 1 years ago by Ryan RileySequence Generator from Async
Generates a sequence using a sequence generator and Async.StartWithContinuations. This is an attempt at modeling the OWIN delegate structure in F#
4 people like this
Posted: 11 months ago by Ryan RileyIteratee
An iteratee based on https://john-millikin.com/software/enumerator/ and http://okmij.org/ftp/Haskell/Iteratee/IterateeIO-talk-notes.pdf
6 people like this
Posted: 10 months ago by Ryan Riley
ByteString
An initial attempt at creating a ByteString type based on the Haskell version.
1 people like this
Posted: 10 months ago by Ryan RileyJoinList
A JoinList is a variation on the list type that offers a constant time append operation.
5 people like this
Posted: 9 months ago by Ryan RileyIterateeCPS
An iteratee that uses continuation-passing style as an optimization. There is no more discriminated union, and the signature should feel familiar to those using Async.StartWithContinuations.
5 people like this
Posted: 9 months ago by Ryan RileyContinuation Monad with Call/CC
This is an implementation of the Continuation monad using a type, taking an exception handler, and allowing for Call/CC. This specific implementation is mostly Matt Podwysocki's. I have a similar implementation using a purely functional, exception-handler-less version in FSharp.Monad. Until now, I haven't been able to resolve the callCC operator.
3 people like this
Posted: 9 months ago by Ryan RileyCall/CC for Async
An implementation of call-with-current-continuation for Async.
2 people like this
Posted: 8 months ago by Ryan RileyF#-friendly SocketAsyncEventArgs
The name is a bit trying, but the overall callback approach greatly simplifies the mechanism for calling and handling the System.Net.Sockets.Socket Async methods.
0 people like this
Posted: 6 months ago by Ryan RileyCircular Buffer
A Circular, or Ring, Buffer that flattens incoming arrays and allows consumers to take arbitrary-sized chunks. Improvements and suggestions welcome. Fork my gist at https://gist.github.com/1648579.
4 people like this
Posted: 3 months ago by Ryan RileyFun with Ping and Pong
Yet another ping pong sample with agents.
3 people like this
Posted: 22 days ago by Ryan RileyPing and Pong go Chunking Along
Parameterizing pong allows us to do even more fun things. Here we use a few message types to allow stateful consumption of data sent by ping to its pongs.
1 people like this
Posted: 21 days ago by Ryan RileyAsync Primitives
A set of Async primitives as described by Dave Thomas [1] (and derived from Stephen Toub [2]). [1] http://moiraesoftware.com/blog/2012/04/22/back-to-the-primitive-ii/ [2] http://blogs.msdn.com/b/pfxteam/archive/2012/02/11/10266923.aspx
1 people like this
Posted: 9 days ago by Ryan Riley