Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Haskell study starter kit

License

NotificationsYou must be signed in to change notification settings

vanfp/study

Repository files navigation

A simple project starter to aid learning

This is a starter project set up for testing and benchmarking. Happy hacking!

Build

Download dependencies, build your library and compile executable.

The dependency part may take a while ☕🚶‍♀️

> stack buildstudy-0.1.0: configure (lib + exe)# ...Registering study-0.1.0...

There isno need to runstack install, unless you want your app copied to~/.local/binso that it can be called from anywhere as a regular binary.

To override the configured GHC options, (ex. GHC optimizations), use--ghc-opts:

> stack build --ghc-options=-O2# ...Registering libraryfor study-0.1.0..

Run

> stackexec studyHello World

REPL

Drop into aghci session with your project preloaded.

> stack replstudy-0.1.0: configure (lib + exe)# ...Ok, modules loaded: Main, Study.*Main Study> hello"Hello World"*Main Study> :q# Exit REPL

Tests

> stacktest# ...study-0.1.0:test (suite: study-doctest)# DoctestsExamples: 5  Tried: 5  Errors: 0  Failures: 0  Failures: 0study-0.1.0: Test suite study-doctest passedstudy-0.1.0:test (suite: study-test)# Unit testsAll 0 tests passed (0.00s)study-0.1.0: Test suite study-test passedCompleted 2 action(s).

Configured for both unit test and doctests.Please note that the doctest output isnot colourized.

Docs

To open the HTML docs only for your library:

> stack haddock study --open

To open HTML docs foreverything in your project, including dependencies:

> stack haddock --open

Benchmarks

This project is configured for simple benchmarking.

> stack bench# ...time                 26.97 ns   (23.35 ns .. 31.92 ns)                     0.871 R²   (0.834 R² .. 0.924 R²)mean                 30.12 ns   (27.12 ns .. 34.06 ns)std dev              10.84 ns   (8.861 ns .. 13.56 ns)variance introduced by outliers: 100% (severely inflated)Benchmark study-benchmarks: FINISHCompleted 2 action(s).

Critereon is included as a dependency.If you would like to do some more traditional microbenching, start in/benchmark/Main.hs

You can go much deeper, but that's out of scope for what we'll be covering.

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp