Install essential utilities:
sudo apt install vim tmux tree
Install the public signing key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Install apt-transport-https
:
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE RankNTypes #-} | |
module GadtVsPolymorphicRecursion where | |
import Data.Kind (Type) | |
-- This example is based on the Tree type given on page 3 |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE MagicHash #-} | |
module Prime | |
( prime | |
) where | |
import GHC.Int | |
import GHC.Exts | |
prime :: Int -> Bool |
#!/bin/bash | |
[ "$#" -eq 1 ] || die "the ghc version must be provided as an argument, but $# arguments were provided" | |
VERSION=$1 | |
BINDIR=/usr/local/bin | |
rm -f $BINDIR/runghc $BINDIR/haddock $BINDIR/runhaskell $BINDIR/ghc-pkg $BINDIR/ghci $BINDIR/ghc | |
cd /usr/local/bin | |
ln -s runghc-$VERSION runghc | |
ln -s ghc-$VERSION ghc |
Install essential utilities:
sudo apt install vim tmux tree
Install the public signing key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Install apt-transport-https
:
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module BugCrush where |
module IdrisRecord | |
import Data.Vect | |
import Data.List | |
%default total | |
data Value : Bool -> Type -> Type where | |
Present : {t : Type} -> t -> Value True t | |
Absent : {t : Type} -> Value False t |
module DependentPokemon | |
data Poketype = Fire | Water | Grass | |
data Different : Poketype -> Poketype -> Type where | |
DifferentFireWater : Different Fire Water | |
DifferentFireGrass : Different Fire Grass | |
DifferentWaterFire : Different Water Fire | |
DifferentWaterGrass : Different Water Grass | |
DifferentGrassFire : Different Grass Fire |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Control.Applicative | |
import Data.Monoid | |
import Control.Monad.Trans.State.Lazy (State,runState,get,put) | |
-- Lazy in the monoidal accumulator. Monoidal accumulation | |
-- happens from left to right. | |
foldlMapA :: forall g b a m. (Foldable g, Monoid b, Applicative m) => (a -> m b) -> g a -> m b | |
foldlMapA f = foldr f' (pure mempty) |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import qualified Data.Matrix as M | |
import qualified Text.Blaze.Html5 as H | |
import Text.Blaze.Html (Html,toHtml) | |
import Text.Blaze.Renderer.Pretty (renderMarkup) | |
main :: IO () | |
main = putStrLn (renderMarkup (matrixToHtml myMatrix)) |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE MagicHash #-} | |
{-# OPTIONS_GHC -O2 #-} | |
import Control.Monad | |
import Data.Primitive | |
import Control.Monad.ST | |
import Criterion.Main |