Skip to content

Commit

Permalink
Style improvements to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinheghan committed Mar 17, 2024
1 parent 6087934 commit f646e05
Show file tree
Hide file tree
Showing 25 changed files with 110 additions and 166 deletions.
2 changes: 1 addition & 1 deletion gren.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"Debug"
],
"Effects": [
"Platform",
"Platform.Cmd",
"Platform.Sub",
"Platform",
"Process",
"Task"
],
Expand Down
14 changes: 6 additions & 8 deletions src/Array.gren
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,35 @@ functions to help you work with them.
@docs Array


# Create

@docs empty, singleton, initialize, repeat, range


# Transform
## Transform

@docs map, indexedMap, foldl, foldr, filter, filterMap, reverse


# Query
## Query

@docs isEmpty, length, get, findFirst, findLast, member, any, all, minimum, maximum


# Modify
## Modify

@docs set, update, pushFirst, pushLast


# Combine
## Combine

@docs prefix, postfix, flatten, flatMap, intersperse, map2, map3


# Deconstruct
## Deconstruct

@docs slice, dropFirst, dropLast, takeFirst, takeLast, popFirst, popLast, first, last, partition


# Sort
## Sort

@docs sort, sortBy, sortWith

Expand Down
14 changes: 7 additions & 7 deletions src/Basics.gren
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,40 @@ module Basics exposing
{-| Tons of useful functions that get imported by default.


# Math
## Numbers

@docs Int, (+), (-), (*), (/), (//), (^), negate


# Float
## Float

@docs Float, toFloat, isNaN, isInfinite


# Equality
## Equality

@docs (==), (/=)


# Comparison
## Comparison

These functions only work on `comparable` types. This includes numbers,
characters, strings and arrays of comparable things.

@docs Order, (<), (>), (<=), (>=), max, min, clamp, compare


# Booleans
## Booleans

@docs Bool, not, (&&), (||), xor


# Append Strings and Lists
## Append Strings and Lists

@docs (++)


# Function Helpers
## Function Helpers

@docs identity, always, (<|), (|>), (<<), (>>), Never, never

Expand Down
6 changes: 2 additions & 4 deletions src/Bitwise.gren
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ module Bitwise exposing
, shiftLeftBy, shiftRightBy, shiftRightZfBy
)

{-| Library for [bitwise operations](https://en.wikipedia.org/wiki/Bitwise_operation).
{-| Functions for doing [bitwise operations](https://en.wikipedia.org/wiki/Bitwise_operation).


# Basic Operations

@docs and, or, xor, complement


# Bit Shifts
## Bit Shifts

@docs shiftLeftBy, shiftRightBy, shiftRightZfBy

Expand Down
5 changes: 2 additions & 3 deletions src/Bytes.gren
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ module Bytes exposing
)


{-|
{-| Functions for working with sequences of bytes.

# Bytes
@docs Bytes, width

# Endianness
## Endianness
@docs Endianness, getHostEndianness

-}
Expand Down
21 changes: 10 additions & 11 deletions src/Bytes/Decode.gren
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,31 @@ module Bytes.Decode exposing
)


{-|
{-| Functions for creating things from a sequence of bytes.

# Decoders
@docs Decoder, decode

# Integers
@docs signedInt8, signedInt16, signedInt32,
unsignedInt8, unsignedInt16, unsignedInt32
## Integers
@docs signedInt8, signedInt16, signedInt32, unsignedInt8, unsignedInt16, unsignedInt32

# Floats
## Floats
@docs float32, float64

# Bytes
## Bytes
@docs bytes

# Strings
## Strings
@docs string

# Map
## Map
@docs map, map2, map3, map4, map5

# And Then
## And Then
@docs andThen, succeed, fail

# Loop
## Loop
@docs Step, loop

-}


Expand Down
16 changes: 7 additions & 9 deletions src/Bytes/Encode.gren
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ module Bytes.Encode exposing
)


{-|
{-| Functions for turning things into bytes.

# Encoders
@docs encode, Encoder, sequence
@docs Encoder, encode, sequence

# Integers
@docs signedInt8, signedInt16, signedInt32,
unsignedInt8, unsignedInt16, unsignedInt32
## Integers
@docs signedInt8, signedInt16, signedInt32, unsignedInt8, unsignedInt16, unsignedInt32

# Floats
## Floats
@docs float32, float64

# Bytes
## Bytes
@docs bytes

# Strings
## Strings
@docs string, getStringWidth

-}
Expand Down
10 changes: 4 additions & 6 deletions src/Char.gren
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,25 @@ module Char exposing
`'a'` pair of single quotes.


# Characters

@docs Char


# ASCII Letters
## ASCII Letters

@docs isUpper, isLower, isAlpha, isAlphaNum


# Digits
## Digits

@docs isDigit, isOctDigit, isHexDigit


# Conversion
## Conversion

@docs toUpper, toLower, toLocaleUpper, toLocaleLower


# Unicode Code Points
## Unicode Code Points

@docs toCode, fromCode

Expand Down
3 changes: 0 additions & 3 deletions src/Debug.gren
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ module Debug exposing (toString, log, todo)
{-| This module can be useful while _developing_ an application. It is not
available for use in packages or production.


# Debugging

@docs toString, log, todo

-}
Expand Down
13 changes: 5 additions & 8 deletions src/Dict.gren
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,34 @@ lists of comparable types.
Insert, remove, and query operations all take _O(log n)_ time.


# Dictionaries

@docs Dict


# Build

@docs empty, singleton, insert, update, remove


# Query
## Query

@docs isEmpty, member, get, size


# Arrays
## Arrays

@docs keys, values, toArray, fromArray


# Transform
## Transform

@docs map, foldl, foldr, filter, partition


# Combine
## Combine

@docs union, intersect, diff, merge

-}


import Array exposing (Array)
import Basics exposing (..)
import Maybe exposing (..)
Expand Down
16 changes: 7 additions & 9 deletions src/Json/Decode.gren
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,41 @@ module Json.Decode exposing
, lazy, value, null, succeed, fail, andThen
)

{-| Turn JSON values into Gren values. Definitely check out this [intro to
{-| Turn JSON values into Gren values. We've inherited this from Elm. Definitely check out this [intro to
JSON decoders][guide] to get a feel for how this library works!

[guide]: https://guide.elm-lang.org/effects/json.html


# Primitives

@docs Decoder, string, bool, int, float


# Data Structures
## Data Structures

@docs nullable, array, dict, keyValuePairs, oneOrMore


# Object Primitives
## Object Primitives

@docs field, at, index


# Inconsistent Structure
## Inconsistent Structure

@docs maybe, oneOf


# Run Decoders
## Run Decoders

@docs decodeString, decodeValue, Value, Error, errorToString


# Mapping
## Mapping

@docs map, map2, map3, map4, map5, map6, map7, map8


# Fancy Decoding
## Fancy Decoding

@docs lazy, value, null, succeed, fail, andThen

Expand Down
10 changes: 4 additions & 6 deletions src/Json/Encode.gren
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ module Json.Encode exposing
, object, dict
)

{-| Library for turning Gren values into Json values.
{-| Functions for turning Gren values into Json values.


# Encoding

@docs encode, Value


# Primitives
## Primitives

@docs string, int, float, bool, null


# Arrays
## Arrays

@docs array, set


# Objects
## Objects

@docs object, dict

Expand Down
6 changes: 2 additions & 4 deletions src/Math.gren
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ module Math exposing
{-| Functions for doing math


# Math

@docs round, floor, ceiling, truncate, modBy, remainderBy, abs, sqrt, logBase, e


# Angles
## Angles

@docs degrees, radians, turns


# Trigonometry
## Trigonometry

@docs pi, cos, sin, tan, acos, asin, atan, atan2

Expand Down
Loading

0 comments on commit f646e05

Please sign in to comment.