Skip to content

Instantly share code, notes, and snippets.

View isovector's full-sized avatar

Sandy Maguire isovector

View GitHub Profile
@isovector
isovector / error.hs
Created May 27, 2019 14:14
inspection-testing
LHS:
recursive
:: forall (e :: (* -> *) -> * -> *) s (r :: [(* -> *)
-> * -> *]) a.
(forall x (m :: * -> *). e m x -> StateT s (Sem r) x)
-> s -> Sem (e : r) a -> Sem r (s, a)
recursive = recursive
recursive_s9LZ
:: forall (e :: (* -> *) -> * -> *) s (r :: [(* -> *)
==================== Tidy Core ====================
2019-03-26 16:42:16.733069541 UTC
Result size of Tidy Core
= {terms: 572, types: 1,423, coercions: 358, joins: 0/6}
-- RHS size: {terms: 5, types: 17, coercions: 9, joins: 0/0}
$WUnion :: forall (e :: * -> *) a. e a -> Union '[e] a
$WUnion
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
$ stack exec --resolver=lts-13.0 ./hadrian/ghci.sh
GHCi, version 8.6.3: http://www.haskell.org/ghc/ :? for help
Warning: the following files would be used as linker inputs, but linking is not being done: 2.2
Warning: ignoring unrecognised input `2.2'
target ‘version’ is not a module name or a source file
Prelude> :load /home/sandy/prj/ghc/compiler/specialise/Specialise.hs
/home/sandy/prj/ghc/compiler/specialise/Specialise.hs:11:2: error:
fatal error: HsVersions.h: No such file or directory
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 627, types: 1,687, coercions: 398, joins: 1/6}
-- RHS size: {terms: 5, types: 21, coercions: 11, joins: 0/0}
$WUnion
$WUnion = \ @ e_XHpZ @ a_aHpZ dt_aHuO -> Union @~ <Co:11> dt_aHuO
@isovector
isovector / generics.hs
Last active March 14, 2019 19:29
Generic Existentials
data Skolem (s :: Nat) = forall a. Skolem a
unsafeUnskolem :: Skolem n -> a
unsafeUnskolem (Skolem a) = unsafeCoerce a
data Error e (m :: * -> *) a
= Throw e
| forall x. Catch (m x) (e -> m x) (x -> a)
*** Core Lint errors : in result of Desugar (before optimization) ***
<no location info>: warning:
In the expression: $fNum[] $dNum_a2USl
$dNum_a2USl :: Num a_0
[LclId] is out of scope
<no location info>: warning:
In the expression: $fNum[] $dNum_a2USl
Non-function type in function position
Fun type: forall a. Num a => Num [a]
Arg type: Num a_-1
*** Core Lint errors : in result of Desugar (before optimization) ***
<no location info>: warning:
[RHS of $dSemigroup_auC6{v}[lid] :: Semigroup{tc 2K}
Int{(w) tc 3u}]
[RHS of $csconcat{v auCm}[lid] :: NonEmpty{tc rA4} Int{(w) tc 3u}
-> Int{(w) tc 3u}]
[RHS of $dSemigroup_auCq{v}[lid] :: Semigroup{tc 2K}
Int{(w) tc 3u}]
[RHS of $dSemigroup_auCq{v}[lid] :: Semigroup{tc 2K}
Int{(w) tc 3u}]
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Lib where
#! /usr/bin/env bash
set -ex
rm -r /tmp/ebook || echo ""
mkdir /tmp/ebook
cp *.shiatsu /tmp/ebook
cp *.tex /tmp/ebook
cp *.html /tmp/ebook
cp -r .latex-live-snippets/ /tmp/ebook
cd /tmp/ebook