Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/nekos-best/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thusuzzee committed Dec 15, 2023
2 parents 9b91109 + 4972b5b commit 82bd04d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [C++](examples/unofficial/c++.md)
- [Dart](examples/unofficial/dart.md)
- [Go](examples/unofficial/go.md)
- [Haskell](examples/unofficial/haskell.md)
- [Rust](examples/unofficial/rust.md)
<!-- PLEASE ALPHABETICALLY -->

Expand Down
61 changes: 61 additions & 0 deletions src/examples/unofficial/haskell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Haskell

---

## Installation

The [nekos-best](https://hackage.haskell.org/package/nekos-best) package is available on Hackage and can be added to the .cabal file

```
build-depends:
nekos-best ^>= 0.2.0.0,
...
```

## Usage

Get a neko image

```haskell
import NekosBest.API (getNbImage)
import qualified NekosBest.Category as C

main = do
res <- getNbImage C.Neko
print res
```

___

For random images use `randomNbImage` passing a `RandomGen` value

```haskell
import NekosBest.API (randomNbImage)
import qualified NekosBest.Category as C

main = do
gen <- getStdGen
(res, gen') <- randomNbImage gen
print res

```
___

Downloading an image

```haskell
import NekosBest.API (getNbImage, downloadNbImage)
import qualified NekosBest.Category as C

main = do
res <- getNbImage C.Neko
mapM_ (\x -> downloadNbImage x "filename") res
```

## About

> Example added by: [**xQuantx**](https://github.com/xquantxz)
>
> The source code is available at [**GitHub**](https://github.com/xquantxz/nekos-best.hs)
>
> ![NekosBest](https://img.shields.io/hackage/v/nekos-best.svg) ![NekosBest](https://img.shields.io/github/license/xquantxz/nekos-best%2ehs.svg) ![NekoBest](https://img.shields.io/github/issues/xquantxz/nekos-best%2ehs.svg)
2 changes: 1 addition & 1 deletion src/examples/unofficial/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ All functions become blocking when used with the "blocking" feature.

## About

> Example added by: [**Dinu Blanovschi**](https://github.com/dnbln)
> Example added by: [**dnbln**](https://github.com/dnbln)
>
> The source code is available at [**GitHub**](https://github.com/dnbln/nb-rs)
>
Expand Down

0 comments on commit 82bd04d

Please sign in to comment.