User Tools

Site Tools


codesnippets:codingconventions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

codesnippets:codingconventions [2024/06/04 08:01] – [Module description] f2b216codesnippets:codingconventions [2025/10/08 00:48] (current) – external edit 127.0.0.1
Line 244: Line 244:
     * description (''Description'')     * 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 ''PrettyLines is to print to a line oriented output devices (e.g. stdout), in a pretty formatted way.'' +        * like in the code below it translates to ''HPowerLib.ExportTest makes it easier to export functional tests that are not exported themselves.'' 
-    * copright according to the example below+    * copyright according to the example below
     * license     * license
       * All rights reserved       * All rights reserved
Line 261: Line 261:
     * bullets     * bullets
       * most important properties       * most important properties
-      * example +    expandable example 
-      * output of example+      * may be with output of example 
 +      * ideally using doc test 
 +        * example: <code> 
 +-- >>> fact 5 
 +-- 120  
 +</code>
  
   * 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   : (c) Jörg K.-H. W. Brüggmann, 2021-2024 Copyright   : (c) Jörg K.-H. W. Brüggmann, 2021-2024
 License     : All rights reserved License     : All rights reserved
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: **Ext**+* suggested prefix: __/Exp/__
  
 * See also module HPowerLib.ImportTests, which supports import of the tests into the test framework Tasty. * See also module HPowerLib.ImportTests, which supports import of the tests into the test framework Tasty.
Line 441: Line 446:
  
   * example: <code Haskell>   * example: <code Haskell>
-class Show => Format d where +-- HUnit 
-    {- |  +-- | ...capability to compare the expected value with the actual one,  
-    * formated in a human readable pretty waywhen 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 'True' if both values are equalotherwise 'False'
     -}     -}
-    display  +    equals  
-        -- | data to be formated in a pretty way +        :: cmp      -- ^ actual value 
-        :: d +        -> cmp      -- ^ expected value 
-        -- | formatted string representing the data +        -> Bool     -- ^ 'True' when actual value and expected value is considered equal, otherwise 'False' 
-        -> String+
 </code> </code>
  
codesnippets/codingconventions.1717480910.txt.gz · Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki