Skip to content

Instantly share code, notes, and snippets.

AndreasPK

  • Vienna, Austria
Block or report user

Report or block AndreasPK

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
@AndreasPK
AndreasPK / Curious.hs
Created Feb 19, 2018
On GHC-8.2 this code is faster in GHCi then when compiled.
View Curious.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as T
import Data.Text (Text(..))
longestCommonSubstring :: [Text] -> Text
longestCommonSubstring entries = go [""] "" where
View runNofib.sh
#!/usr/bin/env bash
LOGNAME=$1
LOG_DIR=~/logs4
TREE_DIR=~/trees4
RUNS=7
if [ -z "$1" ]
then
@AndreasPK
AndreasPK / ReportSoC_2018.md
Last active Aug 14, 2018
Final report - SoC 2018 - Andreas Klebinger
View ReportSoC_2018.md

Improvements to GHCs Code Generator

This is a writeup of the work done by me (Andreas Klebinger) during my SoC 2018 Project.

Improved code layout for GHC

The vast majority of my time was spent working on this part of the Project. While the patch was not yet merged there is not much missing.

View gist:24864a0c96df9bda643b345865cd5e81
Consider a simple definition using guards:
foo x
| x == C1 = { -# LIKELY 10 #- } e1
| otherwise = { -# LIKELY 0 #- } e2
with C1 being defined by T using uniform default weights:
data T = {-# LIKELY 1000 #-} C1
View gist:91035fbf77694bf1bd509f60ff679479
| x == A = e1
| x == B = e2
| predFunc(x) = e3
case (case x of { C1 -> (Weight: 1000) A;
C2 -> (Weight: 1000) B;
C3 -> (Weight: 1000) e3; } ) of
{
View Day21.reddit.hs
#!/usr/bin/env stack
{-
stack
script
--resolver lts-12.20
--package text,trifecta,containers,parsers,mtl,vector,deepseq
-}
{-# LANGUAGE RecordWildCards, BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}
You can’t perform that action at this time.