GHC 8.2.1で実装された言語拡張。anonymousでunboxedな直和型を実現する機能。
{-# LANGUAGE MagicHash #-} -- Maybe#のハッシュ記号に必要
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE PolyKinds #-} -- a :: TYPE rに必要
{-# LANGUAGE Rank2Types, ViewPatterns #-} | |
{-| | |
Asymptotic Improvement of Computations over Free Monadsより | |
通常のmonadicなコードでO(n^2)かかる計算を手でCPS変換あるいはContTモナド | |
を使ってCPS変換させてO(n)に改善する。 | |
-} | |
module Main where |
{-| | |
A Neighborhood of Infinity: The Mother of all Monadsより | |
継続モナドはすべてのモナドの母であることを示すサンプルコード | |
-} | |
module MotherCont where | |
import Control.Monad.Cont (runCont, cont) | |
ex1 = do |
// cc -o repro repro.c libopenblas.a | |
// or | |
// cc -o repro repro.c -L. -lopenblas | |
// then | |
// ./repro | |
#include <stdio.h> | |
#include "cblas.h" | |
int main(void) | |
{ |
fn main() { | |
let v: f64 = 1.1276353206339418; | |
assert_eq!(v.ln(), 0.12012280349368988); | |
} | |
module Foo (Foo(..)) where | |
class Foo a where | |
bar :: a -> () | |
bar _ = () |
<!DOCTYPE HTML><html><head><title>Criterion comparison</title><meta charset="UTF-8"><style> | |
.stddev | |
{ | |
font-size : x-small; | |
} | |
td | |
{ | |
padding-left : 1em; | |
padding-right : 1em; |
{-# LANGUAGE BangPatterns #-} | |
module Main where | |
import Data.Char | |
import Data.List | |
import Data.List.Split | |
import Criterion.Main | |
commafyFoldr :: String -> String | |
commafyFoldr = snd . foldr f (0 :: Int, "") | |
where |
#!/bin/bash | |
EXECUTABLES="ghc ghc-pkg ghci haddock runghc" | |
VERSION=$1 | |
if [ -z "$1" ]; then | |
echo "ERROR: GHC version number needs to be specified. Exiting." 1>&2 | |
exit 1 | |
fi | |
pushd /opt/ghc/bin > /dev/null |
Make application settings (e.g. default window size, checkboxes in the Traces tab etc) persistent
Switch to GTK+3 for better HiDPI support
Display duration in the status bar when dragging on the timeline
Checkbox to display/hide event markers
Drag support in the raw events
Search text in the raw events
Filter by thread ID (like "follow tcp stream" in wireshark)
Tooltip that displays the thread name or ID of the area under the cursor
Build index (with succinct/compact data structures) to save memory usage