Skip to content

Instantly share code, notes, and snippets.

View essic's full-sized avatar

Aly-Bocar Cissé essic

  • Paris
View GitHub Profile
@essic
essic / main.hs
Created February 16, 2019 21:37
Kata (Haskell) - FooBarQix created by essic - https://repl.it/@essic/Kata-Haskell-FooBarQix
-- http://codingdojo.org/kata/FooBarQix/
{-# LANGUAGE OverloadedStrings #-}
import Data.Text as T
import qualified Data.Map.Strict as M
import qualified Data.Char as C
import qualified Data.List as L
import Data.Maybe (catMaybes, fromMaybe)
newtype Digit = D Text
@essic
essic / install.sh
Last active December 11, 2018 13:47
sudo apt-get update
sudo apt-get install curl -y
sudo apt-get install emacs25-nox -y
sudo apt-get install git -y
curl -sSL https://get.haskellstack.org/ | sh
@essic
essic / main.fs
Created June 19, 2018 00:26
SimpleFSharpDemo-04 created by essic - https://repl.it/@essic/SimpleFSharpDemo-04
module Implem04
open System
type Age = int
type FirstName = string
type LastName = string
type Person =
{ FirstName : FirstName
@essic
essic / main.fs
Created June 18, 2018 23:38
SimpleFSharpDemo-03 created by essic - https://repl.it/@essic/SimpleFSharpDemo-03
module Implem03
open System
type Age = int
type FirstName = string
type LastName = string
type Person =
{ FirstName : FirstName
@essic
essic / main.fs
Created June 18, 2018 23:23
SimpleFSharpDemo-02 created by essic - https://repl.it/@essic/SimpleFSharpDemo-02
module Implem02
open System
type Age = int
type FirstName = string
type LastName = string
type Person =
{ FirstName : FirstName
@essic
essic / main.fs
Created June 18, 2018 23:16
SimpleFSharpDemo-01 created by essic - https://repl.it/@essic/SimpleFSharpDemo-01
module Implem01
open System
//These are type aliases
type Age = int
type FirstName = string
type LastName = string
//This is a product type : Record
// In here we want to show informations about collaborators in some consulting organization.
module BasicDemo
//Basic import, useful to access "String" by example"
open System
//This is type alias
type Age = int
type FirstName = string
type LastName = string
using System;
using System.Linq;
using System.Collections.Generic;
public enum State {
Invalid = 0,
Ok = 1,
Ignored = 2,
NOk = 3,
NN = 3
@essic
essic / Haskell playground.hs
Created January 4, 2018 16:55
Haskell playground created by essic - https://repl.it/@essic/Haskell-playground
{-# LANGUAGE NoImplicitPrelude #-}
import Data.List (find)
import Data.Monoid ((<>))
import Data.Either (Either(..))
import Data.Int (Int)
import System.IO (IO,putStrLn)
import Data.String (String)
import Text.Show (show,Show)
import Data.Maybe (maybe)
import Data.Function ( (.), ($))
@essic
essic / Haskell playground.hs
Last active October 11, 2017 14:44
Haskell playground created by essic - https://repl.it/J0S6/16
race :: Int -> Int -> Int -> Maybe (Int, Int, Int)
race v1 v2 g
| v1 >= v2 = Nothing
| otherwise =
let ts = convertToSecondsThenFloorIt $ calculateTimeToCatchUpInHours v1 v2 g
h = getHours ts
m = getMinutes ts
s = getSeconds ts
in Just (h, m, s)
where