Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE LambdaCase, BlockArguments, EmptyCase #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeSynonymInstances, TypeOperators, FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
{-# LANGUAGE TypeFamilies, GADTs, MultiParamTypeClasses, FunctionalDependencies #-}
{-# LANGUAGE DataKinds, PolyKinds, AllowAmbiguousTypes, TypeApplications, ScopedTypeVariables #-}
import GHC.Generics
import Unsafe.Coerce (unsafeCoerce)
import Data.Type.Equality
{-# LANGUAGE RankNTypes, TypeInType, TypeApplications, OverloadedLabels,
ScopedTypeVariables, TypeOperators, GADTs, FlexibleInstances, FlexibleContexts,
TypeFamilies, UndecidableInstances #-}
import Data.Kind (Type)
import Data.Proxy (Proxy(..))
import GHC.Generics
import GHC.TypeLits (Symbol, KnownSymbol, symbolVal)
import Control.Lens
import Data.Generics.Product.Fields (field')
@klapaucius
klapaucius / bf.c
Last active December 11, 2015 08:28 — forked from rblaze/bf.c
win 7 x64 cpu: i7 3770 ghc: 7.4.2 x32 -O2 -fllvm llvm: 3.1 gcc: 4.5.2 -O3 (нет разницы с -O2) разница в 2.6 раза, из 90 секунд работы хаскель-версии 12% - чтение файла и построение графа в памяти.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const int infinity = 2147483647;
struct edge_t {
int v1;
int v2;
int cost;