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
| // This is example from | |
| // http://vitiy.info/c11-functional-decomposition-easy-way-to-do-aop/ | |
| // by Victor Laskin | |
| #include <iostream> | |
| #include <functional> | |
| #include <map> | |
| #include <vector> | |
| #include <memory> | |
| #include <chrono> |
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 reornament | |
| -- Idris translation of Agda code: | |
| -- https://gist.github.com/gallais/e507832abc6c91ac7cb9 | |
| -- Which follows Conor McBride's Ornaments paper: | |
| -- https://personal.cis.strath.ac.uk/conor.mcbride/pub/OAAO/Ornament.pdf | |
| ListAlg : Type -> Type -> Type | |
| ListAlg A B = (B, A -> B -> B) |
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 Printf | |
| %default total | |
| data Format = FInt Format -- %d | |
| | FString Format -- %s | |
| | FOther Char Format -- [a-zA-Z0-9] | |
| | FEnd -- | |
| format : List Char -> Format |
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
| #load "HyperF.fsx" | |
| open HyperF | |
| open Route | |
| let service = | |
| [ | |
| Get("/resource/:id") => fun (req,ri) -> "hello world!" |> HttpRes.plainText |
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
| #!/bin/sh | |
| #if run_with_bin_sh | |
| # Doing this because arguments can't be used with /usr/bin/env on linux, just mac | |
| exec fsharpi --define:mono_posix --exec $0 $* | |
| #endif | |
| (* | |
| * Crossplatform FSharp Makefile Bootstrapper | |
| * Apache licensed - Copyright 2014 Jay Tuley <[email protected]> | |
| * v 2.0 https://gist.github.com/jbtule/9243729 |
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
| function cabal_sandbox_info() { | |
| cabal_files=(*.cabal(N)) | |
| if [ $#cabal_files -gt 0 ]; then | |
| if [ -f cabal.sandbox.config ]; then | |
| echo "%{$fg[green]%}sandboxed%{$reset_color%}" | |
| else | |
| echo "%{$fg[red]%}not sandboxed%{$reset_color%}" | |
| fi | |
| fi | |
| } |
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
| ( | |
| (|x:|xx:|xxx:|||||{x(|xxx:|||{xxx()})} | |
| ) (|xx:|xxx:||||{xx(||{()})})); |
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
| ([](int x) { printf("HELLO A %d\n", x + 4); })(1); | |
| ([](int x) { printf("HELLO B"); })(1); | |
| ([]() { printf("HELLO C %d\n"); })(); | |
| ([](float a) { printf("HELLO D %d\n"); })(2.0); | |
| /* output : | |
| HELLO A 5 | |
| HELLO A 5 | |
| HELLO C 5 | |
| HELLO D 5 |
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
| use std::task; | |
| use std::rt::io::timer::sleep; | |
| ///<Summary> | |
| ///Simple butterfly | |
| ///</Summary> | |
| pub fn butterfly<U>(f: &fn() -> U) -> U { | |
| let (port, chan) = stream(); | |
| do task::spawn_sched(task::SingleThreaded) { | |
| print(" "); |
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
| /* | |
| * Copyright (c) 2013, Daniel Park | |
| * All rights reserved. | |
| * | |
| * Permission to modify and redistribute this software is granted to | |
| * anyone provided the above copyright notice, this condition and the | |
| * following disclaimer are retained. | |
| * | |
| * This software is provided "as is", without and express or implied | |
| * warranty. In no event shall the author be liable for damages arising |