This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/extending_ghc.html#compiler-plugins | |
-- https://downloads.haskell.org/~ghc/9.0.1/docs/html/libraries/ghc-9.0.1/GHC-Plugins.html | |
module DerivingViaPlugin where | |
import qualified Control.Monad as Monad | |
import qualified GHC.Data.Bag as G | |
import qualified GHC.Hs as G | |
import qualified GHC.Plugins as P | |
import qualified GHC.Types.Basic as G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env stack | |
-- stack --resolver ghc-9.0.1 script | |
-- https://github.com/tfausak/witch/issues/19 | |
{-# language AllowAmbiguousTypes #-} | |
{-# language ScopedTypeVariables #-} | |
{-# language TypeApplications #-} | |
{-# language TypeFamilies #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM haskell:8.10 | |
RUN apt-get update && apt-get install --yes libpq-dev | |
ARG USER=haskell | |
RUN useradd --create-home "$USER" | |
USER $USER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env stack | |
-- stack --resolver lts-17.0 script | |
{-# language OverloadedStrings #-} | |
import qualified Control.Exception as Exception | |
import qualified Control.Monad as Monad | |
import qualified Data.Function as Function | |
import qualified Data.IORef as IORef | |
import qualified Database.MongoDB as Mongo | |
import qualified Data.Text as Text | |
import qualified GHC.Clock as Clock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
benchmarked show | |
time 18.81 ns (18.78 ns .. 18.85 ns) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 18.80 ns (18.79 ns .. 18.82 ns) | |
std dev 41.27 ps (27.30 ps .. 70.30 ps) | |
benchmarked printf | |
time 338.0 ns (334.5 ns .. 341.2 ns) | |
0.999 R² (0.999 R² .. 1.000 R²) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The GHC team announced the first release candidate for the 9.0.1 release of | |
# GHC: https://discourse.haskell.org/t/glasgow-haskell-compiler-9-0-1-rc1-now-available/1706 | |
# | |
# This is an example `stack.yaml` file that you can use to try out the release | |
# candidate. Save this file in your current directory and run `stack setup`. | |
# After that you should be able to use Stack as normal, including | |
# `stack exec ghci` and `stack build`. | |
# | |
# If for whatever reason you don't want to use Stack, you can download the | |
# official release tarballs at: https://downloads.haskell.org/ghc/9.0.1-rc1/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.IntMap as IntMap | |
import qualified Data.List as List | |
import qualified Data.Maybe as Maybe | |
import qualified Data.Ord as Ord | |
import qualified Data.Text as Text | |
main = do | |
print limit | |
interact | |
$ show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language OverloadedStrings #-} | |
module Main ( main ) where | |
import qualified Control.Monad as Monad | |
import qualified Data.Aeson as Aeson | |
import qualified Data.Aeson.Encode.Pretty as Aeson | |
import qualified Data.Aeson.Types as Aeson | |
import qualified Data.Bifunctor as Bifunctor | |
import qualified Data.ByteString.Lazy as LazyByteString | |
import qualified Data.Csv as Csv | |
import qualified Data.HashMap.Strict as HashMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = a :: Eq b => () -- AllowAmbiguousTypes | |
a = proc b -> id -< b -- Arrows | |
a = let !b = () in b -- BangPatterns | |
a = 0b0 -- BinaryLiterals | |
a = id do 0 -- BlockArguments | |
foreign import capi "" a :: () | |
class A b where c :: Eq b => b -- ConstrainedClassMethods | |
type A = Eq -- ConstraintKinds | |
# -- CPP | |
import Data.Proxy; a = Proxy :: Proxy True -- DataKinds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
this is a little experiment to parse a module with ghc | |
and extract exports identifiers, top-level declarations, and (documentation) comments | |
the idea is to use this as a basis for a haddock-like tool | |
that doesn't require type checking a module in order to run | |
-} | |
module Main ( main ) where | |
import qualified Control.Monad | |
import qualified DynFlags |