(2) console (5) error (1) File (2) File Writing (1) files (2) format (3) formatting (2) I/O (2) Input and Output (1) Interface (2) io (4) iteratee (2) path (1) print (1) printf (4) reader (1) scanf (1) source (1) sprintf (2) Stream (3) writeline (1) writer (1)

Snippets in category Input and Output

  • Hello world (F#)

    Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

    131 people like this
    Posted: 1 years ago by Tomas Petricek

  • Hello world (.NET)

    Classical "Hello world" example that prints a message to the console output. This version uses .NET Console.WriteLine method to do the printing.

    23 people like this
    Posted: 1 years ago by Tomas Petricek

  • Friendly date formatting

    Generates a friendly string describing a date relatively to the current date and time. The function returns strings like "2 secs ago", "yesterday" or "3 years ago".

    26 people like this
    Posted: 1 years ago by Tomas Petricek

  • 'use' Bindings

    Show's how to use F# 'use' key word to dispose a resource when it passes out of scope.

    24 people like this
    Posted: 1 years ago by Robert Pickering

  • Nice formatting of type names

    Add extension to System.Type that returns the name of type including generic arguments in a nice readable format. It returns only short names of generic type and type arguments.

    13 people like this
    Posted: 1 years ago by Tomas Petricek

  • warning check

    0 people like this
    Posted: 1 years ago by

  • kprintf for logging

    Handy *printf feature: use kprintf to prepend datetime to formatted message

    45 people like this
    Posted: 1 years ago by Vladimir Matveev

  • Conditional printf

    Disable printf based on some condition

    26 people like this
    Posted: 1 years ago by Laurent

  • test

    0 people like this
    Posted: 1 years ago by

  • megaton/cluster.fs

    1 people like this
    Posted: 1 years ago by

  • very simple password gen

    0 people like this
    Posted: 1 years ago by

  • asd

    0 people like this
    Posted: 1 years ago by

  • Working with paths

    Concatenating paths shouldn't be done just using string concatenation, because the directory separator may differ on various platforms. This snippet shows a simple custom operator for working with paths.

    9 people like this
    Posted: 1 years ago by Tomas Petricek

  • Asynchronous sequences

    An asynchronous sequence is similar to the seq<T> type, but the elements of the sequence are generated asynchronously without blocking the caller as in Async<T>. This snippet declares asynchronous sequence and uses it to compare two files in 1k blocks.

    36 people like this
    Posted: 1 years ago by Tomas Petricek

  • EnumerableStream

    0 people like this
    Posted: 1 years ago by

  • EnumerableStream

    A lazy enumerable/stream of bytes.

    8 people like this
    Posted: 1 years ago by Ryan Riley

  • Async hashing

    Async memory or file hashing

    8 people like this
    Posted: 1 years ago by Mauricio Scheffer

  • Creating charts in F#

    0 people like this
    Posted: 1 years ago by

  • Exiting cleanly

    Demonstrates how to run a function when the user presses Ctrl+C, closes the console window, or logs off.

    29 people like this
    Posted: 1 years ago by Tim Robinson

  • A Simple F# QuadTree

    1 people like this
    Posted: 1 years ago by

  • Euler 1 as a Computation Expression

    0 people like this
    Posted: 1 years ago by

  • Project Euler 1 - While Loop

    0 people like this
    Posted: 1 years ago by

  • Abstract Console.ReadLine as an infinite sequence

    Abstracts console input as an infinite sequence of strings

    7 people like this
    Posted: 1 years ago by fholm

  • test version

    0 people like this
    Posted: 1 years ago by

  • Dumping record type sequence to file

    Easy dump of record type sequence to file

    17 people like this
    Posted: 1 years ago by Chief Inspector Clouseau

  • annuity

    0 people like this
    Posted: 1 years ago by

  • Restartable File.ReadLines

    .Net 4.0 added File.ReadLines to view a file as a sequence, but the sequence can only be read once. A simple wrapper with seq{yield!} fixes that.

    32 people like this
    Posted: 1 years ago by Tony Lee

  • Pretty Print Source Code Errors

    A snippet that allows you to pretty print source code errors

    13 people like this
    Posted: 1 years ago by fholm

  • Testing inserting new snippet

    0 people like this
    Posted: 1 years ago by

  • Hello

    0 people like this
    Posted: 1 years ago by

  • LiteMedia_Example1_BasicSyntax

    0 people like this
    Posted: 1 years ago by

  • Unit List

    0 people like this
    Posted: 1 years ago by

  • CSV reader

    I've modified the CSV sample from Expert F# to my needs. I don't wann be forced to use the csv schema as defined by column rows. Therefore I've done two major modifications. 1. remove the permutation 2. added a new column name option to the ColumnAttribute 3. added a name to csv index mapping So basically you now have 3 options. 1. Don't annotate your record at all and use it as POCO. The order of the record fields is mapped directly to the order in the csv. UPDATE: I don't recommend this any more. As of the writing of this snippet I wasn't aware of the fact, that field order isn't guaranted by the reflection mechanism. 2. Use the index option of the ColumnAttribute. Same as before. 3. Use the name option. This is what I've looked for. I've to deal with tons of csv that has more columns I'm interested in. Have a look at the sample usage below. I've moved the type conversion out of the CsvReader class in order to be easyly expandable with custom type conversation (i.e. for combined column values - denormalized data)

    4 people like this
    Posted: 1 years ago by Rainer Schuster

  • CSV writer

    A simple CSV writer implementation as two type extensions for the Seq module. Use it with Records, Classes and Tuples. Have a look at the modified CSV reader sample from Don Symes Expert F# too http://fssnip.net/3T in order to advance this snippet using the ColumnAttribute

    3 people like this
    Posted: 1 years ago by Rainer Schuster

  • Evaluation Strategies

    0 people like this
    Posted: 1 years ago by

  • Prime Numbers

    0 people like this
    Posted: 1 years ago by

  • Binary Literals

    0 people like this
    Posted: 1 years ago by

  • Immunity

    0 people like this
    Posted: 1 years ago by

  • Awful Space adding code

    0 people like this
    Posted: 1 years ago by

  • Pipelining example

    0 people like this
    Posted: 1 years ago by

  • store yahoo quotes in kdb

    This snippet will download the constituents from ftse, stoxx50e,dji,hsi,gspc and store quotes beginning from 1981 into kdb. To get this to work you need to download kpnet from http://kpnet.codeplex.com/ and kdb.

    1 people like this
    Posted: 1 years ago by Kim Tang

  • sscanf - parsing with format strings

    A more complete version of sscanf, as proposed on stackoverflow by kvb: http://stackoverflow.com/questions/2415705/read-from-console-in-f

    7 people like this
    Posted: 1 years ago by Wolfgang Meyer

  • test

    0 people like this
    Posted: 12 months ago by

  • async

    0 people like this
    Posted: 11 months ago by

  • quest

    0 people like this
    Posted: 11 months ago by

  • quest

    0 people like this
    Posted: 11 months ago by

  • questflow prototype

    0 people like this
    Posted: 11 months ago by

  • quest

    0 people like this
    Posted: 11 months ago by

  • quest

    0 people like this
    Posted: 11 months ago by

  • quest

    0 people like this
    Posted: 11 months ago by

  • Async File Crawl

    Async File Crawl

    6 people like this
    Posted: 11 months ago by fholm

  • Async web request from Silverlight

    0 people like this
    Posted: 11 months ago by

  • Simple Exp

    0 people like this
    Posted: 11 months ago by

  • Simple Exp

    0 people like this
    Posted: 11 months ago by

  • String explode and implode functions

    0 people like this
    Posted: 11 months ago by

  • funscript

    0 people like this
    Posted: 11 months ago by

  • Parallel Seq windows eventlogs

    0 people like this
    Posted: 11 months ago by

  • Odd error running a benchmark on Mono

    0 people like this
    Posted: 11 months ago by

  • Tuple Performance

    0 people like this
    Posted: 11 months ago by

  • Tuple Performance

    0 people like this
    Posted: 11 months ago by

  • Project Euler #4

    0 people like this
    Posted: 11 months ago by

  • test1

    0 people like this
    Posted: 11 months ago by

  • ICFP2011

    0 people like this
    Posted: 11 months ago by

  • test

    0 people like this
    Posted: 10 months ago by

  • Interface workaround for circular dependency problem

    Interface workaround for circular dependency problem

    3 people like this
    Posted: 10 months ago by fholm

  • Agent Based Scheduler

    An agent based scheduler, can be sent a single schedule message (ScheduleOnce) and multiple schedule message (Schedule). The schedule messages comprise of a function to receive the message, the message, an initial TimeSpan before the message is scheduled, and another timespan for the schedule repeat. Check out my blog below for more details: http://bit.ly/mK4prb

    4 people like this
    Posted: 10 months ago by 7sharp9

  • Iteratee

    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

  • Tiny IO Monad

    Haskell-style IO in F#.

    6 people like this
    Posted: 10 months ago by igeta

  • solver

    0 people like this
    Posted: 10 months ago by

  • one to nine puzzle

    0 people like this
    Posted: 10 months ago by

  • Draw rectangle in TryFSharp.org

    1 people like this
    Posted: 10 months ago by

  • Split string input on a function

    1 people like this
    Posted: 10 months ago by

  • ByteString

    An initial attempt at creating a ByteString type based on the Haskell version.

    1 people like this
    Posted: 10 months ago by Ryan Riley

  • Complex 1 - Intro

    1 people like this
    Posted: 9 months ago by

  • Complex 2 - First Operator

    1 people like this
    Posted: 9 months ago by

  • Complex 1 - Intro

    0 people like this
    Posted: 9 months ago by

  • Complex 3 - Operators

    0 people like this
    Posted: 9 months ago by

  • Complex 4 - Conjugate

    0 people like this
    Posted: 9 months ago by

  • Complex 5 - Polar Form

    0 people like this
    Posted: 9 months ago by

  • Complex 6 - Roots

    0 people like this
    Posted: 9 months ago by

  • Complex 7 - Chapter 2 Problems

    0 people like this
    Posted: 9 months ago by

  • Complex 8 - Graphics Intro

    0 people like this
    Posted: 9 months ago by