Skip to content

Instantly share code, notes, and snippets.


Swoorup Joshi Swoorup

View GitHub Profile
View compare.fs
type CompareResult<'a, 'b> =
| FoundPair of 'a * 'b
| UnmatchedLHS of 'a
| UnmatchedRHS of 'b
module ListCompare =
let compare xsKeySelector ysKeySelector xs ys =
let xs =
Swoorup / STRTree.fs
Created Oct 20, 2020
Immutable tree backed by NetTopologySuite.Spatial.Index.STRTree
View STRTree.fs
type private InternalElement<'Key, 'Value when 'Key: comparison> =
{ key: 'Key
data: 'Value
polygon: Polygon }
type STRtree<'Key, 'Value when 'Key: comparison> =
private { map: Map<'Key, InternalElement<'Key, 'Value>>
strTree: NetTopologySuite.Index.Strtree.STRtree<InternalElement<'Key, 'Value>> }
Swoorup /
Last active Jan 20, 2020
Bucketlist of libraries/resources I might use for projects.
Swoorup / reverseNodes.hs
Created Jan 7, 2020
Reverse Nodes in k-Group
View reverseNodes.hs
{-# LANGUAGE NumDecimals #-}
swapNodes :: Int -> [a] -> [a]
swapNodes _ [] = []
swapNodes k z = swapNodes' z []
swapNodes' [] acc = acc
swapNodes' x acc =
let (a,b) = splitAt k x
firstHalf = if (length a < k) then
View Types.hs
module Snl.Api.V1.Types where
import Data.Aeson
import Data.Proxy
import Data.Swagger
import Data.Time
import Data.UUID as UUID
import GHC.Generics
import Servant.API
import Snl.Core.Types
View Prelude.fs
module Quantex.Common.Prelude
type Range<'T> = { From: 'T; To: 'T }
module Range =
let create (r: 'T * 'T) =
let (a,b) = r
if (a >= b) then Error("From cannot be greater than To") else Ok({ From = a; To = b})
type Range<'T> with
View App.fs
module App.View
open Elmish
open Fable.React
open Fable.React.Props
open State
open Types
open Fulma
open Fable.FontAwesome
open Fable.FontAwesome.Free
View gist:164e9f5161d7b742c1c16b0f4ff7dc60
Executing task: cargo build <
Compiling shell v0.1.0 (file:///home/swoorup/github/mysh-rs)
error[E0597]: `input` does not live long enough
--> src/
30 | lexer.tokenize(&input);
| ^^^^^ borrowed value does not live long enough
38 | }
View app.d
import std.array;
import std.stdio;
import std.exception;
import std.string;
import std.conv : to;
import std.algorithm.searching;
import std.algorithm.iteration;
import erupted;
import derelict.sdl2.sdl;
View *compilation*.txt
-*- mode: compilation; default-directory: "~/Dropbox/vulkan_experiments/vkapp/" -*-
Compilation started at Sat Dec 31 15:28:03
time dub
Performing "debug" build using dmd for x86_64.
derelict-util 2.0.6: target for configuration "library" is up to date.
derelict-sdl2 2.0.2: target for configuration "library" is up to date.
xcb-d 2.1.0+1.11.1: target for configuration "library" is up to date.
xlib-d 0.1.1: target for configuration "library" is up to date.
vulkantriangled ~master: building configuration "application"...