old-style | new-style |
---|---|
install --only-dependencies |
part of new-build |
install path-to-local-dir |
add a ./cabal.project file, add your local dependency, then use new-build (cabal.project syntax is described in the announcement) |
install path-to-local-sdist |
does not exist yet |
install remote-package-uri |
does not exist yet |
install [--bindir=.. ] |
does not exist (yet) |
configure |
new-configure |
build |
(part of) new-build |
clean |
does not exist yet; you have to remove ./dist-newstyle/ and ./cabal.project.local by hand, and potentially ./dist/ as well, i may have observed that it got touched by new-build (not sure, really). This needs to be done for each package referenced from the cabal.project as well. |
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
sublime3 and ghcid setup for quick haskell coding feedback | |
tested on sublime 3 | |
(you can omit the SublimeOnSaveBuild steps, as the result is not | |
completely reliable anyways. i still find it useful, though.) | |
steps: | |
- install https://github.com/lspitzner/SublimeOnSaveBuild | |
(original from alexnj; in his/her version the build-window gets closed |
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
------------------ | |
run-time: criterion results | |
------------------ | |
benchmarking extensible-effects | |
time 1.337 s (1.308 s .. 1.387 s) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 1.314 s (1.304 s .. 1.322 s) | |
std dev 13.22 ms (0.0 s .. 14.55 ms) | |
variance introduced by outliers: 19% (moderately inflated) |
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 Distribution.Simple | |
import Distribution.PackageDescription | |
import Distribution.Simple.Program | |
import Distribution.Simple.Command | |
import Distribution.Simple.PreProcess | |
import Distribution.Simple.Setup | |
import Distribution.Simple.LocalBuildInfo | |
import Distribution.Simple.BuildPaths | |
import Distribution.Simple.BuildTarget | |
import System.Process |
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
#!/bin/bash | |
ls -1 stackage | xargs -I{} bash -c "find \"stackage/{}\" -type f -name \"*.hs\" -o -name \"*.lhs\"\ | |
| xargs grep -h \"^import\" \ | |
| grep \" as \" \ | |
| sed \"s/ \+as//\" \ | |
| sed \"s/^import \+\(qualified \+\)\?//\" \ | |
| sort \ | |
| uniq \ | |
" \ |
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
Running 2 test suites... | |
Test suite unit-tests: RUNNING... | |
Test suite unit-tests: PASS | |
Test suite logged to: dist/test/Cabal-1.25.0.0-unit-tests.log | |
Test suite package-tests: RUNNING... | |
package-tests: We couldn't understand the build configuration. Try editing Cabal.cabal to have 'build-type: Custom' and then rebuild | |
ing, or manually specifying CABAL_PACKAGETESTS_* environment variables (see README.md for more details). | |
Original error: Saved package config file body is corrupt. Try re-running the 'configure' command. | |
Test suite package-tests: FAIL |
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 most common thing is to install a library (so your project can use it) or | |
an executable (like when you install `hoogle` so you can search documentation | |
locally). Behind the scenes, this involves a number of steps: | |
1. determine package version plan (a consistent Set (Library,Version)) | |
2. download dependencies (i.e. their source) | |
3. install dependencies (i.e. do steps 1-6a for each dependency) | |
4. configure (think: what to build in which order, with which compiler flags etc.) | |
5. build | |
6a. register (libraries) in package repository |
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 GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module Main where | |
data HList :: [*] -> * where | |
HNil :: HList '[] |
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
#!/bin/bash | |
cabal list --simple-output | sed "s/ .*//" | uniq | xargs cabal info -v | grep "^ [^ ]" | sed "s/ //" | sed "s/\..*//" | sort | uniq -c | sort -bgr | |
# or full module names via | |
#cabal list --simple-output | sed "s/ .*//" | uniq | xargs cabal info -v | grep "^ [^ ]" | sed "s/ //" | sort | |
# (cannot post the latter; gists seem to have length limit on what you can paste :D) |
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
module Main where | |
import Control.Monad.Trans.Writer | |
import Data.Monoid ( Sum(..) ) | |
f :: Writer (Sum Int) () | |
f = undefined | |
g :: Writer (Sum Int) Int | |
g = do |