Verified Commit 19cc352f authored by Camil Staps's avatar Camil Staps 🚀

Add @type in Control.Applicative; fix @type in Data.Graphviz; fit some...

Add @type in Control.Applicative; fix @type in Data.Graphviz; fit some documentation on just one line
parent 10731f4e
Pipeline #15512 passed with stage
in 1 minute and 44 seconds
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Android32
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Android64
......@@ -61,10 +61,13 @@ optional :: (f a) -> f (Maybe a) | Alternative f
* when debug (putStrLn "Debugging")
*
* will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.
*
* @type Bool (f ()) -> f () | Applicative f
*/
when p s :== if p s (pure ())
/**
* The reverse of `when`
* @type Bool (f ()) -> f () | Applicative f
*/
unless p s :== if p (pure ()) s
......@@ -158,9 +158,7 @@ msum :== foldr mplus mzero
*/
toList t :== build (\c n -> foldr c n t)
/**
* @type ((a b -> b) b -> b) -> [a]
*/
//* @type ((a b -> b) b -> b) -> [a]
build g :== g (\x xs -> [x:xs]) []
......
......@@ -26,14 +26,10 @@ derive gEq Int, Char, Bool, Real, String, {}, {!}
derive gEq [], (), (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
/**
* @type a a -> Bool | gEq{|*|} a
*/
//* @type a a -> Bool | gEq{|*|} a
(===) infix 4
(===) x y :== gEq{|*|} x y
/**
* @type a a -> Bool | gEq{|*|} a
*/
//* @type a a -> Bool | gEq{|*|} a
(=!=) infix 4
(=!=) x y :== 'StdBool'.not (x === y)
......@@ -29,8 +29,6 @@ derive gLexOrd Char, Bool, Int, Real, String, [], {}, {!}
// standard types
derive gLexOrd (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
/**
* @type a a -> LexOrd | gLexOrd{|*|} a
*/
//* @type a a -> LexOrd | gLexOrd{|*|} a
(=?=) infix 4
(=?=) x y :== gLexOrd{|*|} x y
......@@ -371,19 +371,19 @@ derive gEq EdgeStyle // PK++
| HSV Real Real Real
| Color String // X11 1.2 color names; see rgb.txt
/** @type Color */
//* @type Color
CBlack :== Color "black"
/** @type Color */
//* @type Color
CWhite :== Color "white"
/** @type Color */
//* @type Color
CGray :== Color "gray"
/** @type Color */
//* @type Color
CRed :== Color "red"
/** @type Color */
//* @type Color
CGreen :== Color "green"
/** @type Color */
//* @type Color
CBlue :== Color "blue"
/** @type Color */
//* @type Color
CYellow :== Color "yellow"
instance toString Color
......
......@@ -35,24 +35,16 @@ null :: (Heap a) -> Bool
size :: (Heap a) -> Int
/**
* @type Heap a
*/
//* @type Heap a
empty :== Empty
/**
* @type a -> Heap a | Ord a
*/
//* @type a -> Heap a | Ord a
singleton x :== singletonWith (<=) x
/**
* @type (a a -> Bool) a -> Heap a
*/
//* @type (a a -> Bool) a -> Heap a
singletonWith f a :== Heap 1 f (Node 0 a Nil)
/**
* @type a (Heap a) -> (Heap a) | Ord a
*/
//* @type a (Heap a) -> (Heap a) | Ord a
insert :== insertWith (<=)
insertWith :: (a a -> Bool) a (Heap a) -> Heap a
......@@ -63,9 +55,7 @@ replicate :: a Int -> Heap a | Ord a
uncons :: (Heap a) -> Maybe (a, Heap a) | Ord a
/**
* @type (Heap a) -> Maybe (a, Heap a) | Ord a
*/
//* @type (Heap a) -> Maybe (a, Heap a) | Ord a
viewMin :== uncons
minimum :: (Heap a) -> a
......@@ -84,39 +74,25 @@ partition :: (a -> Bool) (Heap a) -> (Heap a, Heap a)
split :: a (Heap a) -> (Heap a, Heap a, Heap a)
/**
* @type Int (Heap a) -> Heap a
*/
//* @type Int (Heap a) -> Heap a
take :== withList o 'Data.List'.take
/**
* @type Int (Heap a) -> Heap a
*/
//* @type Int (Heap a) -> Heap a
drop :== withList o 'Data.List'.drop
/**
* @type Int (Heap a) -> (Heap a, Heap a)
*/
//* @type Int (Heap a) -> (Heap a, Heap a)
splitAt :== splitWithList o 'Data.List'.splitAt
/**
* @type (a -> Bool) (Heap a) -> (Heap a, Heap a)
*/
//* @type (a -> Bool) (Heap a) -> (Heap a, Heap a)
break :== splitWithList o 'Data.List'.break
/**
* @type (a -> Bool) (Heap a) -> (Heap a, Heap a)
*/
//* @type (a -> Bool) (Heap a) -> (Heap a, Heap a)
span :== splitWithList o 'Data.List'.span
/**
* @type (a -> Bool) (Heap a) -> Heap a
*/
//* @type (a -> Bool) (Heap a) -> Heap a
takeWhile :== withList o 'Data.List'.takeWhile
/**
* @type (a -> Bool) (Heap a) -> Heap a
*/
//* @type (a -> Bool) (Heap a) -> Heap a
dropWhile :== withList o 'Data.List'.dropWhile
nub :: (Heap a) -> Heap a
......
......@@ -212,14 +212,10 @@ delU :: !a !.(Map a b) -> u:(!v:(Maybe b), !Map a b) | == a & < a, [u <= v] // !
foldrWithKey :: !(k v u:a -> u:a) !u:a !(Map k v) -> u:a
foldlWithKey :: !(.a -> .(k -> .(v -> .a))) !.a !(Map k v) -> .a
/**
* @type (v a -> a) a (Map k v) -> a
*/
//* @type (v a -> a) a (Map k v) -> a
foldrNoKey f x m :== foldrWithKey (\_ v acc -> f v acc) x m
/**
* @type (a v -> a) a (Map k v) -> a
*/
//* @type (a v -> a) a (Map k v) -> a
foldlNoKey f x m :== foldlWithKey (\acc _ v -> f acc v) x m
/**
......
......@@ -2,10 +2,7 @@ definition module Math.Geometry
from StdEnv import class ==, class <, class +, class -, class sign
/**
* The constant pi.
* @type Real
*/
//* The constant pi.
pi :== 3.14159265359
:: Angle
......
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Linux32
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Linux64
......@@ -8,7 +8,7 @@ WNOHANG :== 0x00000001
WUNTRACED :== 0x00000002
MAXPATHLEN :== 1024
/** @type Int */
//* @type Int
DIRENT_D_NAME_OFFSET :== IF_INT_64_OR_32 19 11
S_IFMT :== 0170000
......
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Mac
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Windows32
......@@ -2,5 +2,5 @@ definition module System._Platform
import System.Platform
/** @type Platform */
//* @type Platform
CURRENT_PLATFORM :== Windows64
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment