Skip to content

Instantly share code, notes, and snippets.

🤡
':<>:

Csongor Kiss kcsongor

🤡
':<>:
Block or report user

Report or block kcsongor

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 MarkerClass.hs
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
module MarkerClass where
import GHC.TypeLits -- for error messages
@kcsongor
kcsongor / CPP.hs
Last active Aug 18, 2019
Define /* with CPP
View CPP.hs
{-# LANGUAGE CPP #-}
-- This defines the (/*) function in the presence of CPP
(//* */*) :: Int -> Int -> Int
(//* */*) = undefined
@kcsongor
kcsongor / hl.vim
Created Jan 24, 2019
highlight words
View hl.vim
let s:hlcounter = 1
function! Highlight(word)
let id = 110 + s:hlcounter
exe 'hi Group' . id . ' ctermbg=' . (20 + id) . ' ctermfg=0'
silent! call matchdelete(id)
silent! call matchadd('Group' . id, '\<' . a:word . '\>', 100, id)
let s:hlcounter = s:hlcounter + 1
endfunction
View Inhabited.hs
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType, GADTs, TypeOperators #-}
module Lib where
import Data.Kind (Type)
data Cat (a :: ()) (b :: ()) where
MkCat :: Cat '() '()
class Category (k :: t -> t -> Type) where
identity :: k a a
View gmap.hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE KindSignatures #-}
View Fold.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module Fold where
data Nat = Z | S Nat
@kcsongor
kcsongor / iTunes.vim
Created Mar 10, 2018
Vim: Get currently playing song from iTunes
View iTunes.vim
function! s:current_track()
let queries = ['album of the current track',
\ 'artist of the current track',
\ 'name of the current track',
\ 'the player position']
let query = "osascript -s s -e 'tell application \"iTunes\" to return "
\ . join(queries, ' & "----" & ') . "'"
let song_info = split(split(system(query), "\n")[0][1:-1], "----")
return { 'album' : song_info[0],
View Reified.hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
View Elem.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes, TypeApplications, TypeInType, TypeOperators,
ScopedTypeVariables, TypeFamilies, UndecidableInstances,
GADTs, ConstraintKinds, AllowAmbiguousTypes #-}
module Elem where
import Data.Type.Equality
import Data.Kind
View Curry-tf.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
You can’t perform that action at this time.