diff --git a/docs/Files.md b/docs/Files.md index 6b887e606..eb39fa488 100644 --- a/docs/Files.md +++ b/docs/Files.md @@ -4,25 +4,71 @@ Files Basic IO -------- -* readFile -* writeFile -* appendFile -* openFile -* withFile +#### readFile + +```haskell +readFile :: FilePath -> IO Text +``` + +#### writeFile + +```haskell +writeFile :: FilePath -> Text -> IO () +``` + +#### appendFile + +```haskell +appendFile :: FilePath -> Text -> IO () +``` Console ------- -* getLine -* getContents -* interact +#### getLine + +```haskell +getLine :: IO Text +``` + +#### getContents + +```haskell +getContents :: IO Text +``` + +#### interact + +```haskell +interact :: (Text -> Text) -> IO () +``` File Handles ------------ -* stdin -* stdout -* stderr -* Handle -* FilePath -* IOMode(..) +```haskell +data IOMode + = ReadMode + | WriteMode + | AppendMode + | ReadWriteMode +``` + +#### openFile + +```haskell +openFile :: FilePath -> IOMode -> IO Handle +``` + +#### withFile + +```haskell +withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r +``` + + +#### stdin +#### stdout +#### stderr +#### Handle +#### FilePath diff --git a/docs/Folds.md b/docs/Folds.md index 3a76da4ad..0e3147218 100644 --- a/docs/Folds.md +++ b/docs/Folds.md @@ -1,2 +1,162 @@ Folds ===== + +Basic Folds +----------- + +```haskell +foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m +``` + +```haskell +foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b +``` + +```haskell +foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b +``` + +```haskell +foldr' :: Foldable t => (a -> b -> b) -> b -> t a -> b +``` + +```haskell +foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b +``` + +```haskell +fold :: Foldable t => Monoid m => t m -> m +``` + +```haskell +toList :: Foldable t => t a -> [a] +``` + +```haskell +null :: Foldable t => t a -> Bool +``` + +```haskell +length :: Foldable t => t a -> Int +``` + +```haskell +elem :: (Eq a, Foldable t) => a -> t a -> Bool +``` + +```haskell +maximum :: (Ord a, Foldable t) => t a -> a +``` + +```haskell +minimum :: (Ord a, Foldable t) => t a -> a +``` + +```haskell +sum :: (Num a, Foldable f) => f a -> a +``` + +```haskell +product :: (Num a, Foldable f) => f a -> a +``` + +#### Folding actions + +```haskell +traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () +``` + +```haskell +for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () +``` + +*Example*: + +```haskell +>>> for_ [1..4] print +1 +2 +3 +4 +``` + + +#### Applicative Folds + +```haskell +sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f () +``` + +```haskell +asum :: (Foldable t, Alternative f) => t (f a) -> f a +``` + +#### Monadic Folds + +```haskell +mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () +``` + +```haskell +forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () +``` + +```haskell +sequence_ :: (Foldable t, Monad m) => t (m a) -> m () +``` + +```haskell +msum :: (Foldable t, MonadPlus m) => t (m a) -> m a +``` + +```haskell +foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b +``` + +```haskell +foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b +``` + +#### Specialized folds + +```haskell +concat :: Foldable t => t [a] -> [a] +``` + +```haskell +concatMap :: Foldable t => (a -> [b]) -> t a -> [b] +``` + +```haskell +and :: Foldable t => t Bool -> Bool +``` + +```haskell +or :: Foldable t => t Bool -> Bool +``` + +```haskell +any :: Foldable t => (a -> Bool) -> t a -> Bool +``` + +```haskell +all :: Foldable t => (a -> Bool) -> t a -> Bool +``` + +```haskell +maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a +``` + +```haskell +minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a +``` + +#### Searches + +```haskell +notElem :: (Foldable t, Eq a) => a -> t a -> Bool +``` + +```haskell +find :: Foldable t => (a -> Bool) -> t a -> Maybe a +``` diff --git a/docs/Generics.md b/docs/Generics.md new file mode 100644 index 000000000..ab46d3cda --- /dev/null +++ b/docs/Generics.md @@ -0,0 +1,2 @@ +Generics +======== diff --git a/docs/Hashing.md b/docs/Hashing.md new file mode 100644 index 000000000..db193d977 --- /dev/null +++ b/docs/Hashing.md @@ -0,0 +1,14 @@ +Hashing +======= + +```haskell +hashWithSalt :: Hashable a => Int -> a -> Int +``` + +```haskell +hash :: Hashable a => a -> Int +``` + +```haskell +hashUsing :: Hashable b => (a -> b) -> Int -> a -> Int +``` diff --git a/docs/Numbers.md b/docs/Numbers.md index d5de5acb0..134ae728f 100644 --- a/docs/Numbers.md +++ b/docs/Numbers.md @@ -11,3 +11,21 @@ Numbers * Word16 * Word32 * Word64 + +Arithemtic +---------- + +Trigonometric +------------- + +Comparisons +----------- + +Ratios +------ + +Complex Numbers +--------------- + +Conversions +----------- diff --git a/docs/index.rst b/docs/index.rst index 74f7088dc..98aedfc9d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -35,6 +35,7 @@ An alternative Prelude. Set Tuple Generics + Hashable TypeLevel Unsafe