Skip to content

Instantly share code, notes, and snippets.

Damian Płaza dpraimeyuu

  • Poland
Block or report user

Report or block dpraimeyuu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ExcelRandomCursor.fsx
// This is am example of an immediate write / random access cursor for Excel with basic formatting options.
// Implementation is based on a concrete, non generic writer monad with no payload ("do!"" only) (only state).
// Instead of directl writing to excel, an alternatives would be a random acces to a
// copy-on-write list (or even a mutable array) and then bulk-write the result to excel in one shot.
// When only forward access would have been required, a simple seq expression with yields would have been enough.
// Anyway, it is a demonstration on how to "hide" pseudo-mutable state that is passed through a computation.
//
// I personally use it for generating reports based on various data sources.
@dpraimeyuu
dpraimeyuu / handy.fs
Created Apr 6, 2018 — forked from kjnilsson/handy.fs
my current favourite handy fsharp helpers
View handy.fs
//invaluable for all those Choice<'a, exn> flows
let exnf f = Printf.ksprintf (fun s -> exn s) f
//combine paths
let (</>) x y = System.IO.Path.Combine(x, y)
//allows you to pattern match on values in the current scope rather than just literals
let (|Eq|_|) expected value =
if expected = value then Some ()
else None
@dpraimeyuu
dpraimeyuu / file-operations.purs
Last active Nov 15, 2016
Having fun with 'Learn PureScript" - naive 'whereIs' function implementation
View file-operations.purs
module Data.FileOperations where
import Prelude
import Data.Maybe (Maybe(Nothing), Maybe(Just))
import Data.String (contains, Pattern(Pattern))
import Data.Array (foldl)
import Data.Path
whereIs :: Path -> String -> Maybe Path
whereIs path filePattern =
You can’t perform that action at this time.