codesnippets:codingconventions
Differences
This shows you the differences between two versions of the page.
| codesnippets:codingconventions [2024/06/04 08:01] – [Module description] f2b216 | codesnippets:codingconventions [2025/10/08 00:48] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 244: | Line 244: | ||
| * description ('' | * description ('' | ||
| * in way that it becomes a complete sentence when started with module name | * in way that it becomes a complete sentence when started with module name | ||
| - | * like in the code below it translates to '' | + | * like in the code below it translates to '' |
| - | * copright | + | * copyright |
| * license | * license | ||
| * All rights reserved | * All rights reserved | ||
| Line 261: | Line 261: | ||
| * bullets | * bullets | ||
| * most important properties | * most important properties | ||
| - | | + | |
| - | * output of example | + | * may be with output of example |
| + | * ideally using doc test | ||
| + | * example: < | ||
| + | -- >>> | ||
| + | -- 120 | ||
| + | </ | ||
| * Example: <code Haskell> | * Example: <code Haskell> | ||
| {-| | {-| | ||
| - | Description : ...makes it easier to export functional tests that are not exported themselves. | + | Description : makes it easier to export functional tests that are not exported themselves. |
| Copyright | Copyright | ||
| License | License | ||
| Line 275: | Line 280: | ||
| * makes it easier to export functional tests that are not exported themselves. | * makes it easier to export functional tests that are not exported themselves. | ||
| - | * suggested prefix: | + | * suggested prefix: |
| * See also module HPowerLib.ImportTests, | * See also module HPowerLib.ImportTests, | ||
| Line 441: | Line 446: | ||
| * example: <code Haskell> | * example: <code Haskell> | ||
| - | class Show d => Format d where | + | -- HUnit |
| - | {- | | + | -- | ...capability to compare the expected value with the actual one, |
| - | * formated in a human readable pretty way, when printed to a text file or stream like _stdout_. | + | -- | and to display the difference if there is one. |
| + | {-| | ||
| + | -} | ||
| + | class ( Show cmp ) => HUnit cmp where | ||
| + | -- equals | ||
| + | {- | ...compares the expected value with the actual one. | ||
| + | * result ' | ||
| -} | -} | ||
| - | | + | |
| - | -- | data to be formated in a pretty way | + | |
| - | :: d | + | |
| - | -- | formatted string representing the data | + | -> Bool -- ^ ' |
| - | -> String | + | |
| </ | </ | ||
codesnippets/codingconventions.1717480910.txt.gz · Last modified: (external edit)
