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
namespace Fable.Import | |
open System | |
open System.Text.RegularExpressions | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.Import.JS | |
open Fable.Import.Browser | |
module rec Cherry = |
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
// Wrong function | |
[SuppressUnmanagedCodeSecurity] | |
[DllImport("glfw3", CallingConvention = CallingConvention.Cdecl, | |
EntryPoint = "glfwCreateWindowSurface")] | |
public static extern VkResult CreateWindowSurface(IntPtr instance, GLFWwindow window, IntPtr allocator, out long surface); | |
// Working function | |
[<SuppressUnmanagedCodeSecurity>] | |
[<DllImport("glfw3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "glfwCreateWindowSurface")>] | |
extern VkResult CreateWindowSurface(uint64 instance, nativeint window, nativeint allocator, unativeint& surface); |
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
/// <summary> | |
/// Precalculated values which are power of two. Exponent begins with zero! | |
/// </summary> | |
let PowerOfTwo = [| for i in 0..20 -> int (System.Math.Pow(2., float i)) |] | |
let toBoolean<'T> (v:'T) = System.Convert.ToBoolean(v) | |
// size = 12 | |
// This maps a edge index to a vertex pair | |
// 12 edges = 12 vertex pairs | |
let cubeEdgesSurfacenets = |
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
open System.IO | |
// Weitere Informationen zu F# unter "http://fsharp.org". | |
// Weitere Hilfe finden Sie im Projekt "F#-Tutorial". | |
module Generator = | |
open System.IO | |
open System | |
open System.Text.RegularExpressions | |
open System.CodeDom.Compiler |
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
type WhoDesignedThisAnyway = | |
{ Field: string } | |
/// allocates two functions, and a tuple each time this is called. | |
static member Lens = (fun x -> x.Field), (fun v x -> {x with Field = v }) | |
module WhoDesignedThisAnyway = | |
/// doesn't allocate |
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
open System | |
open System.Net | |
open System.Text.RegularExpressions | |
open System.Collections.Generic | |
// Learn more about F# at http://fsharp.org. See the 'F# Tutorial' "project" | |
// for more guidance on F# programming. | |
module Option = | |
let inline defaultMap value f option = match option with | None -> value | Some value -> f value |
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
open System | |
open System.IO | |
open System.Diagnostics | |
let downloadDependencies deps = | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
if not (File.Exists "paket.exe") then | |
async { | |
let url = "http://fsprojects.github.io/Paket/stable" |
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
enum HeadMovement{ | |
case Left, Right, Keep | |
} | |
type TuringMachineTransitionTable[BandElement, AlphabetElement, State] = | |
Map[(State, BandElement), (State, AlphabetElement, HeadMovement)] | |
class InfiniteBand[BandElement, Alphabet](band:Map[Int, BandElement | Alphabet], | |
neutralElement: (BandElement | Alphabet)) { | |
var pos = 0 |
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 Elmish.Snake | |
(** | |
Timer as a source of events with an SVG clock, by Zaid Ajaj. | |
You can find more info about Emish architecture and samples at https://elmish.github.io/ | |
*) | |
open System | |
open Fable.Import | |
open Fable.Helpers.React |
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
object Bukkit { | |
import scala.concurrent.ExecutionContext | |
implicit val cs: ContextShift[IO] = IO.contextShift(ExecutionContext.global) | |
def scheduler: BukkitScheduler = JBukkit.getScheduler | |
def runTask(task: IO[Unit])(implicit plugin: JavaPlugin): BukkitTask = scheduler.runTask(plugin, Utils.mkRunnable(task.unsafeRunSync())) |
OlderNewer