Skip to content

Instantly share code, notes, and snippets.

:octocat:

Marcin Szamotulski coot

:octocat:
Block or report user

Report or block coot

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
@coot
coot / Control.Cateogory.Tracer.hs
Last active Aug 6, 2019
Tracer using `Arrow` categories
View Control.Cateogory.Tracer.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Prelude hiding (filter, (.))
import Control.Arrow
import Control.Category
data TracerC c a where
@coot
coot / Naturals.agda
Last active Jun 23, 2019
Natural numbers - simple formal proofs in Agda & Haskell
View Naturals.agda
module Naturals where
-- based on https://plfa.github.io/
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym; trans)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
data ℕ : Set where
zero :
@coot
coot / keybase.md
Created Dec 17, 2018
keybase.io proof
View keybase.md

Keybase proof

I hereby claim:

  • I am coot on github.
  • I am coot (https://keybase.io/coot) on keybase.
  • I have a public key ASA4C4mk10e3x-LowdhnXeF8_qd8-tK_UhiEfw47z8u6zwo

To claim this, I am signing this object:

@coot
coot / Main.purs
Created Nov 16, 2017
Type level cofree react router
View Main.purs
module Type.React.Router where
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Prelude (Unit)
import Type.Proxy (Proxy(..))
import Type.Trout (type (:/), Capture, Lit, Named, QueryParam, QueryParams, Sub)
type PBool = Proxy Boolean
@coot
coot / Main.purs
Last active Sep 23, 2017
Array builder
View Main.purs
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (logShow)
import Control.Monad.ST (ST, pureST)
import Data.Foreign (Foreign, toForeign)
import Data.StrMap as StrMap
import Data.StrMap.ST as STStrMap
@coot
coot / term.vim
Created Sep 17, 2017
Vim 8.1112 terminal helper
View term.vim
set tk=<C-L>
tmap <c-x> <c-l>:hide<cr>
tmap <c-w><c-x> <c-l>:bd!<cr>
" Find first terminal buffer
fun! TermBufNr()
redi => ls
filter #\v<(zsh|bash)># ls
redi END
@coot
coot / Main.purs
Last active Jul 21, 2017
React.RecSpec
View Main.purs
module React.RecSpec where
import Control.Monad.Eff (Eff, kind Effect)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Record as R
import Prelude (Unit, bind, pure, show, unit, ($))
import React (Disallowed, ReactElement, ReactProps, ReactRefs, ReactState, ReadOnly, ReadWrite)
import React.DOM as D
import Type.Data.Symbol (class IsSymbol, SProxy(..))
import Type.Row (class RowLacks)
@coot
coot / Main.purs
Last active Apr 22, 2018
PureScript: pick subrecords from a record.
View Main.purs
module Main where
import Prelude
import Data.Foldable (fold, elem)
import TryPureScript
import Type.Row (class ListToRow, class RowToList, Cons, Nil, kind RowList)
import Type.Proxy (Proxy(..))
import Type.Data.Symbol (class IsSymbol, reflectSymbol)
import Data.Array (cons)
import Data.Monoid (mempty)
@coot
coot / Main.purs
Last active Jun 29, 2017
Compose Streams
View Main.purs
module Main where
import Prelude
import TryPureScript
import Control.Comonad.Cofree (Cofree, head, mkCofree, tail, unfoldCofree)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.Unsafe (unsafePerformEff)
import Data.Array (fromFoldable)
@coot
coot / Main.purs
Last active Aug 18, 2017
Compose Free / Cofree DSL's
View Main.purs
module Main where
import Control.Comonad.Cofree (Cofree, explore, head, mkCofree, tail, unfoldCofree)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Free (Free, liftF)
import Data.Either (Either(..))
import Data.Foldable (fold)
import Data.Functor.Coproduct (Coproduct(..), left, right)
import Data.Functor.Product (Product(..), product)
You can’t perform that action at this time.