Skip to content

Instantly share code, notes, and snippets.

View leftaroundabout's full-sized avatar

Justus Sagemüller leftaroundabout

  • KTH Royal Institute of Technology
  • Stockholm
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
module Main where
import Graphics.Text.PCF
import Data.Foldable (fold)
import System.Environment (getArgs)
main :: IO ()
main = do
args <- getArgs
let style = case ( any (`elem`["-b","--bold"]) args
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Cofree (Const c) ~~ Writer c

Given

data Const c a = Const c

we have

data Cofree (Const c) a

= a :< Const c

Free (Const c) ~~ Either c

Given

data Const c a = Const c

we have

data Free (Const c) a

= Pure a

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leftaroundabout
leftaroundabout / PairApplyTest.c
Last active September 11, 2017 12:33
Comparison of two ways to fold over unordered unique pairs in a collection of elements
#define N 50001
#include "stdio.h"
int main() {
int v[N];
for (int i=0; i<N; ++i) {
v[i] = i;
}
int b=0;
-- |
-- Module : Data.Vector.Unboxed.Nested
-- Copyright : (c) Justus Sagemüller 2017
-- License : BSD-style
--
-- Maintainer : (@) jsagemue $ uni-koeln.de
-- Stability : experimental
-- Portability : portable
--