Skip to content

Instantly share code, notes, and snippets.

Tom Janssens ToJans

Block or report user

Report or block ToJans

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 blopost.md

The story behind Virtual Sales Lab

The initial seed of the idea

The initial spark for Virtual Sales Lab was conceived during a late-night dinner with one of my business mentors.

Margareta's The exquisit but now defunct restaurant Margaretha's in Oudenaarde/Belgium was where it all happened

View dotliquidproblem.cs
class MyConverter : Newtonsoft.Json.Converters.CustomCreationConverter<IDictionary<string, object>>
{
public override IDictionary<string, object> Create(Type objectType)
{
return new Dictionary<string, object>();
}
public override bool CanConvert(Type objectType)
{
// in addition to handling IDictionary<string, object>
View techradar virtual sales lab.md

A quick brain dump of the current techradar for Virtual Sales Lab

Hold

A gazillion things TBH....

Assess

  • Haskell
  • PureScript
@ToJans
ToJans / Tests.Veranda.fs
Last active Oct 20, 2016
canopy and fsharp to test the happy path for Virtual Sales Lab
View Tests.Veranda.fs
module Tests
open canopy
open Utils
open System
let veranda (rootPath) = (rootPath + ": Veranda") &&& fun () ->
let clickNext expected fn =
click ".verandawizard.selected input[type=submit]"
@ToJans
ToJans / interfaces.cs
Last active Oct 11, 2016
Functor, applicative and monad interfaces
View interfaces.cs
// In C# we can't enforce generic classes in interfaces, so we can't use interfaces to define the contract.
// I can only give examples of the minimal code it needs to implement.
class FunctorImpl<T> {
FunctorImpl<T> Pure(T val);
FunctorImpl<S> Apply<S>(Func<T, S> fn);
// Requirement: Pure(val).Apply(x=>x) == Pure(val)
}
class ApplicativeImpl<T> where {
@ToJans
ToJans / intro.md
Last active Dec 13, 2015
monads, applicatives, functors
View intro.md

Definitions

W<a>

A wrapper of type W that contains zero or more elements of type a.

c functionname(a,b)

A function named functionname that takes a value of type a, a value of type b and returns a value of type c.

@ToJans
ToJans / DB.hs
Last active Oct 21, 2015
How do I get this into a ServerT ?
View DB.hs
{-# LANGUAGE OverloadedStrings #-}
module Lib.DB(query_,query,execute_,execute,lastInsertRowId
,find,DB.FromRow,DB.fromRow,DB.field,ResourceT,runResourceT)
where
import Control.Monad (liftM)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Reader (ReaderT (..), ask, runReader)
import Control.Monad.Trans.Class (lift)
@ToJans
ToJans / post.md
Created Oct 16, 2015
Function, Applicative, Monad in .Net - Failed post
View post.md

+++ Description = "" Tags = ["Development", "Haskell", "C#", "CSharp"] date = "2015-10-16T09:24:25+02:00" menu = "main" title = "Haskell concepts in C#"

+++

I've made numerous attempts to explain functors, applicatives, monads and the likes in .Net, and here is another one:

@ToJans
ToJans / Sudoku.hs
Last active Oct 12, 2015
Sudoku solver for Haskell
View Sudoku.hs
-- Sudoku solver by @ToJans
--
-- Parses a Sudoku from a string and solves it
-- Parsing happens by filtering out ['1'-'9'] and '.'
{-# LANGUAGE OverloadedStrings #-}
module Sudoko where
import Data.Maybe(isNothing,fromMaybe)
View quadtree.hs
-- A quadtree implementation with a max points per node
module Main where
import Control.Monad (replicateM)
import System.Random (randomRIO)
data Point = Point Int Int
deriving Show
type LeafPointCount = Int
You can’t perform that action at this time.